views:

1283

answers:

11

I have tried to keep up with C++ since they introduced 1998 ANSI/ISO C++. I absorbed the new concepts and tried to understand them. I learned about exception handling, templates, and namespaces. I've read about the new cast mechanisms and worked with the STL library.

All of these concepts required a lot of energy. But now I am somewhat worried about the future of C++ when having a look at the new C++0x standard.

Things are getting more and more complicated. This language is becoming a monster.

I'm not sure that I want to keep up with the language anymore, since I don't do my day-to-day hacking in C++ anyway. I mostly use interpreted or bytecode languages.

So why should I bother to learn this difficult, yet exceptionally powerful, language? I can do 95% of my business with Python et al. With the remaining 5%, I can deal with plain old C++ or C without hassle.

What do you think?

+1  A: 

You don't need to know every standard that comes out by heart. It does help to know about the big picture though. The 5% that you do code in may have you reinvent the occasional wheel. Depending on how much time, importance that 5% has (think Pareto) you need to take a call.

Also, any particular reason (like legacy code dependency) why you can't move that 5% to python?

dirkgently
Times when I can't use Python: When I deal with legacy code or when performance is very important.
prinzdezibel
+8  A: 

You're not forced to use every feature a language provides. I don't use setjmp/longjmp in C despite it being there. I also don't use every aspect of the Java collections.

If you think the new features will make your code delivery better (faster or higher quality or both), then use them. Otherwise ignore them.

It's useful to know at a high level what they all are, if only to get you through job interviews, but half the stuff they add to languages are unnecessary in my opinion.

I never even got around to using C++ templates before switching to Java, but I knew what they were for.

It's not always about learning the latest and greatest. Software (at least at your job) is about delivery of product. That can be done in COBOL or FORTRAN if you're proficient enough at it.

paxdiablo
@Pax, this is only a viable solution if you program in solitude. Once you have to inherit code from others then suddenly you need to know the portions of C++ ~they~ know.
Simucal
That's true of everything, Simucal: keywords, language features, library calls, even algorithms having nothing to do with the language itself. Since questioner stated they don't use C++ very much, the point at which I'd suggest learning those features is when you inherit the code. Then there's NO possibility of wasted effort and the slight possibility of ramp-up time as you learn. But still, learn the high level, e.g., know what templates are even if you don't know the intimate details of them.
paxdiablo
+20  A: 

Everyone uses a subset of C++. For almost all application programming in C++, whether server or client side, that subset is manageable. In my opinion, the only folks that need to stay on top of absolutely every nuance of the language are the library writers -- people implementing Boost, STL, Loki, etc.

But I would absolutely use the language that fits the task. If Python is more readable and more maintainable than C++ for your job, and you don't need what C++ offers, then certainly stick with Python.

mwigdahl
A: 

My suggestion would be to learn the new keywords of c++0x ( && FTW) but not bother trying to learn the entire lib. Use python for w/e you want, possibly C# for apps, then use C++(0x) when you need to do something powerful. and ask stackoverflow & google about the new container when prototyping.

You dont need to use a select few language,

acidzombie24
+2  A: 

Good answers.

Computer makers compete for buyers, software competes for your disk space, and languages compete for users. They do this by trying to snag each other's features.

I'm wondering how long before we see Fortran come out with lambda expressions :-)

Mike Dunlavey
+9  A: 

First, many features of C++0x are to make the language easier to use. More readable template compile errors, more consistent initialization syntax, support for threading, which would otherwise have to rely on platform-specific libraries and so on.

So if you do use C++, I feel learning the important parts of C++0x should be a manageable task. Remember that you don't need to learn all the new features to use the language. Some features are primarily added as an aid for library implementers, for example allowing the STL to be implemented more efficiently, but which shouldn't really affect the end-users usage of the language. And some are only really necessary in very rare cases. Ignore those parts of the language.

One of their stated goals with C++0x is to avoid it becoming harder to use.

But apart from that, do you need C++? If you do your coding in other languages, why bother keeping up with C++?

jalf
It was my first language I feel it is the most fundamental one. I don't want to loose my expertise in this field, yet I can't coin it these days.
prinzdezibel
Just because it was your first language doesn't mean you have to keep up with changes in it forever. If you want to keep on top of the language then of course you'll have to learn most of the new features of C++0x as well. But if it's not something you use daily, then it doesn't have to take top priority. There won't be a C++0x compliant compiler for a few years still, so take it easy.
jalf
+1  A: 

First try attending a course on c++0x and make your firm pay for that :) Our brains can fit amazing amounts of junk-knowledge. Instead of cursing and having programmer-wtf-moments we should first learn from program users and listen to other people's opinions/knowhows. Knowledge transfers much faster that way.

AareP
Course on C++0x? Do you know of any?
Pavel Minaev
Well, hopefully by the time c++10 is fully implemented in compilers, there will be more courses on that subject. Although the target audience might be as broad as in that first picture here: http://importantshock.wordpress.com/2008/08/20/a-skeptics-look/:)
AareP
+17  A: 

