Archived

This topic is now archived and is closed to further replies.

cone3d

Need some test-monkeys .... :)

Recommended Posts

Hi all! Over the past weeks/months I have created many C/C++ tutorials on my site. Now I have got 9 of them done. Could any of you beginners, who don''t know (or know very little of) C/C++ go check them out and comment on everything that needs commenting. I want to know what other people think of them and can they be used for learning (will you learn something by reading them). The site is: http://cone3d.gz.ee. Thanx in advance.

---
cone3d
http://cone3d.gamedev.net
Multitasking = screwing up several things at once.

Share this post


Link to post
Share on other sites
I''m no beginner, but I have comments nonetheless.

I think it''s not a good idea to jump into programming head-first. I think you need to explain the fundamental concepts of variables and constants, statememts, conditionals, etc (illustrating with small but complete programs at each stage) rather than dropping a program and then deconstructing it.

Also, there''s a fair amount of misinformation in your first tutorial (I haven''t read the rest yet, so watch out! )

  1. C++ is not "simply a newer version of C (with added functionality)." There is a radical shift in approach and methodology encouraged and facilitated by C++.

  2. You really shouldn''t encourage the use of Standard C Library functions (such as printf()) if you''re teaching C++, especially to beginners. Overcome your personal preferences.

  3. Since you''re using library functions, use kbhit() to make the application pause so the user can see their handiwork rather than that fugly scanf() hack.

  4. You don''t explain exactly what "\n" is or why we use it when we print output (which is why you should introduce cout instead; it''s conceptually easier to grasp)



Oh, and it''s recipe , not receipt . You get a receipt when you buy a cake at the bakery; you follow a recipe to bake it.

Keep up the good work, and I''ll continue to give you my comments on your tutorials (if you appreciate them).

Share this post


Link to post
Share on other sites
small kvetch:

quote:
if(Frisky.age = 2) print("Frisky is 2 years old\n");

No the braces are not needed. If you answered "no" now, then look again. Anyway inside if(...) we don''t check if Frisky''s age equals one. We MAKE IT EQUAL one. That can cause a lot of problems later.


I think you mean two.

Share this post


Link to post
Share on other sites
quote:
Original post by Oluseyi
You really shouldn''t encourage the use of Standard C Library functions (such as printf()) if you''re teaching C++, especially to beginners. Overcome your personal preferences.


Or write a C tutorial . I still use a lot of the C i/o library even in C++, it''s a habit and I''m not changing it . That''s also why I wouldn''t write a C++ tutorial, heh.

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Oluseyi



Also, there''s a fair amount of misinformation in your first tutorial (I haven''t read the rest yet, so watch out! )

  • C++ is not "simply a newer version of C (with added functionality)." There is a radical shift in approach and methodology encouraged and facilitated by C++.





  • Err... C++ /is/ a newer version of C with added functionality. Object oriented programming is not required in C++. You can use plain old structured programming. Also, you can write object oriented programs in C (by passing structs around and naming things inventively.) Don''t confuse programming styles with programming languages.

    quote:

  • You really shouldn''t encourage the use of Standard C Library functions (such as printf()) if you''re teaching C++, especially to beginners. Overcome your personal preferences.




  • Over come yours! They both work and they''re mostly equivalent. You''ve got to pick one, and I''d prefer a teacher to go over the material they are more comfortable with.

    quote:

  • Since you''re using library functions, use kbhit() to make the application pause so the user can see their handiwork rather than that fugly scanf() hack.




  • kbhit() is platform specific. scanf works everywhere.

    quote:

  • You don''t explain exactly what "\n" is or why we use it when we print output (which is why you should introduce cout instead; it''s conceptually easier to grasp)




  • Good point. Newlines, Linefeeds + newlines and so on is a big gotcha for some people.

    Share this post


    Link to post
    Share on other sites
    quote:
    Original post by Anonymous Poster
    ...don''t confuse programming styles with programming languages.

    Note that I used the word encouraged . You can do anything you want, but the language was designed with a certain basic usage in mind. If you''re teaching the language, teach that first so the students gain a proper comprehension of the abilities of the language.

    And how would you implement multiple inheritance (evil as it is) in C? Or even single inheritance? I''ve defended the writing of OO code in C several times on these forums, but I recognize that C++ is a better suited tool for the job. A pair of pliers and a spanner can both undo a nut; why do we advise the spanner?

    quote:
    Over come yours! They both work and they''re mostly equivalent. You''ve got to pick one, and I''d prefer a teacher to go over the material they are more comfortable with.

    Again, see above. Stream I/O was designed for a reason - it makes most tasks simpler, so why not use it? (There''s no noticeable performance gain or loss either way) For example, using cout you can postpone discussion of format specifiers till you start to cover sprintf(), and you can skip them entirely if you use stdiostreams.

    quote:
    kbhit() is platform specific. scanf works everywhere.

    Point well taken. I stand corrected.

    I still think it''s fugly though.

    Share this post


    Link to post
    Share on other sites
    quote:
    Original post by Oluseyi
    Stream I/O was designed for a reason - it makes most tasks simpler, so why not use it? (There''s no noticeable performance gain or loss either way)...


    That wholly depends on the compiler and the run time libraries it uses. MSVC''s stream libraries are slower than their C i/o libraries with a large enough data set (we won''t get into MSVC''s STL, heh). GCC''s stream libraries are about the same speed (I haven''t personally tested GCC, but I trust the person who told me that ).

    [Resist Windows XP''s Invasive Production Activation Technology!]

    Share this post


    Link to post
    Share on other sites