
Even more new C++ features - fogus
http://ib-krajewski.blogspot.com/2009/12/even-more-new-c-features.html
======
phaedrus
To provide a counter viewpoint, the new C++ features are a major reason why we
choose to use/continue to use C++ for the game engine my friend and I are
writing. As heavy users of C++, we consider the changes to be a welcome and
useful modernization of the language. It has allowed me to write a powerful
script binding library that I could not have done in old C++.

It's easy to sound smart when you're only detracting from something because
you aren't providing a (complete) counterproposal that could be criticized.
And it's easy to say "don't add features, remove them" if the feature being
removed is not one you personally depend on. And if you're not an actual user
of the C++ language it's especially easy to say "don't add features, remove
them" because you aren't depending on ANY features!

There are minimalist languages; C++ is not one of them.

I think it is much more interesting and useful to explore how far you can go
if you program entirely using the new syntax features. This may make it look
and feel like completely a different language than old C++, but rather than
put it up as a straw man and knock it down, recognize that this new language
is an exciting undiscovered country.

------
jimbokun
This just further confirms, for me, that there is no feature C++ is not
willing to include. Seems like C++ is getting closer and closer to the day
when any randomly typed string of characters has a decent chance of being
syntactically valid C++.

------
lacrossegm
Perfection is achieved, not when there is nothing more to add, but when there
is nothing left to take away. -Antoine de Saint-Exupery

------
bensummers
As much as I love C++, it's getting a bit too hairy for my taste. Instead of
making things more simple, it's just getting more complex.

I'd love a statically typed Ruby, for example. Duby looks interesting, but a
bit young and incomplete to use.

~~~
lonestar
Have you played with Scala? It reminds me in some ways of Ruby, you might find
it to your liking.

~~~
samstokes
I've also found Scala has a similar feel to Ruby, which is a bit surprising
given Scala's static type system and Ruby's extreme dynamicness.

Here are a few similarities:

* concise syntax (Ruby via dynamic typing, Scala via type inference)

* hybrid OO-functional (Ruby isn't normally described this way, but it has a lot of functional idioms built in, and unlike in Python, they're often considered good style)

* dogmatic wrt the OO part (i.e. every value is an object, unlike Java or C++)

* TIMTOWTDI (should my Scala higher-order function take a function or a lazy value?)

* DSL fetishism

* very flexible and adaptable syntax, which (for both languages) is a two-edged sword - esp. things like Ruby's optional method invocation, and Scala's optional dot

* both allow adding methods to existing classes (Scala fakes this via implicit conversions, but I believe it's idiomatic)

~~~
bensummers
I've had a look at Scala, but not so much as to actually start writing code.
But it does look promising.

[http://macstrac.blogspot.com/2009/04/scala-as-long-term-
repl...](http://macstrac.blogspot.com/2009/04/scala-as-long-term-replacement-
for.html)

The thing which appeals about Duby is that it uses the underlying Java
typesystem, and doesn't have a runtime library. If it ever gets finished, it
can be as fast as any Java code, and there's been a lot of effort put into
making Java code fast.

------
petercooper
On the Stack Overflow podcast I believe Joel Spolsky said something along the
lines of "C++ is the only language where every new feature turns out to be
something everyone recommends you should never use."

------
alextgordon
Damn, C++ is making Perl look readable.

Instead of adding features, they should be cutting them. C++ is 27 years old,
yet there _still_ isn't a full production-quality implementation of the
specification. And they carry on regardless, adding more and more features.

C++ could learn a lot from the way Python is managed. PEPs, a reference
implementation, and an individual with the power to veto - to keep the
language heading in a single direction.

~~~
kmavm
Regarding "an individual with a power to veto," C++ has a dictator for life,
whatever trappings of "democracy" surround him. Bjarne Stroustrup has the
social and intellectual capital to drive C++ in whatever direction he likes.
Unfortunately, not all dictators are created equal.

~~~
chancho
Yet he couldn't get concepts into upcoming standard. Far short of a dictator.
There's also the significant fragmentation of the market (GCC vs. MSVC++) and
the fact that both of these compilers pick and choose what to implement and
when to do it (cf. partial template specialization.)

If Guido puts a feature in CPython, that's a iron-clad edict to all other
would-be implementors, because CPython has a huge majority market share. Not
implementing the same feature means you aren't implementing python. There is
nothing equivalent in the C++ world so no one has power, either through
standardization or implementation, to single-handedly steer the language.

------
diego_moita
With an "improved" syntax like that, C++ programmers will never discover
automated refactoring.

------
SandB0x
Is it just my screen? I can barely read the code samples.

------
tbrownaw
...can I have my 5 minutes back?

