# Why Ruby over Python?

**URL:** <https://rubytalk.org/t/why-ruby-over-python/28762>\
**Category:** ruby-talk\
**Created:** [8 July 2006 14:10 UTC](https://rubytalk.org/t/why-ruby-over-python/28762 "2006-07-08T14:10:08Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![James\_Britt3](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@James\_Britt3](https://rubytalk.org/u/James_Britt3)\
**Post date:** [8 July 2006 19:22 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/41 "2006-07-08T19:22:22Z")

</div>

dblack@wobblini.net wrote:

> Hi --
> 
> > As a longtime Perler, I dislike Python's significant whitespace. That's why  
> > I could never go for it. Ruby just feels right to me. I enjoy writing it  
> > and it feels liberating when I do.
> > 
> > I still like Perl, but Ruby is quickly winning me over.
> 
> Let's be clear about this, though: people \*are\* allowed to like and  
> use more than one language 🙂 This is a point that sometimes gets  
> obscured in these "winner-take-all" language comparison discussions.

Don't be a party pooper.

Next thing you know, people will start thinking it's OK to like and use more than one Web framework, or more than one editor, or more than one OS.

And what fun would that be?

> **···**
>
> > On Sun, 9 Jul 2006, Troy Denkinger wrote:
> 
> --  
> James Britt
> 
> "You harmonize; then you customize."  
> &nbsp;&nbsp;- Wilson Pickett

---

<div class="post-metadata">

**Author:** ![Troy\_Denkinger](https://avatars.discourse-cdn.com/v4/letter/t/2bfe46/32.png) [@Troy\_Denkinger](https://rubytalk.org/u/Troy_Denkinger)\
**Post date:** [9 July 2006 00:35 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/42 "2006-07-09T00:35:05Z")

</div>

I got yer snake right heah, baby!

> **···**
>
> On 7/8/06, M. Edward (Ed) Borasky \<znmeb@cesmail.net\> wrote:
> 
> > And ... which would \*you\* give a lovely young lady -- a ruby or a  
> > dangerous reptile?

---

<div class="post-metadata">

**Author:** ![Logan\_Capaldo](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@Logan\_Capaldo](https://rubytalk.org/u/Logan_Capaldo)\
**Post date:** [9 July 2006 04:42 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/43 "2006-07-09T04:42:26Z")

</div>

Significant whitespace in ruby? Perhaps you mean "\n" as a statement terminator? Are there any other examples?

> **···**
>
> On Jul 8, 2006, at 11:21 PM, James Britt wrote:
> 
> > Ruby has significant white space, too. But no significant indentation (or, as I tend to think of it, "static indentation.")

---

<div class="post-metadata">

**Author:** ![Elliot\_Temple](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Elliot\_Temple](https://rubytalk.org/u/Elliot_Temple)\
**Post date:** [9 July 2006 04:49 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/44 "2006-07-09T04:49:20Z")

</div>

> I love Ruby because I can do this:
> 
> class Integer  
> &nbsp;&nbsp;def even?  
> &nbsp;&nbsp;&nbsp;&nbsp;( self % 2 ) == 0  
> &nbsp;&nbsp;end  
> end
> 
> puts 3.even?  
> puts 28.even?

I don't know if that's possible in Python, but apparently I can't guess how to do it based on a little previous Python usage:

irb(main):037:0\> quit  
curi-g5:~ curi$ python  
Python 2.4.1 (#2, Mar 31 2005, 00:05:10)  
[GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin  
Type "help", "copyright", "credits" or "license" for more information.  
\>\>\> Integer  
Traceback (most recent call last):  
&nbsp;&nbsp;&nbsp;File "\<stdin\>", line 1, in ?  
NameError: name 'Integer' is not defined  
\>\>\> 3  
3  
\>\>\> 3.methods  
&nbsp;&nbsp;&nbsp;File "\<stdin\>", line 1  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.methods  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^  
SyntaxError: invalid syntax  
\>\>\> 3.x = 4  
&nbsp;&nbsp;&nbsp;File "\<stdin\>", line 1  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.x = 4  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^  
SyntaxError: invalid syntax  
\>\>\> x = 3  
\>\>\> x.x = 4  
Traceback (most recent call last):  
&nbsp;&nbsp;&nbsp;File "\<stdin\>", line 1, in ?  
AttributeError: 'int' object has no attribute 'x'  
\>\>\> quit  
'Use Ctrl-D (i.e. EOF) to exit.'  
\>\>\>  
curi-g5:~ curi$ irb  
irb(main):001:0\>

I may have typed "quit" on purpose. \*ducks\*

-- Elliot Temple

> **[Curiosity Blog – Elliot Temple](https://www.curi.us/blog/)**
>
> A philosophy blog

> **···**
>
> On Jul 8, 2006, at 9:40 PM, richardun@gmail.com wrote:

---

<div class="post-metadata">

**Author:** ![Ron\_M](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@Ron\_M](https://rubytalk.org/u/Ron_M)\
**Post date:** [9 July 2006 08:37 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/45 "2006-07-09T08:37:32Z")

</div>

M. Edward (Ed) Borasky wrote:

> I have found that switching languages rapidly, frequently, even in a  
> "staggered/parallel" manner is for the most part counter-productive.  
> ...  
> Add multiple programming languages and you lose focus.

I find this not to be true when the languages each are used for the  
special purpose they're best suited for. I've seen this to be true  
for hardware design, where switching from C models to VHDL or Verilog  
makes sense; and for web stuff where switching between (whatever)  
and SQL is common; and for embedded DSP stuff where switching  
between C and assembly is not uncommon.

I'd even go so far as saying that a mix of Ruby with C extensions is  
better in all ways than Java or C# or C++ since in the former case you  
can more often use the right-tool-for-the-job while in the latter case  
you're using a crippled compromise language that sucks at OO and that  
sucks at low-level stuff.

I think many of the more interesting ruby projects (  
&nbsp;&nbsp;&nbsp;\* \_why's Hpricot;  
&nbsp;&nbsp;&nbsp;\* David Balmain's Ferret;  
&nbsp;&nbsp;&nbsp;\* Ara's NArray+mmap  
) are proving this out, since they're excellent examples of  
using Ruby where appropriate and using C where appropriate  
and are producing results that go a long way to bringing the  
best of both worlds to the user.

And this thought lets me drift back on-topic to the original  
Python question -- I find Ruby's C interfaces (both RubyInline  
and the traditional one) cleaner than that of most languages,  
including Python back when I looked at it. And this cleanliness  
is why I care very little about ruby performance concerns - it's  
very easy to apply micro-optimizations this way if you need to.

> I pity a  
> programmer who has to write a Ruby - FORTRAN bridge that is called by a  
> Java ERP application for an engineering firm located in Quebec. 🙂

Hmm.. I did Ada/Fortran and Fortran/Forth bridges as  
one of my earlier programming jobs. Close enough?

---

<div class="post-metadata">

**Author:** ![Daniel\_Martin](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@Daniel\_Martin](https://rubytalk.org/u/Daniel_Martin)\
**Post date:** [9 July 2006 12:35 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/46 "2006-07-09T12:35:50Z")

</div>

"M. Edward (Ed) Borasky" \<znmeb@cesmail.net\> writes:

> Incidentally, where I disagree is that I think there are six families:
> 
> 1. Macro assemblers  
> 2. Algol  
> 3. Lisp  
> 4. APL  
> 5. Forth  
> 6. Smalltalk

I'm just curious; where does Haskell fit in this? I think in this  
taxonomy it might fall under "lisp" because of the broad "functional"  
language category, but I've found that doing serious stuff in Haskell  
stretches my mind more than the bits of common lisp I've learned (but  
that's probably because I have never gotten heavily into CL macros).

I remember several years ago someone responded to a slashdot interview  
question with a list of about twelve language categories, with several  
languages fitting into multiple categories; the idea was that a  
well-rounded programmer would know at least one language from each  
category. I'll see if I can find it.

As for the original subject of this thread, I just find ruby more fun  
to program in. I definitely do not think that ruby code is more  
obvious to the untrained eye than other languages - if that were the  
only category, python would indeed win. However, the experience of  
writing python feels like explaining things in detail to a somewhat  
dim coworker. While there's something to be said for that approach, I  
find that it often gets in the way of what I want to do - I want a  
fast way to translate ideas into running code. Since there's not yet  
a telepathic compiler, we're stuck with using some sort of language,  
and I see no reason to use a language more cumbersome than necessary.  
I suppose that the whitespace usage comes into play here, although I'm  
definitely not opposed to using significant whitespace, having been  
bitten a few times by ruby code that looked right indentation-wise but  
left off the "end". I just wish python whitespace were optional the  
way it is in Haskell.

That being said, the dynamic language I use the most is still perl. I  
was never nearly as put off by all the bits of "snoopy swearing" as  
some people seem to be - I suppose I learned perl at a time when my  
mind was flexible enough that it just twisted certain structures into  
a perl shape. Perl also has the advantage of being much faster for  
most operations than ruby or python.

When I want to move text A in spot one over to text B in spot two, I  
use perl. That's what it's for, and it does that job amazingly well.  
(It's not all regexps either. The one-liner to convert fixed length  
records into newline-delimited regexps is nice and tight.) It's  
disturbing how many business problems boil down to moving text from A  
to B.

When I wanted to document an algorithm for my father (who speaks none  
of the same computer languages I do aside from C/C++, and has spent  
his career largely in VB or at the VB/COM interface), I used python.  
I was already doing extensive documentation, so at that point...

When I want to play with programming, I choose ruby. When I want to  
experiment, and don't really know where I'm going to end up, or how  
I'm going to want to do something, ruby is there and ready to be  
twisted however I want. In short, when I want to have fun, I choose  
ruby.

(those business analysts who are looking at this and thinking of right  
now mandating python use for everything are well advised to go  
(re-)read the book "Peopleware", and realize that developers having  
"fun" has very serious economic advantages)

---

<div class="post-metadata">

**Author:** ![vasudevram](https://avatars.discourse-cdn.com/v4/letter/v/bbce88/32.png) [@vasudevram](https://rubytalk.org/u/vasudevram)\
**Post date:** [9 July 2006 18:25 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/47 "2006-07-09T18:25:10Z")

</div>

M. Edward (Ed) Borasky wrote:

> Not so much flames as challenges ...  
> \> to make it one. Its quite possible to learn and work with more than one  
> \> language at the same time, or at least in a staggered/parallel manner.  
> \> Many top developers are of the view that learning and using more than  
> \> one language is beneficial, helps you grow as a programmer.  
> I have found that switching languages rapidly, frequently, even in a  
> "staggered/parallel" manner is for the most part counter-productive.  
> Programming in \*any\* language is an activity that requires a mix of  
> intense focus on the programming tasks \*and\* an intensely active  
> communication in a spoken human language with customers and colleagues.  
> Add multiple programming languages and you lose focus.

I might not have made my above point ("it is quite possible to ...")  
clear. What I meant was, once you've learned those (more than one)  
languages, to a reasonable degree of proficiency, then its quite  
possible to work with more than one at the same time (strictly  
speaking, in a staggered manner - I haven't yet seen anyone who can  
write more than one program (whether in one language or two) literally  
at the same time ... 🙂 in a given project.

I've done that in real-life projects (and this is often a genuine need  
in such projects); e.g. have programmed in Informix ESQL/C (which is  
actually like two languages - C and SQL in one source file) (for  
database apps), plain UNIX C (for system tools or one-off programs to  
be used by me and developers), Java (for biz apps again, as well as  
system utliities), standalone SQL scripts (run from an SQL client), and  
UNIX shell scripts (for automating tasks and calls to other programs) -  
all in a single large long-running corporate project.

The organization not having resources for hiring specialized developers  
for each individual language can also be a reason for needing to have  
people (rather, the same person) develop in more than one language on  
one project.

> Occasionally a project will need multiple languages. I've found those go  
> slower and are more difficult than projects where you can wallow in your  
> knowledge of a single language and a single application domain. I pity a  
> programmer who has to write a Ruby - FORTRAN bridge that is called by a  
> Java ERP application for an engineering firm located in Quebec. 🙂

Not so occasionally, IMO - at least in larger corporate projects - see  
1st para above.

> Yes, indeed, learning multiple languages does help you grow, provided  
> they aren't too similar. There's a note about that on someone's blog --  
> give me a day or so and I can track it down. But briefly, he claimed --  
> and I somewhat agree -- that there are two broad classes of language.

Why should learning languages that are somewhat similar but with some  
differences, not help you grow? (challenge:-) E.g, Case in point:  
Python and Ruby.

> There's the "Algol Family", into which class C/C++, Java, Python, Ruby,  
> Perl, etc. fall, and there's the "Lisp Family". If you're like most of  
> us, you spend most of your time in the Algol family. His point was that  
> you grow more if you learn a Lisp family language than if you learn  
> another Algol family language.
> 
> Incidentally, where I disagree is that I think there are six families:
> 
> 1. Macro assemblers  
> 2. Algol  
> 3. Lisp  
> 4. APL  
> 5. Forth  
> 6. Smalltalk

You forgot Prolog-style languages - which are different from Lisp. I'm  
not a language lawyer or expert, but have checked both those out a bit,  
and I do feel that the programming paradigm in Prolog is different from  
Lisp. Can't speak from a theoretical standpoint (e.g. some Lispers may  
say that Prolog is in the same family as Lisp), and if I remember, Paul  
Graham's On Lisp or some other Lisp book has an implementation of  
Prolog in Lisp - though that may not be against my point that Prolog is  
a different family than Lisp).

> Ruby, I'll give it a shot. And there are language-specific IDEs for  
> Ruby. But don't \*real\* programmers use Emacs?
> 
> \<ducking\>

I was quite skilled at vi before vim came out, and managed very well  
with that, though I'm aware (now) that vim has lots more features, and  
am slowly checking them out.

A couple of times I've heard people (newbies mostly) mutter "magic..."  
to themselves, standing behind me and watching me type code .... 😉  
Nothing special about it - just years of typing .... I'm sure many  
others are the same .......

Vasudev Ram

> **[dancingbison.com](http://ww38.dancingbison.com/)**
>
> Learn Python Programming

> **[Yahoo | Mail, Weather, Search, Politics, News, Finance, Sports & Videos](https://www.yahoo.com/)**
>
> Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!

> **[Conversion of other file formats to PDF](https://sourceforge.net/projects/xtopdf)**
>
> Download Conversion of other file formats to PDF for free. xtopdf: Tools to convert other formats (x) to PDF; x as in math.

> **···**
>
> > Actually, I've never bothered to learn Emacs. It had a (justified)  
> > reputation as a memory hog, so I learned vi. I'm pretty sure GNU Emacs  
> > is no longer a memory hog, but I'm so firmly down the "vim" path that  
> > Emacs seems like a distraction.
> > 
> > --  
> > M. Edward (Ed) Borasky
> > 
> > [http://linuxcapacityplanning.com](http://linuxcapacityplanning.com)

---

<div class="post-metadata">

**Author:** ![Ben\_Armston](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@Ben\_Armston](https://rubytalk.org/u/Ben_Armston)\
**Post date:** [9 July 2006 21:15 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/48 "2006-07-09T21:15:10Z")

</div>

M. Edward (Ed) Borasky wrote:

> Matt Lawrence wrote:  
> \>  
> \>\> Besides ROR, can you give me a reason why perfer ruby instead of  
> \>\> python?  
> \>  
> \> Did you see the lovely young ladies (I hope you know who you are) at  
> \> the last RubyConf?  
> And ... which would \*you\* give a lovely young lady -- a ruby or a  
> dangerous reptile?
> 
> 🙂

I have a friendly pet snake I'm often trying to give to lovely young  
ladies. 🙂

> **···**
>
> > \> On Sat, 8 Jul 2006 howachen@gmail.com wrote:

---

<div class="post-metadata">

**Author:** ![Doug\_Bromley](https://avatars.discourse-cdn.com/v4/letter/d/8797f3/32.png) [@Doug\_Bromley](https://rubytalk.org/u/Doug_Bromley)\
**Post date:** [10 July 2006 09:20 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/49 "2006-07-10T09:20:53Z")

</div>

I wrote a blog entry on my experiences of going from one to the other.

[http://straw-dogs.co.uk/blog/04/06/the-journey-from-python-to-ruby-pt-1/](http://straw-dogs.co.uk/blog/04/06/the-journey-from-python-to-ruby-pt-1/)

You may find it interesting. 🙂

---

<div class="post-metadata">

**Author:** ![Marcelo](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Marcelo](https://rubytalk.org/u/Marcelo)\
**Post date:** [10 July 2006 12:25 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/50 "2006-07-10T12:25:05Z")

</div>

Oh, yes, I saw that page, but for what I saw, most of them are in early  
development or dead. The only one apparently working is the Ruby/Gnome.

Am I wrong? Who is doing GUI development in Ruby and what are they  
using? (please, Tk is awful both in Ruby and Python) I think that in  
GUI development, Ruby is far behind Python, and that is something that  
keeps me from stepping into Ruby.

Any help would be appreciated, and sorry for my English.

Marcelo

---

<div class="post-metadata">

**Author:** ![Marcelo](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Marcelo](https://rubytalk.org/u/Marcelo)\
**Post date:** [10 July 2006 12:35 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/51 "2006-07-10T12:35:06Z")

</div>

In Python you have to sub-class int:

class MyInteger(int):  
&nbsp;&nbsp;&nbsp;&nbsp;def is\_even(self):  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return (self % 2) == 0

a = MyInteger(3)  
a.is\_even() -\> False  
a = MyInteger(4)  
a.is\_even() -\> True

It's not the same as in Ruby, I can see that, but it is very posible.

richardun@gmail.com wrote:

> **···**
>
> > I love Ruby because I can do this:
> > 
> > class Integer  
> > &nbsp;&nbsp;def even?  
> > &nbsp;&nbsp;&nbsp;&nbsp;( self % 2 ) == 0  
> > &nbsp;&nbsp;end  
> > end
> > 
> > puts 3.even?  
> > puts 28.even?
> > 
> > -R  
> > "Quis custodiet ipsos custodes?"

---

<div class="post-metadata">

**Author:** ![Tim\_Pease](https://avatars.discourse-cdn.com/v4/letter/t/3e96dc/32.png) [@Tim\_Pease](https://rubytalk.org/u/Tim_Pease)\
**Post date:** [10 July 2006 19:45 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/52 "2006-07-10T19:45:15Z")

</div>

Hi John,

> Well, we've got rdoc. What specific python doc feature do you miss?  
> Maybe being able to type "help( some\_obj.some\_method )" at the  
> interactive prompt?
> 
> Personally, I didn't like the Python way of putting doc strings  
> \*below\* the thing they were documenting... always seemed upside-down.

Coming to Ruby from Python, that was the first thing I said to myself:  
"I wish documentation were 'built in' like Python". Rdoc is great,  
and I use it everywhere now, so my documentation desire is met. But I  
had to say that I missed something from Python 😉 No other Python  
specific features come to mind that I miss.

I'm blessed right now to be coding Ruby full time for my job. We're  
writing tools to test the avionics for the Kepler Space telescope --  
this involves generating 110 mega-pixel test images, running them  
through the avionics, and then verifying that none of the pixels got  
lost or mangled.

The flexibility of Ruby has allowed me to  
1) write C code for the parts that need to be fast  
2) write Ruby code for the parts that the users want to change all the time  
3) use meta-programming to write some DSL syntax so the test engineers  
can write their own image generation and validation scripts  
4) rake to deploy everything -- I'm amazed no one has mentioned rake yet  
5) gems to distribute everything -- another one I'm amazed no one has mentioned

Oh, and the Ruby community is just awesome ... thanks to

Matz - for writing this thing  
Guy Decoux - for the mmap library  
Jim Weirich - for rake and gems  
Ara Howard - for all the awesome answers about threads and numeric  
coputing with Ruby  
Mauricio - rcov makes our Software Quality Engineers happy  
howachen - for this fun thread 🙂

Blessings,  
Tim Pease

PS We should have an official "Thank Matz" day. Send him money, or  
an Apple iCard, or write a Ruby program that is a haiku and actually  
parses and runs -- hmmm ... Ruby Haiku day for Matz

> **···**
>
> On 7/10/06, John Gabriele \<jmg3000@gmail.com\> wrote:

---

<div class="post-metadata">

**Author:** ![Michael\_Greenly](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Michael\_Greenly](https://rubytalk.org/u/Michael_Greenly)\
**Post date:** [11 July 2006 02:01 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/53 "2006-07-11T02:01:29Z")

</div>

James Britt wrote:

> > The significant whitespace was really the decider for me personally.
> 
> Ruby has significant white space, too. But no significant indentation  
> (or, as I tend to think of it, "static indentation.")

Next you're going to correct me for calling plum... purple?

Fine, significant indention, if that make you feel better.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Stefan\_Lang](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@Stefan\_Lang](https://rubytalk.org/u/Stefan_Lang)\
**Post date:** [11 July 2006 21:34 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/54 "2006-07-11T21:34:16Z")

</div>

Interesting. Someone there said that Python is more like Java  
and Ruby is more like Smalltalk. I've never written any  
Smalltalk, but I know some Lisp. IMO, Ruby and Python are both  
somewhere between Lisp and Java, Python closer to Java, Ruby  
closer to Lisp.

I have learned many programming languages in the last two years  
and the ones I like most are Ruby, Lisp and Haskell. There is one  
thing these three languages have in common: It's easy and natural  
to construct domain specific languages in them, allowing you  
to write code that expresses more directly the problem at hand.

Consider Rake/Rant syntax:

&nbsp;&nbsp;&nbsp;&nbsp;task :a do  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...  
&nbsp;&nbsp;&nbsp;&nbsp;end

&nbsp;&nbsp;&nbsp;&nbsp;task :b =\> :a do  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...  
&nbsp;&nbsp;&nbsp;&nbsp;end

Or a well known (in the Haskell community) DSL in Haskell  
is Parsec; an example from the Haskell wiki:

&nbsp;&nbsp;&nbsp;&nbsp;parseInput = do  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dirs \<- many dirAndSize  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eof  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return dirs

&nbsp;&nbsp;&nbsp;&nbsp;data Dir = Dir {dir\_size::Integer, dir\_name::String} deriving Show

&nbsp;&nbsp;&nbsp;&nbsp;dirAndSize = do  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size \<- many1 digit  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;spaces  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dir\_name \<- anyChar `manyTill` newline  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return (Dir (read size) dir\_name)

Of course, Lisp is \*the\* language for DSL construction.

Python, and more so Java do not allow you to construct a DSL.  
Thus in Python and Java, on the syntax level you are always  
limited to the few constructs the language provides: Defining  
classes and methods, constructing objects, calling methods,  
arithmetic expressions, branches via if/else, switch/case.  
This gets more limiting the bigger a project grows. Java people  
compensate this via huge frameworks that interpret XML files.

Ruby's design is also more coherent than Python's. One example  
where Python really f\*\*\*\*d up are properties. Python's properties  
are an ugly mess, just IMO.

If you already know Java/C#/C++, you'll gain much more in  
learning Ruby than Python.

> **···**
>
> On Tuesday 11 July 2006 17:00, jmdeschamps@gmail.com wrote:
> 
> > Doug H wrote:  
> > \> howachen@gmail.com wrote:  
> > \> \> Besides ROR, can you give me a reason why perfer ruby instead  
> > \> \> of python?  
> > \> \>  
> > \> \> seems to many users, they are very similar in nature...  
> > \> \>  
> > \> \> such as  
> > \> \>  
> > \> \> 1. non C or Java style syntax  
> > \> \> 2. focus on codes readability, not like Perl  
> > \> \> 3. ..  
> > \>  
> > \> Go ask this same question over on comp.lang.python and you'll see  
> > \> why you might prefer ruby.
> > 
> > Funny you ask:  
> > [http://groups.google.ca/group/comp.lang.python/tree/browse\_frm/thre](http://groups.google.ca/group/comp.lang.python/tree/browse_frm/thre)  
> > ad/40d8d11e12cb00ba/12306d4d9b0ce50c?rnum=11&q=ruby+or+python&\_done=  
> > %2Fgroup%2Fcomp.lang.python%2Fbrowse\_frm%2Fthread%2F40d8d11e12cb00ba  
> > %2F7256adbbc7f79afe%3Fq%3Druby+or+python%26rnum%3D1%26#doc\_74bfb0743  
> > eff1367
> 
> --  
> Stefan

---

<div class="post-metadata">

**Author:** ![Meino\_Christian\_Cra1](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Meino\_Christian\_Cra1](https://rubytalk.org/u/Meino_Christian_Cra1)\
**Post date:** [8 July 2006 16:25 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/55 "2006-07-08T16:25:51Z")

</div>

> Jamey Cribbs wrote:  
> \> James Britt wrote:  
> \>\>\> Besides ROR, can you give me a reason why perfer ruby instead of  
> \>\>\> python?  
> \>\>  
> \>\> The Ruby community is better-looking.  
> \>\>  
> \> And more modest.  
> \>  
> And more funny. 🙂

And has shorter answers. ;)))

> **···**
>
> From: Robin Stocker \<robin@nibor.org\>  
> Subject: Re: Why Ruby over Python?  
> Date: Sun, 9 Jul 2006 01:21:05 +0900
> 
> > \>\> howachen@gmail.com wrote:

---

<div class="post-metadata">

**Author:** ![M\_Edward\_Ed\_Borasky1](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@M\_Edward\_Ed\_Borasky1](https://rubytalk.org/u/M_Edward_Ed_Borasky1)\
**Post date:** [8 July 2006 19:29 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/56 "2006-07-08T19:29:20Z")

</div>

James Britt wrote:

> **···**
>
> > dblack@wobblini.net wrote:
> > 
> > > Hi --
> > > 
> > > On Sun, 9 Jul 2006, Troy Denkinger wrote:
> > > 
> > > > As a longtime Perler, I dislike Python's significant whitespace.  
> > > > That's why  
> > > > I could never go for it. Ruby just feels right to me. I enjoy  
> > > > writing it  
> > > > and it feels liberating when I do.
> > > > 
> > > > I still like Perl, but Ruby is quickly winning me over.
> > > 
> > > Let's be clear about this, though: people \*are\* allowed to like and  
> > > use more than one language 🙂 This is a point that sometimes gets  
> > > obscured in these "winner-take-all" language comparison discussions.
> > 
> > Don't be a party pooper.
> > 
> > Next thing you know, people will start thinking it's OK to like and  
> > use more than one Web framework, or more than one editor, or more than  
> > one OS.
> > 
> > And what fun would that be?
> 
> Wait a minute ... there's \*another\* OS? This changes \*everything\*!  
> --
> 
> M. Edward (Ed) Borasky
> 
> [http://linuxcapacityplanning.com](http://linuxcapacityplanning.com)

---

<div class="post-metadata">

**Author:** ![\_Stud](https://avatars.discourse-cdn.com/v4/letter/_/f05b48/32.png) [@\_Stud](https://rubytalk.org/u/_Stud)\
**Post date:** [8 July 2006 19:35 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/57 "2006-07-08T19:35:08Z")

</div>

I got into Ruby because of Rails. I like Ruby because of the  
readability, funcitonality, and object oriented approach not to mention  
the integration with Rails. Perl is great and has a bunch of  
packages/support because its been around a bit longer. I just finished  
reading David Black's book about RoR and it increased my interest in  
Ruby considerably. I guess to sum it up... less headache's \>\_\<

\_Steve

---

<div class="post-metadata">

**Author:** ![Bill\_Kelly](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@Bill\_Kelly](https://rubytalk.org/u/Bill_Kelly)\
**Post date:** [9 July 2006 04:48 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/58 "2006-07-09T04:48:20Z")

</div>

> > Ruby has significant white space, too. But no significant indentation (or, as I tend to think of it, "static indentation.")
> 
> Significant whitespace in ruby? Perhaps you mean "\n" as a statement terminator? Are there any other examples?

# ruby -we "puts ('hi')"  
-e:1: warning: (...) interpreted as grouped expression  
hi

Regards,

Bill

> **···**
>
> From: "Logan Capaldo" \<logancapaldo@gmail.com\>
> 
> > On Jul 8, 2006, at 11:21 PM, James Britt wrote:

---

<div class="post-metadata">

**Author:** ![Elliot\_Temple](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Elliot\_Temple](https://rubytalk.org/u/Elliot_Temple)\
**Post date:** [9 July 2006 05:22 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/59 "2006-07-09T05:22:12Z")

</div>

> > I love Ruby because I can do this:
> > 
> > class Integer  
> > &nbsp;&nbsp;def even?  
> > &nbsp;&nbsp;&nbsp;&nbsp;( self % 2 ) == 0  
> > &nbsp;&nbsp;end  
> > end
> > 
> > puts 3.even?  
> > puts 28.even?
> 
> I don't know if that's possible in Python, but apparently I can't guess how to do it based on a little previous Python usage:

\<snip\>

OK now I think you can't do it:

\>\>\> list.x = 5  
Traceback (most recent call last):  
&nbsp;&nbsp;&nbsp;File "\<stdin\>", line 1, in ?  
TypeError: can't set attributes of built-in/extension type 'list'

-- Elliot Temple

> **[Curiosity Blog – Elliot Temple](https://www.curi.us/blog/)**
>
> A philosophy blog

> **···**
>
> On Jul 8, 2006, at 9:49 PM, Elliot Temple wrote:
> 
> > On Jul 8, 2006, at 9:40 PM, richardun@gmail.com wrote:

---

<div class="post-metadata">

**Author:** ![Marcin\_Miel\_ynski](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@Marcin\_Miel\_ynski](https://rubytalk.org/u/Marcin_Miel_ynski)\
**Post date:** [9 July 2006 10:25 UTC](https://rubytalk.org/t/why-ruby-over-python/28762/60 "2006-07-09T10:25:05Z")

</div>

Logan Capaldo wrote:

> Significant whitespace in ruby? Perhaps you mean "\n" as a statement terminator? Are there any other examples?

"" +"".to\_s +""

which gives syntax error, not undefined +@ for String runtime error 😉

lopex

[Previous page](https://rubytalk.org/t/why-ruby-over-python/28762.md?page=2)

[Next page](https://rubytalk.org/t/why-ruby-over-python/28762.md?page=4)
