Fog Creek Software
Discussion Board




Learning C++

I have a co-worker who has taken basic level c++ courses at a local college.  His primary focus is a system admin but he wants to start programming.  What are some good resources, be it book, website, etc, that can help him take his basic c++ skills to the next level?

Matt Watson
Monday, June 10, 2002

Other than the obvious books by Stroustrup, Meyers and Herb Sutter:

Bruce Eckel's "Thinking in C++"
http://www.mindview.net/Books/DownloadSites

Guru of the Week
http://www.gotw.ca/gotw/index.htm

Conversation with a Guru
http://www.gotw.ca/conv/index.htm

Effective C++ Magazine
http://www.awprofessional.com/meyerscddemo/DEMO/MAGAZINE/INDEX.HTM

CUJ Experts
http://www.cuj.com/experts/

Well, I think that's enough for a start =)

Sebastian Wagner
Monday, June 10, 2002

I forgot to mention "Modern C++ Design" which is very advanced (better use a *good* compiler) and teaches a lot about meta-programming with C++. If you are interested in this you may want to take a look at:

Todd Veldhuizen's Homepage
http://osl.iu.edu/~tveldhui/index.html

Sebastian Wagner
Monday, June 10, 2002

Lippman, et al, C++ Primer.  Lippman was on the original C++ dev team, and the co-author was (is?) on the C++ Standard committee.

Beyond that, picking some project and just working is really the best way to learn any language, or programming in general.

James Montebello
Monday, June 10, 2002

I really like "Accelerated C++" by Koenig & Moo. It's billed as a beginner's book, but it covers just about all of the features of the language that I would use on a regular basis, is nice and short, and is a pleasure to read. Perhaps followed up with "Ruminations on C++" by the same authors.

Andrew Simmons
Monday, June 10, 2002

I second the "Accelerated C++" Koenig/Moo vote.

Troy King
Monday, June 10, 2002

So far "C++ The Complete Reference" by Herb Schildt is the best for me.

EMB
Monday, June 10, 2002

I'm not qualified to judge, but those in the know seem to feel that Schildt's books on C and C++, while easy to read, are often inaccurate and misleading - eg see the review of "C++ The Complete Reference" at the ACCU site:

http://www.accu.org/cgi-bin/accu/rvout.cgi?from=0au_s&file=cp000413a

Andrew Simmons
Monday, June 10, 2002


Thought it is not a C++ book, Steve McConnell's "CODE COMPLETE: A Practical Handbook of Software Construction" is indispensible for new programmers! I cannot recommend this book enough!

http://www.amazon.com/exec/obidos/ASIN/1556154844/qid=1023764377/sr=8-1/ref=sr_8_1/102-9661101-7154537

Banana Fred
Monday, June 10, 2002

Do not start with reading a book about C++, instead start by reading, "The C Programming Language", by Brian W. Kernighan and Dennis M. Ritchie. And studdy it until you know not just HOW the C language is constructed but WHY it was constructed in this way.

When you have done that you could read "Stroustrup: The C++ Programming Language" and do the same with that book.

Then buy a good C/C++ reference that covers the lastest ANSI/ISO standard of C++.

By doing this in this why you will UNDERSTAND the language an ability you will not get from just reading a regular C++ book. In my experience far to few C/C++ programmers realy understands the language, wich offen leads to quite horrible and hard to read pracices that could be much simplified if the programmers understod the langage better and not tried to use it like they use Java,Pascal or whatever other language they were programming before they began to use C/C++.

Bjorn
Tuesday, June 11, 2002

Odds are., he will never get a job doing C++.  There is a catch-22 in certain niches, where no one will hire you unless you have real experience.  Unless he figures out a way to do that, his efforts are better spent elsewhere.

Bella
Tuesday, June 11, 2002

Thanks for all of the info, I will pass it all on.  And Yes he will get a Job doing c++ because my boss wants to hire him to work with me but he needs some more training first.  Thanks again everyone!

Matt Watson
Tuesday, June 11, 2002

Good thing he snagged a job.  Our local uni just graduated ~200 MIS majors, which equals about 45% of the total business school graduates.  I don't know what they plan on doing, but if its coding they won't be doing it around here - local economy wasn't good before the boom & just sucks worse now.  I used MIS as an example instead of CS because the MIS guys actually learn how to code (c++, java, sql, etc...).

