20 May, 2010, 3squire wrote in the 61st comment:
Votes: 0
Personally, I have no problem with libraries being separate from the language until you get into the problem of where to draw the line – What the hell do we need strings for anyway? We already have characters! Just make a library.

Except, then there are five different libraries out there, and suddenly some people use one and some people use another and you run into exactly the syntactic malfeasance above – two ways of writing the same thing, both arcane.

I think standard libraries are great, and a language promoting the aspects of itself that it considers first-class objects, like Go and it's Maps and Interfaces and Golets or whatever, that's a good thing. That's my two cents. You pick a language for what it thinks is important and what your project needs. C thinks speed and power are important – in my mind, it's tailored to a programmer who would rather write his own library in 4 hours than spend 4 hours writing his own. I'm not ashamed that I'd rather search out the library.
20 May, 2010, David Haley wrote in the 62nd comment:
Votes: 0
Quote
and you run into exactly the syntactic malfeasance above – two ways of writing the same thing, both arcane.

What are you referring to?

Quote
C thinks speed and power are important – in my mind, it's tailored to a programmer who would rather write his own library in 4 hours than spend 4 hours writing his own.

I'm not sure I follow… do you mean the programmer would rather write a library than search for a library?

Such programmers are likely to be deluding themselves if they think that on average they can write a library in the same amount of time it would take them to find it…
20 May, 2010, quixadhal wrote in the 63rd comment:
Votes: 0
If you really want to look at an elegant OO language, take a look at smalltalk. So many new languages borrow from that one…
20 May, 2010, David Haley wrote in the 64th comment:
Votes: 0
Sometimes I think that Smalltalk is to OO what Lisp is to functional programming…… :thinking:
20 May, 2010, Runter wrote in the 65th comment:
Votes: 0
Quote
I'm not trying to make this into a language war, but I feel I must correct these assertions.


Yes, I too feel these assertions must be corrected. Everyone knows all Turing complete languages are built equally. This language bigotry must end..David Haley.
20 May, 2010, quixadhal wrote in the 66th comment:
Votes: 0
Language Wars: The Syllable War
20 May, 2010, David Haley wrote in the 67th comment:
Votes: 0
Kaz said:
I'm not trying to make this into a language war, but I feel I must correct these assertions.

Well, you might want to double-check the assertion you were actually replying to, which was:
Quote
C++ can do this, of course, but not nearly as compactly (or compactly but with other stuff like functors elsewhere).

(emphasis added)

Now, ah, unless you're going to argue that this monstrosity:
transform(original_list.begin(), original_list.end(), back_inserter(doubled_list), _1 * 2);

is equally compact (and readable…!!) as:
doubled_list = [x*2 for x in original_list]

or:
doubled_list = original_list.map { |x| x*2 }

I'm not sure which assertion of mine you are "correcting".

Kaz said:
With C++1x

I'm not sure how "fair" it is to compare things to not-yet-released versions of software. The new C++ standard will be addressing a lot of issues. But… it's not out yet. :wink:

Runter said:
Yes, I too feel these assertions must be corrected. Everyone knows all Turing complete languages are built equally. This language bigotry must end..David Haley.

Sorry for the C++ libel, mea culpa!
20 May, 2010, David Haley wrote in the 68th comment:
Votes: 0
David Haley said:
Quote
and you run into exactly the syntactic malfeasance above – two ways of writing the same thing, both arcane.

What are you referring to?

When I wrote this, I actually hadn't seen Kaz's post – I realize now that you might be referring to the 'pretty' C++ code that he posted.
21 May, 2010, shasarak wrote in the 69th comment:
Votes: 0
quixadhal said:
If you really want to look at an elegant OO language, take a look at smalltalk. So many new languages borrow from that one…

QFT

Smalltalk FTW! :smile:

Ruby, certainly, is almost identical to Smalltalk under the covers - the syntax is very different but the concepts that the syntax manipulates are exactly the same (with the single exception of Ruby "modules" which are not a Smalltalk feature).
21 May, 2010, Kaz wrote in the 70th comment:
Votes: 0
David Haley said:
Now, ah, unless you're going to argue that this monstrosity:
transform(original_list.begin(), original_list.end(), back_inserter(doubled_list), _1 * 2);

