Hacker News new | ask | show | jobs
by point 6347 days ago
What's the hard part of the syntax compared to a language like ruby? Interfaces? Classes? Inheritance? Templates? Exceptions? Ruby has equivalent interface elements, and there is not much of a difference in difficulty level between learning the one or the other.

I learnt C++ in 2 weeks 7 years ago, and it was easy. The difficulty comes with learning to use the libraries and host APIs, but that is exactly the same for every other language I've learnt since then.

2 comments

Things Ruby isn't concerned with that people typically have problems with in C++:

- No compiling or linking phase in Ruby. Linking problems can be hairy in large systems.

- Header file hell

- The static keyword (there are four different contexts)

- Difference between a pointer and reference

- public, private, protected inheritance

- Differences between dispatch (and underlying impl) of virtual and nonvirtual methods

- method hiding

- diamond of death

- visibility vs accessibility

- casting idioms (static, dynamic, const, reinterpret)

- ugly libraries (STL, ATL, MFC, COM) yeah, i said STL is ugly.

- templates (Ruby doesn't need templates since everything is dynamic)

- No language level string data type (our product has at least six representations of strings here and there that need to be converted at the bit level).

I've seen several 'hard' engineers (physicists with Matlab experience) learn C++ in a couple of weeks. It's doable but... as you might expect, the code they pump out is terrible. There's a huge difference between doing basic C++ and being productive and efficient in it.