those who know me have no need of my name
Tuesday, June 11, 2002

I'm going to break with tradition and recommend that he NOT study C first. The problem is that, while C is the building block of C++, they are very different languages. And if he already knows the basics of C++, he will not get much out of it.

I can always tell if the C++ code I'm looking at was written by a C head. They litter their code with structs when a class is much more appropriate. And they over use pointers because they just don't think about using a reference instead.

C is useful in that you learn a lot about why the language works the way it does, but that is about it. And again, if you already understand C++, all you get from C is a collection of things you CAN'T do. C++ after all can do everything C does.

I will say that getting a job could be difficult because of the experience issue (mentioned before). About the only way around that is to write something yourself. If you want to write games, then make a small game. If you want to write a business application, try building a utility for an existing package. These small programs go a long way to showing that you know what you are doing. They may not impress the average end-user but it does impress potential employers. It shows you know how to code, manage time, think things through, and that you have the initiative required.

Marc

Marc LaFleur
Tuesday, June 11, 2002

"I used MIS as an example instead of CS because the MIS guys actually learn how to code"

Umm, I think most high-end shops would rather hire a CS major instead of an MIS major.  CS majors know how to code on a much higher level than MIS majors.  College coding experience isn't worth much anyway.  That's why CS schools usually focus heavily on theory.  BTW, in my CS degree I coded in Smallatalk, Java, C, C++, assembly, and VB.

OzzieGT
Tuesday, June 11, 2002

That sounded like a dig Ozzie, but I didn't mean it that way.  I majored in CS and am glad I did.  IMHO the ideas I learned in CS will outlast whatever technology du jour that the MIS majors are learning.  Don't get me wrong though, it took some careful mentoring (by a guy without a degree, nonetheless) to get me up to speed on how to go about things in the 'real' world.

those who know me have no need of my name
Tuesday, June 11, 2002

I'm in second grade at university and I already got 2 full-time jobs *because* I know C++. It's a rare feature and when you're good at it all other languages seem like toys. I learned Java in 2 days when I needed it.

Sebastian Wagner
Tuesday, June 11, 2002

"Don't get me wrong though, it took some careful mentoring (by a guy without a degree, nonetheless) to get me up to speed on how to go about things in the 'real' world."

Yeah, I had a similar experience, but I had to teach myself. That is why I stated that college coding experience isn't worth much...no matter what degree you have.  I guess that is why lots of smaller shops look for experienced people; they do not have time to bring a college hire up to speed on the 'real world'.  I also have wondered about the catch-22 with experience.  This is very obvious in the game industry...just about any software development house worth anything is looking for experience in game development.  What's a newbie supposed to do?  I guess on of the most feasable ways to go is try to get a job with a larger company that is willing to take on someone with little experience, and build up experience through that before moving on to bigger things.  Or, like someone else mentioned, just start working on your own.  But that takes time and really doesn't generate much of an income...

OzzieGT
Tuesday, June 11, 2002

Yeah, well I'd hire a EE over a CS or MIS any day of the week.  After all CS is just the bastardized step child of real engineering in the real world.  Better if the guy can write B-trees using FORTRAN arrays.  Even better if he can port Linux to a TI DSP processor using a DIP switch and LEDs.

yadda...

C/C++ is the most important tool in the box because it makes the machines run.  Learn it.

Nat Ersoz
Tuesday, June 11, 2002

"all other languages seem like toys. I learned Java in 2 days when I needed it. "

Well, the thing with Java (and alot of other environments these days) is that the language is easy as these things go. And if you are already down with the {}-syntax it SHOULDNT take more than a weekend to learn.
Knowing the API and J2EE however takes more time, and that is what Java coders get paid for IME.

You can usually recognize java code written by C++ coders because they write their own string tokenizers and stuff ;D

Eric DeBois
Tuesday, June 11, 2002

I agree Nat.  I wish I would've taken the CE option under the EE degree.  Either that or business. 

I wonder, given the BSCS, if I got an electronics certificate at the votech if it would be enough to qualify me for some of these 'real' programmer jobs?

those who know me have no need of my name
Tuesday, June 11, 2002

"Knowing the API and J2EE however takes more time, and that is what Java coders get paid for IME."

That's correct of course. But the important thing is: the other way around it doesn't work out =) A Java developer learning C++ will have to struggle quite a lot. He has to learn about pointers, destructors, copy constructors, smart pointers, [insert big huge list here :].