is equally compact (and readable…!!) as:
doubled_list = [x*2 for x in original_list]

or:
doubled_list = original_list.map { |x| x*2 }

I'm not sure which assertion of mine you are "correcting".


I'd say that it is arguable. The important notion here is that they are both idiomatic one-liners, which is why, yes, I will say it is equally compact and readable, in the same way that "I borrowed a book from the library today" is equally compact and readable as "Ik heb vandaag een boek van de bibliotheek geleend". There are a different number of words and letters in each, but neither requires more brainpower to a native speaker (assuming I got the Dutch right).

Query: I can reverse the order of addition by using front_inserter instead of back_inserter. What's the equivalent Ruby?

David Haley said:
I'm not sure how "fair" it is to compare things to not-yet-released versions of software. The new C++ standard will be addressing a lot of issues. But… it's not out yet. :wink:


Both of the more popular consumer C++ compilers out there, g++ (that would be from 4.5, I believe) and MSVC++ (specifically VC++2010) can do this.

On the subject of "syntactic malfeasance" brought up elsewhere: there are an infinite number of ways to write any program.
21 May, 2010, 3squire wrote in the 71st comment:
Votes: 0
Quote
On the subject of "syntactic malfeasance" brought up elsewhere: there are an infinite number of ways to write any program.


But given the constraint: What is the language's idiom for this operation (generally taken to be "How is the usually done?") one might notice that some languages are consistent across idioms and others devise them haphazardly.

C++ is haphazard imo.
21 May, 2010, David Haley wrote in the 72nd comment:
Votes: 0
Kaz said:
I'd say that it is arguable. The important notion here is that they are both idiomatic one-liners, which is why, yes, I will say it is equally compact and readable, in the same way that "I borrowed a book from the library today" is equally compact and readable as "Ik heb vandaag een boek van de bibliotheek geleend".

I'm sorry but if your statement is that "these methods are the nicest available in their respective programming languages", my response is: "yeah, so what?" If language A's idiomatic notation is far nicer than language B's idiomatic notation, well, language B loses, sorry, even if language B's notation is the nicest in language B. Not all languages are equal in all things, and not all things are equally elegant in all languages. This is a fairly well-known issue and pretending otherwise is basically fantasy. It's sort of the whole point of having different languages.

Even without going down the rabbit hole of natural languages and brainpower, looking at the three examples given, Ruby and Python are absolutely unambiguously more compact. Again, that was the assertion you thought you were "correcting". And since you want to talk brainpower, well, reading something half as long will mean, well, it only takes half as long to see what's going on.

Kaz said:
There are a different number of words and letters in each, but neither requires more brainpower to a native speaker (assuming I got the Dutch right).

Citation please? There is in fact an awful lot of research into precisely this question, so I raise my eyebrows a little at your rather definitive claim.

Kaz said:
Query: I can reverse the order of addition by using front_inserter instead of back_inserter. What's the equivalent Ruby?

I wouldn't know the "best Ruby way", but the idiomatic Python would be to reverse the list you're iterating over. Something like:

doubled_list = [x*2 for x in reversed(original_list)]


This doesn't copy the original sequence; it just provides an iterator that goes in the other direction.

Because you are constructing the list in order, there is no way using that idiom to switch insertion order (however note that switching input order does the same); however you could easily use alternate constructions if it were somehow really, really important to consume the input in order and produce output in the opposite order. (such as providing the new sequence wrapped in its own reversed() iterator call, or simply constructing it by hand)

Quote
C++ is haphazard imo.

The STL is in fact remarkably consistent. I know you said C++ and not just the STL, but the examples given here are w.r.t. the STL.
21 May, 2010, Runter wrote in the 73rd comment:
Votes: 0
Quote
Query: I can reverse the order of addition by using front_inserter instead of back_inserter. What's the equivalent Ruby?


doubled_list = original_list.reverse.map{|x| x*2}


