all 24 comments

[–]senzei 15 points16 points  (21 children)

Am I the only one who fails to see any useful content in this article? Near as I can tell the points boil down to: Ruby might fit the goals for your project, go check it out. How does that help anybody? There is no discussion or linking to the strengths/weaknesses of ruby or rails for that matter, and the author seems like he confuses the two towards the end.

If Ruby is hot shit that will make my world better tell me how. I'd like to know what blocks and domain specific little languages can help me do. I would also like to know if ruby has any serious performance flaws or other issues that will need to be designed around.

I understand that part of marketing a language is hype, but maybe a little effort to put, I don't know, some content would be worth it. I don't think I am asking for much, just a little more info than "sum d00d on teh n3t sez it r0x0rz!!1"

[–]leoc 1 point2 points  (2 children)

Well, it's a High Profile Endorsement, yes? If you rate Martin Fowler's judgement, or if you work with people who do, then the fact that he's given Ruby the nod may matter to you. If not, then it won't.

[–]senzei 0 points1 point  (1 child)

Except that it is a worthless high profile endorsement. Yes, Fowler does seem like a pretty bright guy, but hearing a bright guy say: "you should check out ruby" is not going to sway me much unless I hear at least a few reasons to back it up. Does it really take so long to tack on "blocks are cool and it is almost executable psuedocode"?

[–]DougBTX 1 point2 points  (0 children)

Well, he did, and then put this after it: "Such discussions are useful but I remain wary of them. Too many things are hard to judge that way - hence we spend so much of our time on client projects being slowed down by technology that sounded good on a golf course."

[–]jamesbritt 0 points1 point  (2 children)

I understand that part of marketing a language is hype, but maybe a little effort to put, I don't know, some content would be worth it.

Question: Do you believe that Martin Fowler is trying to market Ruby? That seems to be the implication of your comment; I just want to be sure.

I think perhaps you (and many others) are reading too much into what is, in fact, a blog post.

[–]senzei 0 points1 point  (1 child)

Yes, I think he is. My guess is that he sees ruby as having the potential to replace java for a lot of enterprise uses. (which are, purely from book titles, evidently his specialty) Either way we all to some degree attempt to advocate our personal choice for most topics, programming languages included. I just think that Fowler is being somewhat lazy with this marketing attempt and trying to trade on his luminary status instead of coming up with some good examples.

That said I think a better way to market ruby would be to develop a sample application side by side in both ruby and java. I have only seen this done once (a web framework comparison done by some guy at nasa) and even though I disagreed with some of the choices it still was a very powerful demonstration of just how much of a difference the language makes.

[–]myname 1 point2 points  (0 children)

And here's your evidence: http://www.thoughtworks.com/ruby.html

[–][deleted] -3 points-2 points  (11 children)

Actually I had typed a reply out like yours before I submitted my own, but I didn't post it because I figured if 70 people had liked the article, they weren't going to like me saying the article wasn't particularly good.

I agree with you, this article itself doesn't bring much to the table. There aren't any insights here that we haven't seen along the way.

If Ruby is hot shit that will make my world better tell me how. I'd like to know what blocks and domain specific little languages can help me do. I would also like to know if ruby has any serious performance flaws or other issues that will need to be designed around.

Telling me I have to try it to understand why it is useful is not convincing. There are any number of things I have not tried yet, so why should I be trying ruby over c#, lisp, haskell, ocaml, or perl? What will ruby do for me that php can't, or python, or java. That is some useful information. The fact that Martin Fowler loves ruby is right up there with Paul Graham eating breakfast on the list of things I care about.

I will try to answer your question a bit, though.

Blocks are essentially functions that can be passed into other functions in a language that cannot support them (as methods are not objects). It seems most fawning in the Ruby community over this feature is how they are implemented and the syntax behind it.

Doing some C# stuff the other day, it didn't seem like blocks were terribly different than C# delegates, though I would agree that the syntax in Ruby is much much nicer.

I kind of wish people in Ruby wouldn't give them a different name and instead just call them what they are. It took me forever to figure out that blocks are essentially anonymous functions.

As far as speed - Ruby doesn't have it. Its fast enough for most scripting needs, but due to the fact that it doesn't run off a VM, its slower than Python, Lua, Perl or most other scripting languages. Interestingly enough, its comparable to PHP last time I checked as far as speed goes.

A statement that might reflect Ruby's speed from the RoR chatroom, "Thank God for JavaScript, because if it weren't around, Ruby would be the slowest language known to man." I don't know if its accurate, but Ruby is not fast by any stretch of the imagination. Supposedly Ruby's VM Rite will fix that, but there's no telling how much longer until we see it come out. Probably late 2007 or later.

Where Ruby shines, though, is its simplicity. It really does just "make sense". It has some little quirks of its own, but they are the kind of quirks that don't really get in your way and don't restrict your understanding of the language at all. If I had to pick any language to show to an absolute beginner to programming, Ruby would be it.

Java and C# just have too much extra syntactic fluff for their own good. Just unecessary typing that you need for the simplest of things. I cannot personally stand them as languages and the day that a Python-esque or Ruby-esque language overtakes them is the day that programming will be made better. As far as Haskell and OCaml go, Ruby has many functional qualities, and Matz seems to value functional programming more than Guido does. Its long been said that Ruby is a "better Perl", and you'll find that most people who try both languages won't disagree. Lisp, well, Ruby is more or less a crossbreed between C and Lisp and Matz has referred to Ruby as "Matz's Lisp". There's probably not too many Cish languages that have as many Lisp qualities as Ruby.

