Another Newbie Question: C or C++

yo _ exhausted01 at
Mon Nov 10 18:38:08 PST 2003

>>I need to buy a book on C or C++ to help me in FreeBSD. Which would be 
>>better to buy?

If you just want to start programming in FreeBSD, Learn C as well as you 
can. The route I took was learning basic programming skills then reading 
"The C Programming Language" by K&R, it's an excellent book if you are 
already very familiar with the computer and have some basic programming 
skills (make sure you know your c development enviroment and how to use 
gcc). The book is so great because not only does it teach C syntax, the 
examples open your mind to writing simple and efficient code in a C style, 
and it even has a small UNIX programming tutorial toward the end (on how to 
implement some of the standard library functions in a UNIX system).

That book and a good familiarity with the man pages is really all you need 
to get started coding on FreeBSD. If you are still a little lost and really 
want to go on the quick route to good BSD programming, read "UNIX Network 
Programming" by W. Richard Stevens. The original edition introduces you to 
good fundamental knowledge of the UNIX system and archictecture (process 
model, system calls, and IPC) then it goes right to socket programming which 
is a must to know especially in this day and age. The later editions 
seperate the actual socket programming from the unix stuff but go intensely 
in depth. That's why i'm fonder of the first edition, concise and smart.

>>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).

Now that you've had good practice with C and UNIX programming, learning 
libraries (GTK, QT, pthreads, GD to name a few) is simply a matter of 
reference and learning any other language else is simply a matter of syntax 
and style, and everything will come very easy. If you haven't learned C++ by 
that point just figure out what Object Oriented programming is (it'll 
beautify your life), get a reference book, look at some coding examples, and 
no sweat. Java? Perl? Python? Javascript? Visual Basic (haha)? They'll all 
just be minor changes in syntax and style when in comes to C/C++ (except for 
python, hah).

Hope that helps and good luck!
-Rian Hunter

MSN Messenger with backgrounds, emoticons and more.

More information about the freebsd-questions mailing list