Java is an OOP language. C++ supports OOP, procedural, generic and meta-programming.

Building up Java know-how to get a job isn't done in 2 days, but learning enough C++ to get stuff done takes years. When you've gone through it there's few left to be afraid of =) And you'll have *really* learned a lot about how software works.

Sebastian Wagner
Tuesday, June 11, 2002

I agree with " those who know me have no need of my name", except I don't know what I'm doing here...

Nat Ersoz
Tuesday, June 11, 2002

I'd hire someone with a PhD in physics. At least they'd realise it's electricity that makes the machines go, not C/C++

Andrew Simmons
Tuesday, June 11, 2002

Andrew Simmons:

I hope it'd be true coz I my first degree is in physics and I know a bit how the electrons move in the conductor and transistors.  :)

Sam Wong
Tuesday, June 11, 2002

"I learned Java in 2 days when I needed it. "

That laughable statement just shows how little you know about Java.  The plethora of API's are staggering now, but in your lengthy 2 days, you probably didn't even learn the acronyms to half of them.  Anyone who thinks he's got it all figured out is usually has a lot to learn.  There's more to Java than inheritance and for loops.

Bella
Tuesday, June 11, 2002

> BTW, in my CS degree I coded in Smallatalk, Java, C, C++, assembly, and VB.


A real CS major is mostly theory, and not language dependent.  .  If you INCIDENTALLY learned those languages, then great, but the point of a CS major is not to learn those languages.

You should have covered things like assember, computer architecture, logic, math, algorithms, symbolic programming, large systems, parallel systems, computing theory (Automata, turing, etc), complier design, AI, graphics, OS's

And yes, one may rightfully debate the merits of the pragmatism of that approach to.  In the business realm, I would rather hire an MIS major than a CS major.  Very few coding tasks jobs require knowledge of deep CS theory.  xGL's have made things MUCH more trivial.

Bella
Tuesday, June 11, 2002

Bella, how about reading further before shouting?

Sebastian Wagner
Wednesday, June 12, 2002

Re-reading my posts I now want to clarify that my intention was not to state Java know-how is worth less than C++ know-how. After all - if you can make a living of it, that's what it's all about. You are right that I don't know much about Java (not that I'm interested very much).

What I intended to state was that C++ is a bit deeper on the abstraction ladder and the *language* (as opposed to API's that are bundled with the distribution) is more complex and harder to master. Also with template mechanism you can design certain things naturally in a way impossible in Java (although I don't know if they are going or already have added generic programming?).

Maybe I sounded too harsh (saying I learned Java as opposed to Java *language* and design), but then, you Bella aren't exactly much better....

Sebastian Wagner
Wednesday, June 12, 2002

>C/C++ is the most important tool in the box because it makes the machines run. Learn it.

*argl*

No, don't! Learn C if you like. Learn C++ if you like. Learn both, if you see a reason for it. But please, do not learn anything that calls itself C/C++!!! Stay away from all books and trainings that claim to teach you something like this. C and C++ are two different languages.

I agree that C++ as well as C are maybe the most "important" languages around and well worth learning, though.

Have fun,

Jutta Jordans
Wednesday, June 12, 2002

Marc and Juttas is wrong, dead wrong,

What's important when you learn a new language, is not that you learn the language but that you UNDERSTAND it, you won't get that from any book called Modern/Practical/ [insert your own nonsense word her] C++ because most of these authors have not the faintest UNDERSTANDING of what the language is all about, they sure can tell you about why they think multiple inheritance or good/bad (depending on author), but they have not the faintest idéa why its in the language in the first place.

That's why you have to read a book by someone who UNDERSTANDS the language you are using like "Kernighan, Ritchie:The C Programming Language" and "Stroustrup:The C++ Programming Language", because these guys UNDERSTANDS the languages (they created the languages didn't they).

And NO C and C++ is not as different as people in this discusion seems to think, C++ adds a lot of nifty syntax changes but it is still a low-level language, it's not typsafe (NO STL does not make it typesafe), you have to be constantly aware of how you allocates memory and about the difference between the heap and the stack (actualy you have to be more aware in C++ than in C as these features is less ovious in C++).