You can also iterate in reverse in place without an intermediate value.
doubled_list = []
original_list.reverse_each { |x| doubled_list.push(x*2)}

Although, I think map/collect is the proper way to do it here.
22 May, 2010, Tyche wrote in the 74th comment:
Votes: 0
Zadious said:
Are there any codebases written in C++ that run on windows without using the CGYwin thingy?

I have the simpleMud and BetterMud from Ron Pentons mud book, but I can not get them to compile in VS 2008.

I am just looking for something to tear apart and examine for fun.
Thank you.


You might want to try a few of these out:
ftp://sourcery.dyndns.org/archive/servers/othe...

I can't remember which have makefiles for Windows

I know Murk++ will compile under current versions Visual C++.
24 May, 2010, Kaz wrote in the 75th comment:
Votes: 0
David Haley said:
I'm sorry but if your statement is that "these methods are the nicest available in their respective programming languages", my response is: "yeah, so what?" If language A's idiomatic notation is far nicer than language B's idiomatic notation, well, language B loses, sorry, even if language B's notation is the nicest in language B. Not all languages are equal in all things, and not all things are equally elegant in all languages. This is a fairly well-known issue and pretending otherwise is basically fantasy. It's sort of the whole point of having different languages.


Well, "nice" is subjective. To be honest, I found the ruby somewhat obscured through symbols. "|x|"? Why are you finding the modulus of a vector in that statement? But that's because I'm not a native "speaker" of Ruby. On the other hand, the C++ code speaks volumes to me on the most brief scan: "For this range, apply this function to each element, placing the result over there" This was my point.

But for "conciseness" to mean anything positive in any terms of anything, it can't just be about the number of keypresses you have to make, otherwise we'd all be using APL. C++ can add two characters (.begin to .rbegin and .end to .rend) in order to reverse the order of insertion, or change front to back, whereas Ruby required a minimum of 8. Therefore C++ is more concise. It's meaningless.

And C++ getting continually pounced upon by irrelevant issues such as this (especially when the topic is titled, "Is there a C++ <x>") while it continues to be a powerful, expressive, multi-paradigm language, is a pet peeve of mine.

But ok, yes, I agree I'm getting carried away here.

David Haley said:
Kaz said:
There are a different number of words and letters in each, but neither requires more brainpower to a native speaker (assuming I got the Dutch right).

Citation please? There is in fact an awful lot of research into precisely this question, so I raise my eyebrows a little at your rather definitive claim.


Sure, subjective. One person's experience. Allow me to rephrase. "Assuming I got the Dutch right, understanding either of them seems to require no more brainpower for me." I hope I made the point clear, however.

Thanks for the Ruby examples.
24 May, 2010, JohnnyStarr wrote in the 76th comment:
Votes: 0
kaz said:
But that's because I'm not a native "speaker" of Ruby

+

kaz said:
Therefore C++ is more concise.


= TRUE
24 May, 2010, David Haley wrote in the 77th comment:
Votes: 0
Well, yes, as JohnnyStarr points out, C++ will always be easier for you to read because it's what you know how to read. So in a sense, you are making a somewhat trivialized or tautological statement. "C++ is what I know best, therefore it's what is best for me."

Incidentally, it so happens that I am a "native speaker" of C++ and Python, having written both for professional and hobbyist purposes for a while now. In fact, I've probably written more C++ than Python, although my Python usage is more recent. I also know Ruby fairly well, although I don't really write any. Therefore none of the three examples given are surprising to me and they all make sense once I finish reading them. The C++ is still verbose and arcane, even though I know exactly what it's doing and do not need to look up anything in reference manuals etc. Given that your first reaction to the Ruby is to ask about taking the modulus of a vector, well, it's hard for me to treat your comparison as being particularly fair.

Kaz said:
And C++ getting continually pounced upon by irrelevant issues such as this (especially when the topic is titled, "Is there a C++ <x>") while it continues to be a powerful, expressive, multi-paradigm language, is a pet peeve of mine.