Hear what Bruce Eckel { author of the two of the so-called best C++ books } commented on C++ a few weeks ago:

That said, I hardly ever use C++ anymore. When I do, it's either examining legacy code, or to write performance-critical sections, typically as small as possible to be called from other code (my preferred approach is to quickly write an app in Python, then profile it and if necessary improve performance by calling small portions of C++ using Python's ctypes library).

Because I was on the C++ Standards Committee, I saw these decisions being made. They were all extremely carefully considered, far more so than many of the decisions made in Java.

However, as people have rightly pointed out, the resulting language was complicated and painful to use and full of weird rules that I forget as soon as I'm away from it for a little while -- and I figured out those rules from first principles while I wrote books, not just by memorizing them.

Additionally, you should read this thread and Danny Kalev's predictions on C++.

However, the growing complexity of C++ will create pressure towards splitting the language into quasi-official dialects. We can already see this trend today; it will probably intensify in the future.

EDIT:

You should take a look at this discussion, too:

C++ - Anyone else feel like C++ is getting too complicated?

Comptrol
Nice discussion link. Thanks.
prinzdezibel
+1. "weird rules that I forget as soon as I'm away from it for a little while" pretty much sums it up for me. :/
j_random_hacker
I wouldn't call Thinking in C++ one of the best books on C++ at all. Also, it would be a good idea to read the entire Artima article. It's damning Java and C++ by faint praise by making them look like they are legacy languages; not a big surprise considering how enthusiastic Bruce Eckel is about dynamic languages such as Python.
rpg
There's one example in Thinking in c++ in which he inherits from std::vector, which is a NO-NO. I wouldn't say it's one of the best books either.
davidnr
Just wanted to point out that Danny Kalev's reputation is not as good as it may look at first. I also think he's over-dramatizing the situation.
sellibitze
Bruce Eckel's books -- whilst pretty good -- are no way the best, they are geared to new programmers.
Hassan Syed
+5  A: 

No one, except maybe Bjarne and Herb Sutter, know all of C++. As you've said it's an incredibly huge language. Expecting to be able to take the entire standard + the specific implementation details of your specific compiler or compilers is truthfully unrealistic.

But you don't need to know everything in order to use C++. Instead only learn the subset of C++ that is valuable to you and your projects. It doesn't hurt to keep expanding your knowledge but unless you're writing a C++ compiler, there's no reason to know the whole thing. Even if you accomplish it, all of the people you work with won't.

JaredPar
Actually - there is nobody that really knows "C++". There are core experts (usually compiler vendors: GCC, EDG, Microsoft) and there are library experts (GCC STL team and Dinkumware). Even within a compiler team you'll find that the team is split into experts in specific areas of the language.
Richard Corden
+5  A: 

So why should I bother to learn this difficult, yet exceptionally powerful, language? I can do 95% of my business with python et al. With the remaining 5%, I can deal with plain old C++ or C without hassle.

Well, for the most part you answer your own question. There is no need for you to keep up with the bleeding edge of C++ at this time.

However, the language will keep marching on. In a few years, some of the concepts you consider a bleeding-edge waste of time today will be in common use. Someday you may find during your 5% of using "plain-old C++" that some example code or code you're collaborating on uses a construct you're not familiar with. At that point, you'll need to hit the net and brush up on the new "current" C++.

Is that going to be a problem? Of course not. You're a programmer. You keep abreast of the latest programming concepts in the context of your 95% language, which also changes over time. You will likely already be quite familiar with the concepts and need only familiarize yourself with its C++ syntax when the time comes that you must use them.

Personally I hope to continue keeping up with C++, even if my career moves more toward Java or another next-gen language. Why? I would like to say because it interests me the most and because I love the complexity and expressiveness of it all. More likely, though, is just because it was my first professional language; I consider it my "native tongue".

If it does not interest you, and does not concern your job or future job, don't bother. What's wrong with that? Nothing.

veefu
This is exactly my point. I see C++ as my "native tongue" as well, because as with you, it is my first language. I don't want to quit with it, but the price too pay is high. Is it too high? I haven't decided yet..
prinzdezibel
I still read, debug, and hack C++ on a daily basis, so my perspective is not the best to help you answer that question.
veefu
+3  A: 

I am hard-pressed to find a single instance where C++0x has been made more complex than C++98. There are two things which really are complex:

  1. Concepts.
  2. the Memory Model

but the first one has been removed again (thankfully; standardizing unimplemented features has never worked out in C++, witness throw specifications, extern templates, auto_ptr, ...), and the second isn't really something that a modern programming language can escape. It's been externally induced by Intel & Co helpfully breaking your programs to make them run faster.

The rest is just fixing annoyances that every C++ programmer has been frequently hitting in the last decades.

As a side note: I find it ­... amusing ... to see how languages such as C# get packed with a database query language (LINQ) and C++ is objurgated as being bloated.

+1 for the side note... :)
Drew Hall
++ for "objurgated"
Mike Dunlavey