Another Newbie Question: C or C++
abowhill at blarg.net
Tue Nov 11 20:06:06 PST 2003
>>I need to buy a book on C or C++ to help me in FreeBSD. Which would be
>> better to buy?
>>I first thought a book on C would be best, because the OS is written in
>> C. But, now I'm not sure because I read that gcc can compile C++ too
>> (so, I'm assuming C++ must get used too).
>I can recommend "Who's afraid of C++?" by Steve Heller. It's good as the >very
>first programming book to read, very easy to understand.
I would recommend not trying to learn C or C++ by yourself from a book.
The fastest (and best way) to learn the right stuff is to take coursework from a university or community college.
If the courses are any good, you'll get feedback, and you'll be paced
and challenged with projects designed to help you learn.
Going it alone in an unguided environment will only familiarize you
the lesser aspects of a language, if you last that long. The difficult
and most important aspects of the language (like pointers, virtual functions, references) will become almost insurmountable trial-and-error obstacles if you try to teach yourself.
For example, pointers, found both in C and C++ are a very hard thing
to learn the first time around. You msy find yourself buying book after book, looking for explanations when you really should be learning in a guided environment where you clarify things with other people.
If you try to teach yourself, you won't get proper exposure to good programming practices and the software development process, such as planning and documentation, modularization, good interface design, commenting code, using the debugger, writing good tests, etc. This knowlege is more important to effective programming than learning the mechanics, and distinguish professionals from cheap hacks.
More information about the freebsd-questions