tags:

views:

945

answers:

10

What do you think about c++ after c++0x standard is released.

A: 

much more competetive. hope that lambda expressions and threads are added though

Schildmeijer
+4  A: 

It will be at least 5 years until major compilers implement (most of?) new features. If you aim to write portable code, be very conservative with the new cool features.

Nemanja Trifunovic
+1  A: 

It's the same as it is now... any competent team is already using boost. Perhaps slightly easier to convince incompetent teams to actually use it. I'll still be preferring high level languages wherever possible.

Dustin Getz
Not every competent team is using boost.
Dave Van den Eynde
Agreed. Our customers still use platforms that are older than sin. They don't care if we can use Boost, just if they can be productive. If I cared more about the tools than my customers, I guess I'd leave and find a 'competent' team.
Don Wakefield
There are language enhancements that Boost just can't do. C++0x library changes are largely Boost, but that's not all the changes.
David Thornley
+5  A: 

Until visual studio and gcc support it, it's going to be irrelevant to my life.

Paul Nathan
gcc supports a lot of it right now, and VS2010 will support some very useful parts of it.
David Thornley
Visual Studio 2010 is not far off!
Ray Hidayat
+5  A: 

Personally I think the C++0x standard is looking to be a great improvement. Better initialization support, range-based for loops, the decoupling of null pointers from any particular value, strong typing for enumerations, better support for variant records (unions), and the biggie: better support for threading.

Every such step that C++ takes towards being more like Ada makes it a better language. :-)

T.E.D.
Ada, haha, I liked that comment... upvote
paxdiablo
+19  A: 

In decreasing order of attractiveness to me:

recognizing threading: About time! With the current C++ memory model, writing multithreaded applications is a minefield of shitpreloaded fans.

auto: Yes please! Cleaner code in general, but also largely simplifies writing template libraries, both in the core and allowing to drop additional work that works around the lack of auto.

boost smart pointers: good for them to recognize the best ones ;)

variadic template arguments: Doubleplusgreat for certain template libs such as delegates, scopeguards etc. They also mean variadic functions get type checking, possible inline expansion and other optimizations, which is a great step forward.

strongly typed enums: hm. That would be doubleplusgood if we could write Foobazzle(forwardOnly, slow, pin12 | pin7) instead of Foobazzle(true, false, EPinIDs::pin12 | EPinIDs::pin7) but without that kind of automatic type-based lookup, the value seems limited.

template typedefs: were somehow "forgotten" from C++03, very very useful

concepts / template parameter restraints: gooood

calling peer constructors, defaulting/deleting default function implementations: phew, huff, puff, was it that hard? And still waiting for a way to ADD some functionality to the default implementation.

constexpr: nice, especially together with static asserts

nullptr: ran into this a few times, don't know how valuable that becomes

user defined literals: seems powerful, but don't know enough yet

r-value references: I don't yet see the problem they are solving

Build Model: C'mon, guys, it was great when, in the seventies? I would really have liked to see something happening here. Extern templates is helping with some, but probably not all of it. - lambda functions: I am torn. At one side, I desperately want them, OTOH I smell a can of stinkworms.

Generally, writing template libraries will benefit most. The main problem for consuming them is bad compiler diagnostics. some of the enhancements like constraints, static assers, "deleting" intrinsic conversions etc. hopefully allow the library developer to provoke better error messages. Also, I am looking forward to some of the constructs that allows to write cleaner, more stringent code without any functionality change.

What I really miss is an overhaul of the build/library model. It seems that at least the minds of the comitee move towards template libraries, for which extern templates might do the trick. However, messing around with .h + .cpp files, .lib files in 16 configurations (single|multithreaded * ASCII|UNICODE * static|dynamic runtime * any of a dozen of compile options that need to match)

What is to bee seen yet is how many problems arise due to combining features: templates are great, and exceptions are great, but we learnt late that writing exception-safe code in the presence of templates is very hard, sometimes to hard to be a good idea. Are there new troubles lurking?

Also, the changes go beyond the compiler, many of these changes call for potentially large enhancements of the IDE (putting more pressure on the date of availability).

Compared to other languages, The major drawback for me is still bad parseability which affects the tool landscape (say, source control showing a history only of the current function). Lack of reflection is limiting for some scenarios, though that's partially made up by the powerful template functionality.

All in all, I am loooking forward to it, though I also wonder when it will be available.

nullptr is the end of the NULL vs 0 war. No more surprises such as void f(char const*); void f(int); void g(){f(NULL);}The r-value references are the new tool to implement move semantics. No more COW, no more auto_ptr<vector<>/string>.
Luc Hermitte
Re: r-value refs, an example of a problem it would solve is "HugeObject x = CreateIncrediblyHugeObject()". With C++98, the huge object will have to be copied entirely because C++98 does not differentiate between *copying* and *moving*. And if huge objects can't be copied, that code won't compile.
Shmoopty
Please note "Concept" was removed from the C++0X standard.
ShaChris23
+1  A: 

I feel the features that will make the biggest difference for programmers are:
Lambda functions
Concepts
And of course the long-due threading.

Some of the features are either things that you can work around anyway, already have alternative implementations (boost smart pointers, regex, etc), or are so minor than they're almost unnoticeable (being able to use >> in templates).

I'm a bit worried about type determination. Yes, it has very useful applications, but it also seems like poor coding style waiting to happen.

Marcin
+2  A: 

Lambda expressions and the auto keyword... I can't wait. :-)

Head Geek
+2  A: 
benjismith