4 ms·
Even more new C++ features
- diego_moita 17y agoWith an "improved" syntax like that, C++ programmers will never discover automated refactoring.
- bensummers 17y agoAs 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 17y agoHave you played with Scala? It reminds me in some ways of Ruby, you might find it to your liking.
- samstokes 17y agoI'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 17y agoI'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-replacement-for.html http://macstrac.blogspot.com/2009/04/scala-as-long-term-repl... 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.
- fauigerzigerk 17y agoDon't you think the initializers make things simpler?
- bensummers 17y agoI've never really had a problem with initializers in C++. I suppose it comes down to programming style, and I try to avoid complex initialisations by using nice simple classes with only one constructor.
- SandB0x 17y agoIs it just my screen? I can barely read the code samples.
- jimbokun 17y agoThis 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++.
- alextgordon 17y agoDamn, 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 17y agoRegarding "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 17y agoYet 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.
- fauigerzigerk 17y agoThere is very little that could be further from the truth. Bjarne Stroustrup has to be the most powerless inventor of any programming language in existence. chancho already referred to the recent "concepts" rejection and the fact that Bjarne Stroustrup doesn't control any important language implementation. In fact there are members of the standards committee who do control a language implementation, like Herb Sutter. The committee is full of prominent members with intellectual capital who exercise their formal voting rights as well. There is no dictator.
- lacrossegm 17y agoPerfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
- phaedrus 17y agoTo 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.
- petercooper 17y agoOn 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."
- tbrownaw 17y ago...can I have my 5 minutes back?