Sorry, I guess. But it's not irrelevant, and there was an awful lot of context before you "pounced" on an assertion that was saying something different from what you seem to have initially thought it was saying. I realize that the following might sound worse than I mean it to, and I apologize in advance, but it sounds like you're essentially making a fanboy argument without really having learned the other languages you're making claims about.

It's also somewhat amusing to me that the post I made after the one you "pounced" on was actually defending C++.

Kaz said:
C++ can add two characters (.begin to .rbegin and .end to .rend) in order to reverse the order of insertion, or change front to back, whereas Ruby required a minimum of 8. Therefore C++ is more concise.

And yet the 'longer version' is still quite a bit shorter than C++, so no, even by the metric of number of characters Python and Ruby are more concise. :wink:

I'm not trying to argue that brevity of keystrokes is all that matters. I'm trying to argue for a form of conceptual brevity. Understanding the C++ example requires understanding more about what is happening. You need to understand the arguments that 'transform' takes. You need to understand the rather obscure Boost lambda syntax. I happen to agree that the 'map' method (which exists in Python as well) also requires a little technical understanding, if anything in syntax. But arguably, even a novice (or non-)programmer would be able to basically understand what the Python means.

But of course, the number of keystrokes does matter. If expressing the same idea in language A and language B takes twice as many characters in language B, then, well, it takes me twice as long to write it out, and I have to keep that much more stuff floating around in my head for longer as I type things out.

Kaz said:
Sure, subjective. One person's experience. Allow me to rephrase. "Assuming I got the Dutch right, understanding either of them seems to require no more brainpower for me." I hope I made the point clear, however.

No, not really. If you're going to make a purely subjective claim that cannot be verified or measured, it's not really worth making except as a somewhat interesting note about your personal experience. So what point do you hope you made clear? As I said, there is an awful lot of research into precisely this question, so I raise my eyebrows at the point you seemed to be making (the pre-rephrase point).
24 May, 2010, Runter wrote in the 78th comment:
Votes: 0
Quote
Well, "nice" is subjective. To be honest, I found the ruby somewhat obscured through symbols. "|x|"? Why are you finding the modulus of a vector in that statement? But that's because I'm not a native "speaker" of Ruby. On the other hand, the C++ code speaks volumes to me on the most brief scan: "For this range, apply this function to each element, placing the result over there" This was my point.

But for "conciseness" to mean anything positive in any terms of anything, it can't just be about the number of keypresses you have to make, otherwise we'd all be using APL. C++ can add two characters (.begin to .rbegin and .end to .rend) in order to reverse the order of insertion, or change front to back, whereas Ruby required a minimum of 8. Therefore C++ is more concise. It's meaningless.

And C++ getting continually pounced upon by irrelevant issues such as this (especially when the topic is titled, "Is there a C++ <x>") while it continues to be a powerful, expressive, multi-paradigm language, is a pet peeve of mine.


So much nonsense here that I'm not even going to dispute it all. I'm just going to say I would expect better from someone making an? (presumably) informed decision about why they're using a language.
24 May, 2010, JohnnyStarr wrote in the 79th comment:
Votes: 0
Not to stir things up, but:

kaz said:
To be honest, I found the ruby somewhat obscured through symbols. "|x|"?


Obscured perhaps to someone that hasn't taken a 15 minute Ruby tutorial, and not to everyone who has.
You could after all just say that you don't like what little Ruby you have only read, and not tested for yourself.
Don't get me wrong, I like C++ as much as Ruby, but I would have to stamp a "Don't knock it till you try it" on this one. :smile:
25 May, 2010, Runter wrote in the 80th comment:
Votes: 0
Quote
Don't get me wrong, I like C++ as much as Ruby, but I would have to stamp a "Don't knock it till you try it" on this one.


Yeah, I think this is the interesting thing here. I myself used C++ for going on 8 years. I know David is well versed in C++ as well. There's a misrepresentation here that people who don't understand/dislike C++ are slandering it. That's not really the case. We can talk about what C++ does well. Being concise isn't really one of those things. It's extremely high ceremony just to get small balls rolling.

Furthermore. I myself suggested the original poster l... .. And so did Johnny.
60.0/124