![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
nemesis <nam### [at] gmail com> wrote:
> C++ has always evolved by the exact opposite, by going from a simple C with
> Objects preprocessor to a Java/C# wannabe now and everything in-between
> (Haskell, Python etc).
Yes, let's all join in group-bashing C++.
Every new feature added to C++ is wrong and sucks. Every new feature
added to Java or C# is right and rules. This even if it's the exact same
feature.
Btw, I find it hilarious that you call C++ a "Java wannabe". Java is
a rather horrible object-oriented language which lacks lots of features
which would help in abstraction and modularity.
But of course we are talking about C++ here, and *everything* in C++
sucks. Consequently everything that Java does differently than C++
rules. Thus Java is in all possible aspects the superior language, and
consequently C++ is just a "Java wannabe".
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Darren New <dne### [at] san rr com> wrote:
> Warp wrote:
> > std::for_each(someList, [&total](int x) { total += x });
> And, really, what's the advantage of this over a normal for loop?
Nothing. Since it's C++ code, it sucks.
In fact, C++'s for-loop also sucks. Everything in C++ sucks. Even if
it's a byte-by-byte identical feature as in some other, better language,
it still sucks because it's in C++.
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Mike Raiford wrote:
> Invisible wrote:
>
>>> Sounds like they drank the OSS flavored kool-aid.
>>
>> I have no idea what the heck kool-aid is, but... yes.
>
> Read http://en.wikipedia.org/wiki/Drank_the_kool-aid it's interesting,
> and gives the source for the expression.
...
http://en.wikipedia.org/wiki/Kool-Aid#.22Drinking_the_Kool-Aid.22
--
Tor Olav
http://subcube.com
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Warp wrote:
> Now that you have "proven" that C++ will not have "true" lambda functions,
> you must be exhilarated.
Not really, because I don't wrap my sense of personal worth around the
features of programming languages I use or don't use. I'm not sure why
discussing C++ puts you so off.
--
Darren New, San Diego CA, USA (PST)
My fortune cookie said, "You will soon be
unable to read this, even at arm's length."
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
nemesis wrote:
> It also features much cleaner syntax and semantics. uplevel?! frankly... :P
That too. And complex data structures, because they do both GC and pointers.
Python seems much nicer than Tcl. I just can't use a language that doesn't
(for example) support Unicode in preference to one that does, due to the
sorts of things I program. Now that Python has integrated all those things
cleanly, I'll start using it more.
--
Darren New, San Diego CA, USA (PST)
My fortune cookie said, "You will soon be
unable to read this, even at arm's length."
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Warp wrote:
> Says the person who didn't even know how lambda functions will be
> implemented in the next C++.
Nonsense. The limitations of the undefined behavior tell me they're not
going to be implemented by allocating the stack onto the heap, for example.
> I like it how you succeed in making *everything* sound negative when
> applied to C++, while at the same time the *exact same thing* is positive
> in other languages.
Huh?
> For example, generics in Java being "just syntactic sugar" is a positive
> thing, while lambdas in C++ being "just syntactic sugar" is a negative thing.
What makes you think the fact that generics in Java being syntactic sugar is
a good thing? Where'd I say anything to imply that?
>> You can't have closures in a language without runtime type information.
> Oh, now C++ doesn't even have RTTI. Right.
Cool. So you have a library capable of marshaling any type of data into a
serialized stream? I can pass you a void* and you can inspect what it points
to and tell me what class it is? The traceback in your exceptions can tell
you what the values passed as arguments to the function on each frame... oh,
wait, that's right...
Hell, you can't even tell me how big an array is, or look at a pointer to a
value and tell me whether it's valid. How are you going to tell me what type
it is?
> Like "lambdas", what is called "RTTI" in C++ is not *really* RTTI, right?
It's limited in exactly the same way as lambda's are - you get just enough
RTTI that people can call it RTTI, without having so much that you have to
do something extreme in the runtime code to make it work.
> I start seeing your general rule of thumb: Every programming language
> feature, when implemented in C++, either isn't *really* that true feature,
No, there's a bunch of stuff that C++ does decently, and a bunch of stuff
like RTTI and lambdas that, yes truly, aren't really what everyone else in
the world calls that feature.
> or is magically converted into a negative aspect of the language (while
> it's a positive feature in all other languages).
It's usually the combination of that feature with other features or
misfeatures that make what's positive in some languages into what's negative
in C++.
>>>> (2) not wanting to add any syntax for it,
>>> Have you even looked at how lambda functions will be written in the new
>>> C++ standard? How is it not adding new syntax for it?
>
>> A complete lack of any sort of keyword, like, oh, "lambda" maybe?
>
> Wow. The lack of a keyword is now a negative feature. Right.
Yes, because it makes it harder to read and parse. It's not like there isn't
a whole theory behind parsing (for example) that just can't be applied to C++.
>>> Good thing you are not prejudiced nor biased in the least.
>
>> "Prejudiced" would imply that I'm not making judgements based on experience,
>> but rather based on lack of knowledge.
>
> Are you seriously telling me that you did extensive research on the
> new lambda function feature as specified by the current C++0x standard
> draft before making your remarks?
No. I read what wikipedia has to say about it, and I understand how C++ is
generally implemented in terms of a memory model, and from that I can deduce
that unless you do something *very* extreme, you're not going to get lambdas
out of the C++ mechanisms. The fact that the kinds of extreme things you'd
need to do lead to undefined behavior tells me that people aren't going to
do that, or at least won't be required to.
If I told you I had a great idea for C++, and all it needed was to allocate
each stack frame on the heap as a linked list, and to then add garbage
collection, wouldn't you tell me it's unlikely to be implemented by many C++
compilers?
>> I'm biased against ugly languages that are a pile of hacks to fix flaws in
>> other hacks.
>
> At least you dare to admit it.
Sure. I've never hesitated to express my dislike of hacks, even when I
recognise them as necessary hacks.
>>>> No. I just don't like C++.
>>> And for that reason you have to constantly write prejudiced BS about it.
>
>> It's neither prejudiced nor BS. What makes you think it's prejudiced?
>
> Because you write about a new language feature without even knowing how
> it will be implemented.
I know how it *won't* be implemented. It won't be implemented such that
references to local variables survive the end of the stack frame those local
variables are allocated in. That's enough.
Or do you think C++ is going to hoist those local variables into a separate
object (like every other language implementing actual lambdas)? And if so,
when does C++ deallocate that separate object, given there's no garbage
collection?
> I hope you have a good time laughing.
I did. I wouldn't be spending all this time typing if it wasn't amusing.
Thanks for asking.
--
Darren New, San Diego CA, USA (PST)
My fortune cookie said, "You will soon be
unable to read this, even at arm's length."
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Warp wrote:
> Darren New <dne### [at] san rr com> wrote:
>> Warp wrote:
>>> std::for_each(someList, [&total](int x) { total += x });
>
>> And, really, what's the advantage of this over a normal for loop?
>
> Nothing. Since it's C++ code, it sucks.
You know, if you're not mature enough to have a civil conversation, you
don't really need to participate. I asked an actual useful question, so I
could perhaps learn why people are working to put lambdas into the language
when they have restrictions that make them useless for what most other
people use lambdas for. If your only answer is "there's no advantage of
lambdas over coding a regular for loop", then yeah, C++ sucks.
However, if there's anyone else who might like to answer that question, and
offer a scenario where such a structure is useful for something other than
marketing that "oh yea, we have a functional language too", feel free to
follow up.
--
Darren New, San Diego CA, USA (PST)
My fortune cookie said, "You will soon be
unable to read this, even at arm's length."
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Darren New wrote:
> Or do you think C++ is going to hoist those local variables into a
> separate object (like every other language implementing actual lambdas)?
> And if so, when does C++ deallocate that separate object, given there's
> no garbage collection?
For example, if you go to
http://download.microsoft.com/download/3/8/8/388e7205-bc10-4226-b2a8-75351c669b09/csharp%20language%20specification.doc
and look at section 7.14.4, you can see what C# supports in *its* lambdas.
Or http://msdn.microsoft.com/en-us/library/bb397687.aspx and go down to
"variable scope in lambdas" if you don't want to download the actual spec.
And when you nest lambdas in several scopes then reference variables from
those scopes, you get an even more complex set of declarations generated, in
order that (for example) the variable outside the loop your lambdas
reference are shared, while the variable inside the loop your lambdas
reference isn't shared.
I looked around to see if I could find the code that C# generates when you
give it a lambda with free variable references to multiple scopes (which,
yes, is just syntactic sugar), but I couldn't find it after 10 minutes or
so. If you really care, rather than just being interested in defending C++,
I'll take the time to hunt it down. But it's not something you can put in
C++ in the same way.
--
Darren New, San Diego CA, USA (PST)
My fortune cookie said, "You will soon be
unable to read this, even at arm's length."
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Darren New <dne### [at] san rr com> wrote:
> Warp wrote:
> > Now that you have "proven" that C++ will not have "true" lambda functions,
> > you must be exhilarated.
> Not really, because I don't wrap my sense of personal worth around the
> features of programming languages I use or don't use. I'm not sure why
> discussing C++ puts you so off.
You are not discussing. You are bashing based on prejudice.
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Darren New <dne### [at] san rr com> wrote:
> >> I'm biased against ugly languages that are a pile of hacks to fix flaws in
> >> other hacks.
> >
> > At least you dare to admit it.
> Sure. I've never hesitated to express my dislike of hacks, even when I
> recognise them as necessary hacks.
I said that "at least you admit that you are biased". I didn't say that
"at least you admit you dislike something". But of course you seem quite
fluent at twisting things.
> > I hope you have a good time laughing.
> I did. I wouldn't be spending all this time typing if it wasn't amusing.
> Thanks for asking.
You are being an unusually bad jerk in this thread for some reason. Not
your usual self. I'm curious what prompted your sudden holy war now.
Bad day?
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |