C++ to catch up?
monarch_dodra
monarchdodra at gmail.com
Mon Nov 5 03:06:34 PST 2012
On Monday, 5 November 2012 at 10:22:02 UTC, Nick Sabalausky wrote:
> On Mon, 05 Nov 2012 11:00:27 +0100
> "jdrewsen" <nospam4321 at hotmail.com> wrote:
>
>> It seems like the C++ committee is speeding up development
>> adding lots of the goodies from D like Ranges, static if,
>> template contraints etc.
>>
>> Will D still have a case when C++ gets this done?
>>
>
>
> Yes, even if they go and add all of D's features, D will still
> be much
> cleaner. (IMO)
C++'s "range" is actually a wrapper over an iterator "first-last"
pair. While it does bring the convenience of D's ranges to C++,
it remains hobbled in terms of efficiency and implementation.
C++'s paradigm is pointers and iterators. At best, you can
sparkle some ranges over it, but you'll never shift the paradigm.
--------
The thing with C++'s new feature is that it requires developers
to be on the bleeding edge of C++ knowledge. It's fine for the
enthusiasts that read programming journals on their week-ends
(like you and I), but not for the standard developer. Not to
mention, even then, the syntax is hard as hell: lambdas in for
loops? I have to look up the syntax every time. automatic type
inference of the return value of a function? "auto foo() ->
declype(...)", what...?
All these functionalities are great, but also out of reach. Most
of my colleagues still struggle with "simple" design patters such
as strategies, or just plain algorithms with functors. Everytime
I say something like "awesome, C++ will allow type inference" or
"yay, RValue references!" they look at me like I'm some kind of
weird space alien...
--------
D packages the whole thing in an easy to use but complete
package. C++ just stacks complicated stuff on top of a hard to
use core.
More information about the Digitalmars-d
mailing list