From: David Masover Date: 2008-06-02T10:46:44+09:00 Subject: Re: Should I Learn Ruby as a First Language? On Thursday 29 May 2008 15:25:04 7stud -- wrote: > Ruby people talk about how clean the Ruby syntax is and how Ruby > "doesn't get in your way". But in my opinion, Ruby has barely evolved > beyond Perl as far as ugly syntax goes. You obviously haven't seen a lot of Perl. And to either, I'd say, it's how you use it. It is possible to write beautiful syntax in Ruby. I'm not convinced it's possible to do so in Perl without a filter. > To be fair, > all computer languages get in your way: there are weird results, quirks, > and edge cases that will stump you when writing programs, but for some > reason the Ruby kool-aid drinkers like to claim that is not the case in > Ruby. We're not the only ones: http://xkcd.com/353/ To be fair, every language has "kool-aid drinkers". There are people who absolutely love .NET, for whom its their sole reason for staying on Windows. > Ruby lets you do so many bizarre things that I would guess there > are more quirks and edge cases that will leave you completely bewildered > than in any other language I know. Any Turing-complete language lets you do bizarre things. If you're doing stuff like this: class NilClass def nil? false end end Expect your irb to crash when you type that, or shortly thereafter. Personally, I like that you can do stuff like that in Ruby. Doesn't mean you have to. I like that I can type "rm -rf /" at a Unix prompt, but of course, I don't. I like having the training wheels off. > > I suspect that Ruby has more LISPisms than Python. > > Either would be good for GUI OS X apps and web apps. > > > > As a beginner, you can pretty much forget about programming GUI apps > with Ruby. Ruby doesn't come with any software that will let you > program GUI apps, so you first have to get some software installed, > which can be a big hassle. Then there is not much documentation or many > tutorials for Ruby GUI programming. If you're learning to program, I should hope that you can also learn to install software. I haven't looked at the documentation, though... > On the other hand, Python includes software that will let you program > GUI apps. It's called Tkinter, and it's simple enough so that beginners > can get their feet wet. The documentation on Tkinter isn't the > greatest, but some python books have sections on Tkinter and there are a > few websites that have decent examples and documentation. $ python Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import Tkinter Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 41, in raise ImportError, str(msg) + ', please install the python-tk package' ImportError: No module named _tkinter, please install the python-tk package >>> Whoops. There goes that theory. As long as I'm going to be installing packages, why not install tcltk for Ruby? Or OpenGL? And while we're at it, in my experience, gem is much, much better than "easy-install". > The documentation for the Ruby language and its Standard Library is very > poor. Really? http://ruby-doc.org/ Plenty of documentation. Not complete, but not "poor", I think.