Should you learn C++ in 2012?

Last year, the new C++ standard C++11 was finally published. It contains lot’s of interesting new stuff like lambdas, a threading library, a memory model, hash tables and much more.
See Bjarne Stroustrup’s C++11 FAQ for more on the new standard.

Nicolai Josuttis, author of the wonderful The C++ Standard Library: A Tutorial and Reference (2nd Edition)
recently said in an interview:
“Due to the complexity of C++, the support for the ordinary programmer is incredibly bad compared to other languages, and that’s a major drawback.”

I agree (but make sure to read the whole interview). Despite many improvements in C++11, C++ is still not an easy language. Java, while not as easy as some may think, is still an easier language with very good performance (often almost as fast as C++) and offers better IDEs (maybe Visual C++ is as good as current Java IDEs but no luck here on Linux), a much more comprehensive standard library (the JDK), more libraries (e.g. Hibernate, Spring, JEE, Lucene, etc) and no memory leaks (well, almost none – you can still build a memory leak in Java but it is more difficult to do so than in C++). To be fair, with modern C++11, it is much easier to avoid memory leeks.

Still, there are at least 4 very good reasons to learn C++ in 2012:

1) Raw performance
In some cases, highly optimized C++ can be faster than the best Java code. This won’t be easy and really tuning C++ can be time consuming (similar to all other languages) and error prone. Still, sometimes this is just what you need. This might be interesting, for example, with large data centers, scientific computing, bid data analysis, etc.

2) You are closer to the OS and Hardware
Although you can wrap OS system calls in other languages like Java or Python, sometimes you want to be very close to the OS, e.g. when writing device drivers or low level network servers. In those cases, C++ could be your fried. I would prefer C++ over C here as C++ is much more powerful and has a much better standard library.

3) You learn something!
This is the most important reason for me. I learned C++ more than 10 years ago and I learned a lot about programming, design and how to write clean code. And I think EVERY programmer should have used a language that requires you to allocate and free memory (it is much easier now with the latest C++ standard and stuff like smart pointers but you still need to understand how new and delete work in order to properly use C++). Many Java or Python programmers forget all about memory. Learning C++ will help you learn about memory management.
The C++ standard template library (STL) is one of the best crafted libraries out there and you will definitely learn something when you improve your understand of using this powerful library.

4) C++11 is much cooler than the older C++
C++11 has many cool features like lambdas, auto keyword, move semantics and much more. It is definitely a much better language than C++98 was.
See this overview by Herb Sutter about the new features in C++11:
Elements of Modern C++ Style.

To sum up, I think everyone should learn at least some C++. If you have been programming in Java, Scala, Ruby or Python for the last decade and never touched C or C++, now with C++11 I think it is time to learn C++11 and improve your programming skills while doing so.

I probably won’t be using C++ much at work in the coming years and when I need a more powerful language than Java, I will probably go for Scala, but I will have a closer look at C++11 and try to learn and understand the new features, particularly those about multithreading and concurrency.
Remember: It always helps to learn a new programming language even when you don’t plan to use it in production.

For learning C++11, here are a 3 good books (more on C++11 for sure will follow soon):

Great book on the new concurrency features of C++11.

The best book on the C++ standard library and one of the best programming books ever written. Now in it’s 2nd edition to cover C++11. I just god my copy and it is a fantastic book.

Use a simple movie making computer program to create a DVD for the gift giving occasion. Wrap the DVD and attach a note telling the recipient to watch the video right away. When making the DVD, search online and include clips of iconic and historic moments from the team history, such as record breaking plays, revered players in action or championship victories. End the film with a written message scrolling across the screen stating that the recipient will soon witness moments like these in person. Include the date and start time of the ticketed game.3. The 49ers’ physical brand of football: QB Alex Smith (20 26 211 2TD) deserves some real credit for how he played today at Lambeau in the 49ers’ 30 22 win over the Packers. But when I look at this game, the physical style of the Niners stands out. I love the way this San Fran secondary plays. They hit, fill in the run game and tackle. And you can add in Frank Gore (16 112 1TD), the D Line, etc. They were a more physical team than Green Bay on Sunday.Whenever I’d had a sugar pig out, I felt rubbish; so angry and disappointed with myself. I’d have huge slumps in energy, I gained weight and my clothes felt uncomfortable. Even my skin felt prickly I hated it. Then I started reading about all the health cheap jerseys wholesale benefits of cutting back on sugar, and not just for me, for my family too. Could we do it?NFL coaches begin preparing for the upcoming season only a few weeks after the Super Bowl is played. Coaches must evaluate collegiate talent at the NFL Scouting Combine in Indianapolis in late February, which is followed by NFL draft in April. They also have to consult with Wholesale Jerseys the team’s management about releasing players and signing free agents. The real work starts again during a series of mini camps in May and June, followed by the start of full training camp in late July and the first preseason games in August.Chiefs 28, Chargers 24.Oakland at New Orleans: Derek Carr is out to prove last year was no fluke as the Raiders try to prove they are truly on the upswing. The Saints are getting old fast and this could be Drew Brees’ last season at the helm if the Saints and Brees can’t come to terms. It can be a challenge to find some good, healthy alone time, especially when you have a job and are married with kids. But happy people make alone time a priority. Realize that it not a selfish act to take time Cheap china Jerseys out for you; it allows you to recharge so that you are able Fake Oakleys to give back to the world around you. And if you like it thicker, because that runny, use more glue. Basically they just took a bottle of glue and squirted it into an old jar with a lid so they could save the rest for later if needed. Then to ensure they used the same amount of water, they just filled the bottle with water and squeezed that in.

5 Comment

  1. LABB says: Reply

    I think C++ will survive and remain in use for a very long time. If you want knowledge and the power choose C++. If you don’t like studying and just want fast easy money choose the others. An assisted environment that helps you to speed up your work is vital and in the past the lack of one for C++ left a huge hole that make many people preferred Java and C# assisted IDEs. Now that has change or is changing, for those that are not still satisfied by the recent tools. So C++ will progressively recover presence and prominence. Networking could remain also an issue for many but also there an unbeatable solution soon or later will arrive, after al with C++ you can do anything. To conclude, it’s not another C-ish like programming language that will kill C++ but the evolution of AI, which bring more powerul and faster ways of programming machines, but even there and that time the low level will still exist.

  2. C++: A language for next generation web apps says: Reply

    Web apps in C++:

  3. Should you learn C++ in 2012? OF COURSE!!!! says: Reply

    A fascinating industry that moves $40 billions a year uses C++ in the 99.9% of cases!!! Do I have to say more???? Jump to minute 49:17 of the next video (Boston University lecture series)

  4. C++ was in use and still it is in use, many people think it has bad rep but I don’t think so. One should learn C++ as it is better language that is helpful to create clean , well designed and stable application.

  5. saif says: Reply

    C++ was our main language in college …. after college , i learned several languages like C# , Python ,abit of Java, and finally..Scala , but each time , i find myself returning back to C++ ! 😆 , it looks like it is “the Normal way of programming !” and any other language tries to simulate C++ way of solving problems…

Leave a Reply

This blog is kept spam free by WP-SpamFree.