How not to learn C++

When a new user to C++ posts generally in a Linux forum/mailing list about how to learn C++ the following is a response which you will find.

If it were me, I’d pick some C++ open source tool I actually use and which I think is lacking some feature I care about. Then I’d get the source code and try to figure out where/how the related features are implemented, then add the feature I want.

So what is wrong with a large majority of Open Source projects.

  • Some use API specific calls which are not part of the C++ or C standard for example POSIX or WIN32.
  • Some use Undefined Behaviour without even knowing it.
  • Some use poor programming practices, such that they are like a tangled web.

OK so what if the Open Source project does not include any of the above?

I feel it is still incorrect to suggest for a new comer that they should delve into a large project. Unless the project is well documented (I do not mean in line comments) or Test Driven Developed ( TDD) which shows correct usage of the project, then you are asking a novice to the Language to find it out for themselves! Theses types of  projects are not designed with the core principle of being newbie friendly.  So please let us be considerate here, if we take this into the real world would you say to a school leaver?

The best way how to learn how to build a skyscraper is to look at that one over there and make some modifications.


Go and look at the electrics of that house and and add a spare to that circuit

Now you could learn something from a project like this, yet the downfalls far outweigh the benefits. These new comers could be building on very rocky foundations and learning how to design or implement wrongly from the outset. I think it is akin to a new comer posting a tutorial on line which another new comer will read and try to implement.

Coding is a profession so lets treat it like such, learn from books*  which are written by people with real knowledge and you will build on solid foundations.

*Disclaimer there are some really bad books. Cough


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: