Python vs. Ruby

Started by
6 comments, last by Andrew Nguyen 22 years, 3 months ago
Python vs. Ruby I was just wondering, what scripting language got''s what it takes to become a mainstream language (and possibally machine compiled)?
---START GEEK CODE BLOCK---GCS/M/S dpu s:+ a---- C++ UL(+) P(++) L+(+) E--- W++ N+ o K w(--) !O !M !V PS- PE+Y+ PGP+ t 5 X-- R tv+ b+ DI+ D G e* h! r-- !x ---END GEEK CODE BLOCK---
Advertisement
Ruby.

As with all opinions, I''m largely prejudiced in favor of my choice due to its syntactic similarity to languages I already use and like (particularly C++). I dislike any language that imposes a typographic style, and many other programmers do too (it''s one of those religious issues).

However, Ruby has certain features that many find irritating, and still lacks decent English language documentation. It also doesn''t have the support and popularity of Python (largely for the same reason). And we all know that best design doesn''t always win *cough* Windows *cough*

As always, in the final analysis the answer is "Pick One." It hardly matters.

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!
Bruce Eckel has some thoughts on the issue: http://www.mindview.net/Etc/FAQ.html#Ruby.

As for Python enforcing a typographic style - When you don''t have any block delimiters, theres pretty much only one way of indenting anyway. Most of the religious discussions are about where to put the block delimiter.

(I don''t know much about Ruby, so I dont necessarily agree with Eckel''s opinions)

Fantastic doctrines (like Christianity or Islam or Marxism or Microsoft-bashing) require unanimity of belief. One dissenter casts doubt on the creed of millions. Thus the fear and hate; thus the torture chamber, the iron stake, the gallows, the labor camp, the psychiatric ward - Edward Abbey
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
quote:Original post by Arild Fines
As for Python enforcing a typographic style - When you don''t have any block delimiters, theres pretty much only one way of indenting anyway.

Precisely. We (the anti-indentation zealots) resent the lack of block delimiters and consider it an exercise in absolute idiocy per language design.

Oh, it may make things all nice and neat, but it forces severely nested loops with long statements to trail off the end of the page - ugly to read, ugly to print. It feels like a throwback to FORTRAN''s 80-character limit, with statements beginning in column 13, etc. Or Visual Basic *ducks ensuing flamewar*

Fantastic doctrines (like Christianity or Islam or Marxism or Microsoft-bashing or choosing Perl over Python or Ruby or even the mythical Perl-Python hybrid, Parrot) require unanimity of belief. And so forth.

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!
I still dont get it. You say that you prefer not to use indentation at all? Eg you nest like this:
  if ( bleh ){if( blah ){for(int i = 0; i < blogh; i++)blaghBlagh();}else{bleahBlagh();}}   


quote:
it forces severely nested loops with long statements to trail off the end of the page

Dont see that one either - Python only enforces that indentation of a nested block must be more indented than the containing block, and that indentation within a single block must be consisten. Eg, you can have a nested block indented by a single space if you absolutely want to.
Python also does have several language constructs that makes heavy nesting(a Bad Thing) easy to avoid(list comprehensions, lambda functions etc...)

(Note that I'm not arguing the merits of Ruby vs Python here - as I stated earlier I know next to nothing about Ruby and while slagging/praising things one doesnt know seems to be a popular pasttime on these forums, its not something I participate in.)



Fantastic doctrines (like Christianity or Islam or Marxism or Microsoft-bashing) require unanimity of belief. One dissenter casts doubt on the creed of millions. Thus the fear and hate; thus the torture chamber, the iron stake, the gallows, the labor camp, the psychiatric ward - Edward Abbey

Edited by - Arild Fines on January 1, 2002 12:56:58 PM
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
quote:Original post by Oluseyi
Oh, it may make things all nice and neat, but it forces severely nested loops with long statements to trail off the end of the page - ugly to read, ugly to print. It feels like a throwback to FORTRAN''s 80-character limit, with statements beginning in column 13, etc. Or Visual Basic *ducks ensuing flamewar*

You know the counter-arguement is that any code that runs off page due to indentation is $&!# and needs to be refactored anyway
It is annoying to have the IDE enforce a look to the code though.

quote:
I was just wondering, what scripting language got''s what it takes to become a mainstream language (and possibally machine compiled)?

Both are fairly popular for such new languages, though I think Python has the lead. JIT is probably in thier future rather than static compilation.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Python''s been around for at least 10 years - its hardly a new language.

Fantastic doctrines (like Christianity or Islam or Marxism or Microsoft-bashing) require unanimity of belief. One dissenter casts doubt on the creed of millions. Thus the fear and hate; thus the torture chamber, the iron stake, the gallows, the labor camp, the psychiatric ward - Edward Abbey
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
quote:Original post by Arild Fines
I still dont get it. You say that you prefer not to use indentation at all?

No, I prefer to use indentation if and when I feel like it.

quote:Python also does have several language constructs that makes heavy nesting(a Bad Thing) easy to avoid(list comprehensions, lambda functions etc...)

Just as you are not arguing the merits of Python over Ruby, neither am I arguing the merits of any other language over Python. I''m just nitpicking.

Magmai: I hear you.

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!

This topic is closed to new replies.

Advertisement