

Overview: C++ Gets an Overhaul (C++0x) - Anon84
http://www.devx.com/SpecialReports/Article/38884

======
dazzawazza
I am so glad I don't have to use C++ any more. I spent years in video games
perfecting my programming skills in C++. What a waste of time. Now I'm in
python I feel like I can program again.

Don't get my wrong. C++ obviously has it's place but I'm glad I'm in a
different place right now.

~~~
Anon84
I agree... I just wish Python's performance was closer to C++s. I use Python
everyday for data analysis, etc... but I'm pretty much stuck with C++ for
numerical simulations. Hopefully, the gap will become manageably small
sometime soon.

~~~
cstejerean
the good news is that it's easy to write extension modules for python when you
need performance.

~~~
ComputerGuru
The bad news is, soon enough you'll realize that your entire codebase has been
switched over to the extensions and Python isn't really doing anything anymore
:)

~~~
dazzawazza
People used to say something similar in games: 'Why write in C when you know
you are going to have to move to asm anyway, just write it all in asm!'.

I've never seen more then 5% of c code usefully move to asm and I've never
seen more then a few % of python code usefully move to a module. I am not
saying it's always of waste of time it's just I haven't seen it.

~~~
scott_s
What kind of applications do you have experience developing?

~~~
dazzawazza
Mainly in and around video games on PC/PS2/XBox/PS1. C/C++/ASM for the runtime
(sometimes with python for scripting) and Python for level editing and build
processes.

I'm not discounting python inadequacies esp when churning vast amounts of
data. Video game levels are large and python was too slow to process collision
maps, shadow maps etc but we added C modules to do the heavy work and it
wasn't a lot of code to write in C (it was a pita to debug them though).

PS I don't work in video games any more so I've not experienced the delights
of the PS3/XBox2 first hand. I do websites now... it's a lot easier :)

------
timr
Oh boy. Let the ignorant C++ bashing begin...

Before you chime in with some snarky comment about some superficial aspect of
the language (like, say, the name), _please_ try to realize that C++ is still
one of the most widely-used languages in the world -- for a reason. And if you
find yourself about to post something of the form "why would they add [feature
X]...python/ruby/haskell/blub has had that for _years_ ", please stop and take
a deep breath. Realize that it takes a _long_ time to add features to a
language that has to be standardized by committee and deployed to as many
platforms as C++ has today.

You may like ruby/python/blub better, but that's a bit like saying "I like my
swiss army knife better than my chainsaw". Your swiss army knife will do fine
in a lot of different situations, but you're not going to cut down many trees
with it. Nor would you try to open a package with a chainsaw.

~~~
tptacek
When you say "C++ is still one of the most widely-used languages in the
world", you're implicitly lumping C in with it. C/C++ is certainly one of the
most widely-used languages, but there are whole huge categories of products
that are almost never written in C++.

Some of us appreciate bare-metal systems programming, but loathe C++.

~~~
timr
No I'm not. C++ is widely used _in part_ because it's backwards-compatible
with C, but it's not even remotely a stretch to say that C++ is one of the
most widely-used languages in the world, on its own.

~~~
tptacek
It's not a stretch to say that because you aren't actually saying anything.
Leaving the distribution undefined as you did, we could also claim that
Haskell is one fo the most widely-used languages in the world: it's certainly
used more than CASL, the scripting language I wrote at McAfee in 1998.

I'm not arguing that C++ isn't widely used. I'm taking exception to the "us
and them" sentiment I picked up off your comment, that the world is divided
between those who appreciate C++ and those who can't hack it outside of Python
and Perl. There are plenty of systems programmers who hate C++.

~~~
timr
Where did I say such a thing? My _whole point_ was that C++ is just another
tool, like a chainsaw.

You seem to be taking this very personally.

~~~
tptacek
I'm sorry, I can see why you'd think I personalized it. I stand by the point
I'm making, but apologize for the tone.

------
tptacek
I'm not sure why I would ever dick around with C++ lambdas when I could
instead just write in C and a "real" high level language, like Python, Lisp,
or Ruby.

~~~
kingkongrevenge
Comparing C plus Python to C++ doesn't make any sense. The comparison would be
C plus Python vs C++ plus Python.

The C++ solution would most likely be shorter, more flexible, and more secure.
Personally, I fail to understand why anyone would choose to write new C over
C++.

~~~
qwph
(Speaking as one of those people who _did_ choose to write C over C++...)