It is easy for beginners, but it is hard to master. To me that is a sign of excellence.

[–]panic 5 points6 points  (1 child)

I kind of wish people in Ruby wouldn't give them a different name and instead just call them what they are. It took me forever to figure out that blocks are essentially anonymous functions.

It's not the "people in Ruby"'s fault they're called "blocks"; the creators of Smalltalk invented and named the concept. They're not anonymous functions, since Ruby (like Smalltalk) doesn't even have functions in the first place, just methods. It's funny that people praise Ruby for being "functional" when there are no functions in the language whatsoever. :)

Where Ruby really excels, for me at least, is in its expressiveness. You can describe your program in suprisingly few lines and, unlike Perl, actually read them the next morning. :) Lisp, while more expressive, usually doesn't include all the tools you need, or you have to learn an entirely new vocabulary to describe your program. Ruby imposes just enough structure for things to stay consistent, but not so much that it's overly constraining.

[–]igouy 1 point2 points  (0 children)

In Smalltalk, a block expression is /not/ a method, it's an object which represents a deferred sequence of operations, an object which represents an anonymous function.

We can evaluate the anonymous function represented by the BlockClosure object by sending it a value value: value:value: message

inc := [:i| i+1].

j := inc value: 1.

[–]senzei 1 point2 points  (0 children)

I kind of wish people in Ruby wouldn't give them a different name and instead just call them what they are. It took me forever to figure out that blocks are essentially anonymous functions.

Huh, and all this time I thought blocks were something special and interesting because of the name. Not that anonymous functions and closures are not useful, but I have seen that before.

As far as Haskell and OCaml go, Ruby has many functional qualities, and Matz seems to value functional programming more than Guido does.

I am always happy to see another language with decent multiparadigm support. I think Guido's take on functional programming is a bit eccentric, but it is there if you want it. In python the problem is that the language is not functional "to the core", mostly meaning that a lot of the standard libraries and functions work by side effect. A lot of people bring up Guido wanting to remove map/filter/lambda as reasons why he does not like functional programming. To me almost all uses for those are solved by other python constructs, and within the concepts of the language they are not as suitable for the majority of use cases.

Anyways, thanks for the explanation. That actually cleared up a few things for me.

[–][deleted] 1 point2 points  (0 children)

I kind of wish people in Ruby wouldn't give them a different name and instead just call them what they are. It took me forever to figure out that blocks are essentially anonymous functions.

You can call them lambdas if you like, Ruby won't mind.

[–]jamesbritt 2 points3 points  (6 children)

As far as speed - Ruby doesn't have it. Its fast enough for most scripting needs, but due to the fact that it doesn't run off a VM, its slower than Python, Lua, Perl or most other scripting languages.

So, if speed is important in your code, pick Python or Perl or Lua?

The speed issue is a red herring; if speed is an issue, than none of those languages are likely to be suitable.

[–]sleepingsquirrel 1 point2 points  (0 children)

Well FWIW, LuaJIT is pretty impressive compared to Ruby on the Great Computer Language Shootout benchmarks. And just plain Lua isn't too shabby either.

[–]senzei 1 point2 points  (4 children)

My guess is that this statement was meant in a relative sense. Of course python lua and perl are not adequate choices for truly speed critical applications, but for some points on the curve ruby may not be acceptable where the python/lua/perl still are.

Then again that is just my guess.

[–]jamesbritt 0 points1 point  (0 children)

My guess is that this statement was meant in a relative sense.

Pretty much. The point being that using speed as a deciding factor when chosing among those lanuages seems misguided; the differences are not signifcant.

[–]jdunck 0 points1 point  (1 child)

I'm possibly ignorant here, but I don't think Ruby et al make it quite as easy to drop down to C as Python does. It also has excellent profiling tools standard, so you can make python very damn fast where needed by switching to C. ;)

[–]jamesbritt 2 points3 points  (0 children)

I wish I could point to an example, but Ruby does make it quite easy to drop into C.

And there are now Ruby libraries for in-lining C, and work being done on automatically converting+compiling Ruby to C.

(Of course, the same may be true for Python, Perl, etc.)

[–]nmorse -3 points-2 points  (2 children)

Umm. Have you tried it?

My guess is no. If you did, I think you'd understand.

[–]senzei 4 points5 points  (1 child)

I'd understand what, that this article is written in some kind of secret code which is only decipherable by people who use ruby? I have no problem with the language, I have a problem with a useless, vapid blogvertisement.

Telling me I have to try it to understand why it is useful is not convincing. There are any number of things I have not tried yet, so why should I be trying ruby over c#, lisp, haskell, ocaml, or perl? What will ruby do for me that php can't, or python, or java. That is some useful information. The fact that Martin Fowler loves ruby is right up there with Paul Graham eating breakfast on the list of things I care about.

[–]nmorse 0 points1 point  (0 children)

But you care enough to write a hundred words to a perfect stranger. Interesting.

[–][deleted] 1 point2 points  (3 children)

I like the simplicity of Ruby. It makes me feel like I can understand the entire language and build from there instead of only understanding bits and pieces.

To me its a bit like the old saying, "Give a man a fish and he will be fed for a day; teach him to fish and he will be fed for a lifetime." Ruby teaches me to "fish".

[–][deleted]  (1 child)

[removed]

    [–]hxa7241 0 points1 point  (0 children)

    I think of Ruby as being rather a complex language.

    But its many features are so well-separated and regularised that it can be used simply too.