Lambda functions and closures added to C++
herbsutter.spaces.live.com
herbsutter.spaces.live.com
I have to say: I love it. C++ has always been my favorite language that I don't program in. It's like kung-fu for programmers. You can attack any problem. But most times we don't need kung-fu.
There's nothing like "getting in the zone" with a good C++ program. It's a thing of beauty. And if you're doing stuff that you have to use the tool, like writing drivers, low-level stuff, doing some "break the rules" programming, it's the best there is. I wrote a shell extender for windows many years ago in C++. I got to change the desktop and file system to work the way I wanted it to. Very neat stuff.
The sad fact is that most of the time you can make more money writing something with a much higher level language. And you can make it faster and adapt to the market faster. So C++ is a tougher language to use for startups, in my opinion (although it is still my favorite)
Can you imagine the trouble you can get into with macros, lambda functions, and unsafe pointers? How about throwing i some operator overloading? It's like a playground for nuclear weapons.
http://www.indeed.com/salary?q1=lisp&l1=&q2=c%2B%2B&...
I suppose the reason is that it can only realistically justify its existence at the bleeding edge (eg, with graphic engines, drivers, etc) where the work is inherently difficult as well.
If I was to try and "save" C++, I'd probably start from scratch on the template system. Really though, then I'd just end up with a idiosyncratic though type-safe implementation of Lisp macros.
Don't get me wrong: I've invested so much time in learning C++ and perfecting my skills in it that it makes me wish that I wouldn't be saying this, but every time I have to touch C++ I get "that sinking feeling". (languages I'm spending more time with these days: various Lisp dialects including Clojure; Ruby; Java/C# if I have to)
Oh, and live.com doesn't seem to work properly on Opera. Nice.
The addition of inheriting constructors is also a good thing -- I wish I could have back some of the hours I've spent re-writing default constructors for deep class hierarchies.
I'm playing with Arc.
I suppose people who write Microsoft apps may still write C++ but most of them have moved to C#.
And, I guess, even more domains where it's not still appropriate, but where it's still used anyway. :)
(aside: the gutless wonders who downvoted my original question did not respond to me directly at yc@culver.net - I suppose those folks are having their teenage fun trying to destroy this community? I have a proposal: whenever any of the "anointed " members of this community downmod anybody, they should be <b>required</b> to provide to the original poster a) their EMAIL ADDRESS so that the poster could respond, and b) their REASON for their action. In addition, I believe that NOBODY should be allowed more downmodding than upmodding - that is, you have to have "upmod points" before you're allowed to downmod - even if you are a Chosen One in the Secret Handshake Society of the YC Cult.)
WTF? Are you aware of the ridiculous number of examples in both?
C++ will be all the rage in embedded circles in the 2020 decade.
"How does Perl [C++] put the focus onto the creativity of the programmer? Very simple. Perl [C++] is humble. It doesn't try to tell the programmer how to program. It lets the programmer decide what rules today, and what sucks. It doesn't have any theoretical axes to grind. And where it has theoretical axes, it doesn't grind them. Perl [C++] doesn't have any agenda at all, other than to be maximally useful to the maximal number of people.
...
Many modern computer languages aspire to be minimalistic. They either succeed in being minimalistic, in which case they're relatively useless, or they don't succeed in being truly minimalistic, in which case you can actually solve real problems with them. A number of languages give lip service to the idea of minimalism, but merely sweep the complexity of the problem under the carpet of the programmer. C is a minimalistic language, but only if you don't count all the libraries that are necessary to use it usefully. C++ is obviously not trying to be minimalistic. Unix is considered by some to be a minimalistic operating system, but the fact of the matter is that if you think of Unix as a programming language, it's far richer than even Perl. Perl is, by and large, a digested and simplified version of Unix. Perl is the Cliff Notes of Unix."
I agree with you at least that far! ;)
It's good to let computers do what computers are good at: repetitive, boring tasks. That's why modern languages detect typos and report them to the user. Perl accepts most typos as valid and makes the programmer do the boring work of analyzing the syntax for correctness.
I'm bitter about wasting 30 minutes tracking down a bug because perl accepted 'if(!$string_generator1-() || !$string_generator2->()) {...}' as valid syntax. This kind of thing happens to me very often when writing Perl programs.
I think that C++ and Perl are very different. Perhaps their most important similarity is that they're both older languages. At least C++ is making progress, while Perl seems to be embracing its backwardness.
I personally feel that C++ is a language that doesn't truly belong anywhere - it isn't pure, clean, and low-level, like C, and it isn't completely high-level. Somehow, I don't think that you can easily 'mix' these two. I'm mildly surprised that they haven't added an optional GC yet - I seem to remember reading somewhere that even Bjarne Stourstrop advocated one.
Maybe, instead of making "C++0x", they should just make D an ISO standard... From what I've seen, D is basically C++ cleaned up, and every time I look at it, I want to use it instead even more. Check it out if you haven't already. And it deals flawlessly with legacy C++ and C code, too, so there's really not many reasons to avoid it.
Oh, and C++ templates are just ugly. I'm reminded of them whenever I see Java generics too, and let's just say those aren't too nice on the eyes either. Maybe they should add programmatic macros too. And a pinch of Perl's default variables!
Edit: No, the truth is stranger than fiction. Gads!
for_each( w.begin(), w.end(), []( const Widget& w ) { cout << w << " "; } );
It's lovely to know that this is possible, but if anyone who ever writes a production code like this needs to be shot on a spot. Some of the Brainfuck programs are easier to read than this ... and, yes, I have been using C++ as a primary development language for over 10 years.