People choose C over C++ because C is a simpler language than C++, something
which this new standard does nothing to address.

~~~
kingkongrevenge
I have difficulty handling the complexity of typical C code due to the lack of
abstraction. C always winds up with huge functions and lots of hard to grasp
state up in your face. C++ gives you way more opportunities to hide away
complexity.

~~~
tptacek
The solution to complexity is to _eliminate_ it, not to _hide_ it. You've
nailed the big problem with C++ right there.

~~~
kingkongrevenge
I really don't know what that means...

~~~
earthboundkid
Think of it like this: Would you rather have an operating system that has a
bunch of little ads in the corner by the clock that are periodically "hidden"
under a chevron, or would you rather that the crap wasn't there in the first
place?

~~~
scott_s
Some complexity is inherent to the problem and you can't get rid of it. You
can only manage it through abstractions.

------
gcv
The new standard basically has nice improvements over the current one. I use
C++ occasionally, when I need to write low-level code and when I think the STL
will save me time over plain C. Unfortunately, the new standard won't be too
useful for a while.

When the working group finalizes the standard, we get to wait for the compiler
implementations to catch up. For the first five years, C++ programmers will
enjoy buggy, incomplete, and mutually incompatible implementations of half of
the features in the new standard. During the following three years, compilers
will even out in quality, and many of them will finally implement most of the
features in the 2003 modifications of the 1998 standard. It'll take over a
decade for C++ lambdas to become semi-portable and acceptable in many
environments.

I really hope that, in 2018, I'll be able to write low-level code in a new and
cooler language. It'll probably be a Lisp. :)

~~~
YuriNiyazov
_I really hope that, in 2018, I'll be able to write low-level code in a new
and cooler language. It'll probably be a Lisp. :)_

what you really meant to say is that you hope not to write in any language in
2018

------
bayareaguy
Could they have come up with a worse name than "C++0x" ?

~~~
brfox
Can someone actually explain what it means? I'm not a professional programmer,
but I haven't seen notation like that.

------
StrawberryFrog
Is it just me, or does it look like a couple of these features (Automatic type
deduction, Lambda expressions) seem to be borrowed from c#? And similar things
are in languages like Ruby and Python.

I'm not saying that's a bad thing (or the reverse), and not saying that c#
invented these ideas: I'm fairly sure that the c# designers only let in
features that have already been road-tested in other, more experimental
languages.

Just interesting which was around the ideas are flowing.

~~~
coliveira
I had heard about automatic type deduction in C++ even before it was
implemented in C#. The problem is that takes several years to get a C++
standard approved, while the C# team can just dream a feature and start
implementing it in the next day.

~~~
StrawberryFrog
I'd disagree with "the next day" part. C#3 (with automatic type deduction and
lambdas) had a beta period of about a year, to make sure that all the new
features played nicely with each other.

~~~
timr
They've been standardizing C++0x for at least three years now.

------
known
As per Bagley Shootout <http://dada.perl.it/shootout/craps.html>

C++ score = 27.63 Python score = 27.0

------
newt0311
All hail the bloat-lords.

PS. Why are the additions of nullptr, and strongly typed enums a good thing?
and doesn't C++ already have a NULL from C?

~~~
KirinDave
C's NULL sucks, because it's not a unique value and thus can be "lost" or
confused with other values.

Having a distinct null which can only be arrived at by typing the characters
"null" is a good thing, imo.

~~~
tptacek
Can you tell a story about how NULL bit you in the ass in real code?

~~~
qwph
I remember one early version of a C++ compiler which had NULL #defined as ((
void* )0), which caused all manner of fun trying to compile some legacy C
code.

This was in 1999, I think.

~~~
tptacek
You mean like this?

#define NULL __DARWIN_NULL

...

#define __DARWIN_NULL ((void *)0)

~~~
qwph
Something like that. It makes the following invalid in C++ but valid in C:

    
    
      int *ptr = NULL;

~~~
bdash
Except for the fact that the real definition is actually more like:

    
    
        #ifdef __cplusplus
        #define __DARWIN_NULL __null
        #else /* ! __cplusplus */
        #define __DARWIN_NULL ((void *)0)
        #endif /* __cplusplus */
    

So the code you mentioned works just fine in C++.

~~~
qwph
Except that the actual compiler I was using was for the PlayStation 2, so I
very much doubt it had that precise code you just outlined, and it really did
have NULL defined as ((void* )0), and it really did break. I saw it happen.

