Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm a wimpy web programmer by trade -- I enjoy programming in JavaScript, CoffeeScript, TypeScript, and Ruby.

I have to program in C++ for my computer science degree, and it frustrates me. I don't much like the syntax and I feel that it's more verbose than it could be. I think I've roared "I hate C++" at least once per CS project.

I don't need to love C++, but I wonder if someone who adores the language can tell me what I can do to ease my pain. C++11 and Syntastic for Vim have certainly helped, but I'm wondering if there's something more than that -- a specific tool or an abstract philosophy.

share|improve this question

closed as not constructive by Jesse C. Slicer, GlenH7, Jonathan Khoo, gnat, MichaelT Apr 28 '13 at 2:35

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

12  
Write assembly for a week solid; no sleep, no bathroom breaks. From then on you will henceforth love C++. –  Jimmy Hoffa Apr 27 '13 at 21:02
2  
Easy. Learn perl. –  James McLeod Apr 27 '13 at 21:03
4  
Just abstract out the syntax, a developer shouldn't care about it, only the algorithms and stuff should matter. C++ is verbose because there is a lot it doesn't do for you, it also means you have more power over it. –  Florian Margaine Apr 27 '13 at 21:14
3  
You could just be happy it's not Java. Or Pascal. –  kevin cline Apr 27 '13 at 22:56
3  
We had a class where they pin your eyes open and show you c++ code while playing Beethoven - worked for me. –  Martin Beckett Apr 28 '13 at 1:39
show 2 more comments

1 Answer

up vote 6 down vote accepted

The key word is efficiency, keep it in mind. Check the numbers.

If you are a web programmer it may also be interesting to consider that now Chrome allows programming in C++.

You may even try to program something.

Still C++ is comparable to the objective C used normally for iOS, the C family is very popular and serves as inspiration to many other languages, like PHP and Go, or Javascript. Actually most of the languages out there. Even CoffeeScript has to keep the commas between arguments in function calls because of this heritage, it would be much nicer without them.

Also some C++ programming is going to provide you a valuable insight about how computers work and this will be useful for you and your career. It's good to have some knowledge about these low level details, and it could be worse, I mean, it's not assembler or Perl, as some people mentioned :)

But it can be as hard to read as Perl, you can also check some obfuscated code which shows some of the weird things possible in C, don't waste much time trying to understand it, though.

Or you can try to program something that is algorithmically complex, for instance a solution for the famous Hanoi towers. Try to use the Gray codification with binary operations on something that is not C ;)

C++ gives you the control and the power, so that you can use the computational resources you have to its best, with the greatest efficiency (except for C, FORTRAN and assembler). It does also give you a lot of ways to shoot yourself in the foot and the power to blow your leg with it.

Think of it as a challenge, as a weapon really powerful when mastered and at the same time fairly dangerous for the one holding it.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.