From: "Michael T. Richter" Date: 2008-05-10T14:43:19+09:00 Subject: Re: "Real" Differences Between Python & Ruby --=-J5bA/Pt8vOaHf2qleZ+n Content-Type: multipart/alternative; boundary="=-cDWCTYlruXoG1wJ2I2vp" --=-cDWCTYlruXoG1wJ2I2vp Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sat, 2008-05-10 at 02:13 +0900, Max Cantor wrote: > Maybe a different spin on my question could be, "What > problems did Ruby solve, as a new language?" I'm not sure that this is a meaningful question. What problems did any language past patch cabling circuit boards solve? If you set the bar low enough (or high enough) all current computer languages are imperfect reflections of a Turing machine anyway. (Yes, even the functional ones based on Church instead of Turing. They're just REALLY obfuscated.) As a former intensive Python evangelist (to the dread of my coworkers at the time) and a now very happy Ruby user (despite Ruby's many quirks -- and yes, I'm using the term here in its negative connotation) what I see Ruby bringing to the table that made me switch is: 1. A more flexible syntax which, while harder to learn completely, makes things easier to read when I have learned it. As a trivial example there's no need for if...elsif...else...end, unless...else...end, ...unless..., ...if..., ...?...:..., case...when...else...end and all other such conditionals. They can all be handled with if ... else ... end and nothing more. Yet the expressiveness of the language increases when I can pick and choose the construct that most accurately and succinctly expresses my intent. 2. Just enough support for functional-style programming that I don't feel like I'm fighting the language each step of the way when I'm trying to accomplish things I'm used to doing now. (If Ruby could add zero-stack tail recursion to its bag of tricks I'd be really happy!) Python has some support for the functional style, but Guido is noted as not thinking that it's important to support and, I think, secretly puts barriers to proper functional programming in place because he doesn't like it. 3. A far friendlier community. This is not a technical reason to switch, but given the complexity of modern programming languages and the even greater complexity of the bewildering variety of libraries available a decent community is vital for a language. I would far rather use a "substandard" language with a great community than a great language with a snotty, unhelpful community. I grew disgusted -- utterly disgusted -- with the Python community about eight years ago and have never bothered to poke my nose into the mailing lists, etc. since except for a few instances where I held my nose, asked my question, filtered through the hostile noise and found the answer. If I got an answer at all. The Ruby community is far more prone to good answers without the smart-ass syndrome -- although this is lamentably on the rise -- and far more welcoming to newcomers -- although this is lamentably on a decline. (Don't even get me started on the Common Lisp community of c. a decade ago. Just Google for "Erik Naggum" for a representative example.) 4. No syntactic whitespace. While I initially liked and defended the indentation scheme of Python, it was because I only ever wrote my own scripts for my own purposes. As soon as I had to work with another person using Python the weakness became evident. --=20 Michael T. Richter (GoogleTalk: ttmrichter@gmail.com) It's OK to figure out murder mysteries, but you shouldn't need to figure out code. You should be able to read it. (Steve McConnell) --=-cDWCTYlruXoG1wJ2I2vp Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sat, 2008-05-10 at 02:13 +0900, Max Cantor wrote:
Maybe a different spin on my question could be, &qu=
ot;What
problems did Ruby solve, as a new language?"

I'm not sure that this is a meaningful question.  What problems did any language past patch cabling circuit boards solve?  If you set= the bar low enough (or high enough) all current computer languages are imp= erfect reflections of a Turing machine anyway.  (Yes, even the functio= nal ones based on Church instead of Turing.  They're just REALLY obfus= cated.)

As a former intensive Python evangelist (to the dread of my coworkers at th= e time) and a now very happy Ruby user (despite Ruby's many quirks -- and y= es, I'm using the term here in its negative connotation) what I see Ruby br= inging to the table that made me switch is:
  1. A more flexible syntax which, while harder to le= arn completely, makes things easier to read when I have learned it.  A= s a trivial example there's no need for if...elsif...else...end, unless...e= lse...end, ...unless..., ...if..., ...?...:..., case...when...else...end an= d all other such conditionals.  They can all be handled with if ... el= se ... end and nothing more.  Yet the expressiveness of the language i= ncreases when I can pick and choose the construct that most accurately and = succinctly expresses my intent.
  2. Just enough support for functional-style program= ming that I don't feel like I'm fighting the language each step of the way = when I'm trying to accomplish things I'm used to doing now.  (If Ruby = could add zero-stack tail recursion to its bag of tricks I'd be really happ= y!)  Python has some support for the functional style, but Guido is no= ted as not thinking that it's important to support and, I think, secretly p= uts barriers to proper functional programming in place because he doesn't l= ike it.
  3. A far friendlier community.  This is not a = technical reason to switch, but given the complexity of modern programming = languages and the even greater complexity of the bewildering variety of lib= raries available a decent community is vital for a language.  I would = far rather use a "substandard" language with a great community th= an a great language with a snotty, unhelpful community.  I grew disgus= ted -- utterly disgusted -- with the Python community about eight years ago= and have never bothered to poke my nose into the mailing lists, etc. since= except for a few instances where I held my nose, asked my question, filter= ed through the hostile noise and found the answer.  If I got an answer= at all.  The Ruby community is far more prone to good answers without= the smart-ass syndrome -- although this is lamentably on the rise -- and f= ar more welcoming to newcomers -- although this is lamentably on a decline.=   (Don't even get me started on the Common Lisp community of c. a deca= de ago.  Just Google for "Erik Naggum" for a representative = example.)
  4. No syntactic whitespace.  While I initially= liked and defended the indentation scheme of Python, it was because I only= ever wrote my own scripts for my own purposes.  As soon as I had to w= ork with another person using Python the weakness became evident.

--
Michael T. Richter <ttmri= chter@gmail.com> (GoogleTalk: ttmrichter@gmail.com)
It's OK to figure out murder mysteries, but you shouldn't need to figure= out code. You should be able to read it. (Steve McConnell)
--=-cDWCTYlruXoG1wJ2I2vp-- --=-J5bA/Pt8vOaHf2qleZ+n Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBIJTXqLqyWkKVQ54QRAhQgAJ9SRiVjcO0E/QFzCGXSBSYibH0bXwCaAiua ORlC4jdx9UjZlod2vBFKZkE= =IEVk -----END PGP SIGNATURE----- --=-J5bA/Pt8vOaHf2qleZ+n--