by kab · 16y ago · 0 comments
The Ruby community is both ahistorical and insular. Most Ruby programmers came to Ruby from Java, PHP or some other mainstream language and have an uninformed opinion about Ruby's merit as a language and its place in the wider world of programming languages. The proof of this is their tendency to excessively tout features that Ruby borrowed from Lisp, Smalltalk and Perl, often with an implication that these features are unique or somehow special to Ruby when they have sometimes existed in other languages for decades (e.g., blocks, metaprogramming or flexible, TIMTOWTDI syntax) and often in a better form. (Compare Smalltalk's blocks, which are always real objects, to Ruby's, which need to be converted into Procs if you wish to treat them like objects).
The main issue I have with Hackety Hack is the existence of a mature, Smalltalk-based alternative named Squeak. Smalltalk is a much, much simpler language than Ruby and has a history of being used to tech children programming dating back to the 1970s. Squeak also has Scratch, EToys and Morphic. What exactly does Ruby bring to the table, other than nicer looking websites, bigger egos and curly braces? Would it kill Rubyists to learn a little bit about the languages that influenced Ruby and other non-mainstream or academic languages, to at see what they might be missing out on?
While I understand what you're trying to say, here's my perspective: even though many parts of Ruby have come from other languages, it's about the tradeoffs that were made. Blocks are actually a great example: what matz did was realize that often, you're only passing one anonymous function to another, and so he added special syntax to make it nicer. Procs aren't some conversion tool to upgrade blocks, Procs are the general case, and blocks are just a special one. That said, I can't remember the last time I actually needed to type Proc.new. With that said, you may disagree, but you can see where I'm getting at. Just because something did it _first_ doesn't mean they did it best. But that really comes down to taste, right?
> The main issue I have with Hackety Hack is the existence of a mature, Smalltalk-based alternative named Squeak.
The main issue I have with Squeak is that it's Smalltalk. ;) Smalltalk is a fine language, but I can't get into the whole image thing. I really have nothing new to add to this; my arguments are old and tired.
> What exactly does Ruby bring to the table, other than nicer looking websites, bigger egos and curly braces?
While we're on this whole "educate others about language features" kick, Rubyists almost never use curly braces. One-line blocks are the only time. ;)
> Squeak also has Scratch, EToys and Morphic.
What Ruby brings to the table is being an actual programming language, rather than a bunch of blocks you put together. I don't mean to demean Scratch, it's done a lot of good, and is a great project in its own way. However, I don't think that 'teaching programming' is a zero-sum, winner take all market. Hackety and Scratch can coexist just fine.
This argument, that you almost never need to pass in more than one block to a method, is true, only because Ruby doesn't as elegantly support the alternative. If it did, then you'd probably have plenty of multiblock methods like do:separatedBy: as you do in Smalltalk.
"With that said, you may disagree, but you can see where I'm getting at. Just because something did it _first_ doesn't mean they did it best."
So Smalltalk's blocks, which are versatile enough to be the basis for the language's control structures, are inferior to the block, proc, lambda trifecta of Ruby? Are you seriously telling me that you wouldn't prefer Ruby just have procs (real objects) with the block syntactic sugar and maybe also lamdbas, for their different return behavior?
"Smalltalk is a fine language, but I can't get into the whole image thing."
I used to feel the same way, but that was because I didn't understand the image. To me it was some digital blob with code and program state in it; I was always scared of breaking it or losing code. Then I learned how to actually use it, thanks to Squeak/Pharo by Example. Now I wouldn't have it any other way.
"While we're on this whole "educate others about language features" kick, Rubyists almost never use curly braces. One-line blocks are the only time. ;)"
Ruby is a curly brace language even if Rubyists opt not to use them; syntactically it belongs to the C family of languages, which are the "curly brace" languages.
What makes Ruby great for teaching, particularly for teaching children?
It generally does what it says it does, particularly when you're just starting and not touching on any of the more advanced features.
It's a real language and you can point to a lot of apps using it and people who've made lots of money doing so. Kids are smart enough to get irritated if you just hand them something that isn't a real thing. My little cousin is mercenary enough that the mention of this being used in a large number of new things that made lots of money was really exciting to him.
They can move onto building an interactive website relatively soon. Lots of the PHP kids learned PHP because of general coolness of doing a website they could share with their friends that was a little bit interactive. Hopefully you agree that Ruby is a better language than PHP.
There seems to be a proportionally higher number of people in the Ruby community who are into helping kids learn to program.
Not as readable as Smalltalk.
"...and doesn't punish you with too many horrible compile errors"
Yes, it absolutely does. In fact, Ruby is probably the most syntactically complicated language after Perl and C++. Smalltalk has six reserved words and its syntax fits on an index card.
"It's a real language and you can point to a lot of apps using it and people who've made lots of money doing so. Kids are smart enough to get irritated if you just hand them something that isn't a real thing. My little cousin is mercenary enough that the mention of this being used in a large number of new things that made lots of money was really exciting to him."
Smalltalk is a "real thing" and has been used professionally for years in the financial sector and recently has experienced a bit of Renaissance in web apps, and even found use in a YCombinator startup (Auctomatic). Granted, the community isn't as big as Ruby's, but it is quite healthy and continues to grow.
"There seems to be a proportionally higher number of people in the Ruby community who are into helping kids learn to program."
No, there aren't. Squeak _started_ as an educational project, and the Smalltalk community still has a heavy educational bent to it.
By following your point scratch should have not been created because etoys existed. Or etoys, since morphic existed.
Oh wait: and hackety hack is at least a couple of years older than scratch, according to wikipedia.