Getting a solid grip on C++ : Where to go next?

Started by
9 comments, last by Satharis 10 years, 5 months ago

Also, even a mediocre C# (programmer) will be able to produce a working program faster than a good C++ programmer!

I feel like that difference shrinks as the caliber of the programmer goes up. Will a really good C++ and C# programmer be appreciably faster when working in C#? Not sure. C++11/14 with extensive use of standard libraries (and good 3rd party libraries) can be very expressive, and also pretty safe if you choose to use a safe coding style (which may or may not come at a performance cost). Certainly it's faster to write some things in C++ compared to e.g. Java, even for a klutz like me.

At the low end of skills the difference is the most striking. I think it's accurate to say that a poor C++ programmer will generate negative value to a project. With C++, either plan to get pretty good, or spend your time more constructively with another language.

If you mean faster as in programmer productivity, then yes, a really good C++ and C# programmer will be faster in C#, often by an order of magnitude. That's a side effect of the purpose behind each language. The design principals behind C++ of pay for what you use and that undefined behavior should be decided by the programmer has a cost on productivity.C# doesn't follow this ethos at least not as closely. As a result things like runtime type information is just much more accessible in C# and more pervasive in the libraries.

Oh, and of course that is the biggest productivity win of C#. As languages, C# and C++ aren't really all that different. Some aspects of C# are much cleaner due to the newness of the language ( generics for example ), but at the end of the day this isn't the stuff that profoundly effects productivity. (Although spend a weekend working with LINQ and you will have a hell of a time going back!) Nor really is memory management, the normal big boogieman. No, the big difference is the standard libraries. C++ has improved quite a bit since STL then Boost, but compared to C#, they are absolutely shit. Sit a great C++ programmer down beside a great C# programmer and ask them to accomplish many common programming tasks... read an XML file, string manipulation, parse and transform data, make a network connection, archive and expand a file, etc... and the C# programmer will generally spank the C++ programmer. There are exceptions and edge cases, but they are just that.

Then of course are all the other little things that add up as performance wins. The compile/link cycle for example. The lack of cruft is another big win in C# ( and to a much lesser degree Java ). These things all contribute to programmer productivity.

Advertisement
Personally I think people put too much emphasis on "perfect" learning, where in reality it differs on the individual. For instance, is it a good idea to stick to one language when you're starting out? Well yes, it is, because it usually implies someone is simply "hung up" on whether the language is good enough to learn or not. Does that mean you shouldn't learn another language for the heck of it? Of course not, myself in particular I learned rather early on that sticking to one thing is very challenging for me, and the best way for -me- to become a better programmer was actually to try new things. Even working on a project when I got really tired of being stuck on something, i'd stop and look up some other programming concept I was curious about, maybe AI or networking or a language I'd wanted to learn. It's refreshing in a way, and you always learn a new little thing doing it.

Basically what I'm saying is that if you think you'll get something out of C++ then don't be afraid to dip your fingers into the language, I can guarentee you that it won't -hurt you- to learn another language, especially one thats about as bare metal as you can go without being assembly. My personal experience with learning has been that one book, one language, one library, one project, none of them teach you everything about them, you learn a lot of the most important information by accident while learning something completely different sometimes. At he very least it may help something "click" in another language, "Oh THATs why they do that in C#!" sort of thing.

Pogrammers tend to have this little problem(myself included many a time) that they learn so many little things in order to understand a concept that when they have to explain it to someone or direct someone they don't remember those thousands of little things they had to accidently learn in order to understand it. Knowing anything in coding is usually a -lot- of information, like there's a difference between knowing pointers and really KNOWING pointers. These things are often best learned by ones self.

This topic is closed to new replies.

Advertisement