But yes there IS a big DIFFERENCE between C and C++, but its not the language itself, its the CONVENTIONS how you use it, the CULTURE if you like, its important that you UNDERSTANDS these, but you also have to be aware that it is just that, that C++ is still just a low-level language (sort of a cross platform macro assembler), when we programms in C++ we just PRETENDS that it is a high level language with a high level like syntax and a lot of CONVENTIONS.

If you plan to use C++ for anything else than simple serverside webprogramming or small utilities in MFC you need to UNDERSTAND this not just knowing about it.

Believe me, there is a lot of things in C++ that may look like things in high-level languages like JAVA that realy is something very different, exceptions in C++ may look like exceptions in JAVA but they are not the same, calling a virtual method in C++ may seem like the same thing as calling a method in JAVA but they as different as night and day (but with similar syntax), casting an object in C++ and JAVA may have the exact same syntax but they are entirely different, if you are serious about using C++ you have to UNDERSTAND this.

PS
I am NOT writing this to piss anyone of, if someone feels offended by my opinions its unintetional. Marc and Juttas probably is both exprienced and talented C++ programmers, I just don't agree with there opinions.
DS

Bjorn
Wednesday, June 12, 2002

Bjorn,

I did not disagree with the recommondation to read Ritchie/Kerningham and Stroustrup. I would say this is the way to go if you really want to understand C and C++. For beginners of C++ I would recommend reading the already mentioned Accelerated C++ first, though (these authors really know what they are talking about). I just wanted to make the point that C and C++ differ a lot in the concepts that are considered good practice in either language. These concepts are what makes a good programmer IMHO. Learning the syntax of C or C++ can be done in a few days. I am just sick of people stating that they program C/C++ because their code is normally bare of concepts at all. (Even though I normally use C++, I am able to write pure C if I have to and have done so in the past. I would not consider any of the two languages "superior" to the other, I prefer C++ for my line of work since it makes it easier to implement object oriented and generic designs.)

Sorry if I offended. I read a book once called "C++ for dummies" which was really maybe the worst book on C++ I ever found, because it tried to teach C++ to former C programmers by just introducing the new syntactic elements of the language. (like: instead of malloc you now use new etc.), which IMO leads to what I mean, programmers thinking they do C++ now because they changed some keywords in their code but still doing C. This is just not the way to go.

There is nothing wrong with learning C and C++ both and much knowledge from one language will be helpful for the other of course. Bjorn, I guess our points of view are not that far apart.

Have fun,

Jutta Jordans
Wednesday, June 12, 2002

Hrm, Bjarne seems to think C and C++ are growing apart: http://www.cuj.com/current/feature.htm?topic=current

Richard Berg
Wednesday, June 12, 2002

"A real CS major is mostly theory, and not language dependent. . If you INCIDENTALLY learned those languages, then great, but the point of a CS major is not to learn those languages."

Right, the languages are the tools used to learn the theory.  I was just pointing out my language experience because the previous post implied that CS major's don't code.

Nat, what skills you are looking for really depends on what your shop does.  Some shops don't really need to 'make the machine run', but they do need to write software to get the job done.  And honestly it doesn't really matter to most CS majors what your opinions are of a CS degree.  If someone can "port Linux to a TI DSP processor using a DIP switch and LEDs", well he's just a damn genius and it wouldn't matter what his degree was...

OzzieGT
Wednesday, June 12, 2002

I was being a smartass...  (mostly).

Nat Ersoz
Wednesday, June 12, 2002

"calling a virtual method in C++ may seem like the same thing as calling a method in JAVA but they as different as night and day (but with similar syntax), casting an object in C++ and JAVA may have the exact same syntax but they are entirely different, if you are serious about using C++ you have to UNDERSTAND this."

Why? No, really... I thought I understood C++ but you have me worried.

Java is statically typed. The method invocation is pretty similar. (If you were to compare with objective C or Python or any other dynamically typed language I might be more inclined to agree.)

I hope you'll excuse the nitpick that casts in C++ are syntactically very different frow those in Java. It inherits a type of cast from C that looks like the Java one but which is very badly behaved.

tommyhl
Thursday, June 13, 2002

Hi,

I am selling on Ebay book called Teach Yourself C++ in 21 Days. There is
very low starting bid, so if you are interested, bid on it.

Address is: http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=3577694640

P.S. I offering free bonus for winner

P.P.S. Happy New Year!

Nick Praskaton
Saturday, January 03, 2004

*  Recent Topics

*  Fog Creek Home