Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Why Ruby over Python?

Reply
Thread Tools

Why Ruby over Python?

 
 
howachen@gmail.com
Guest
Posts: n/a
 
      07-08-2006
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. ..

 
Reply With Quote
 
 
 
 
Lyle Johnson
Guest
Posts: n/a
 
      07-08-2006
On 7/8/06, http://www.velocityreviews.com/forums/(E-Mail Removed) <(E-Mail Removed)> wrote:

> Besides ROR, can you give me a reason why perfer ruby instead of
> python?


http://www.google.com/search?q=ruby+versus+python

 
Reply With Quote
 
 
 
 
vasudevram
Guest
Posts: n/a
 
      07-08-2006
(E-Mail Removed) 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. ..


Hi,

I'm sticking my neck out here a bit, since I'm relatively new to Ruby,
but gonna do it anyway ... :0) [I do have a good amount of experience
in other languages like Java, C, Python]. More knowledgeable Rubyists,
feel free to flame away at what I say below I know I'll learn
something from it anyway.

Reason 0: First of all, its not necessarily a matter of preferring Ruby
*over* Python. Its not an either-or situation at all - unless you want
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 believe
that myself. Dave Thomas recently spoke at a No Fluff Just Stuff
interview on this point. I heard the MP3 - it was good. Don't have the
URL right now, try Googling for keywords like +"Dave Thomas" + "NFJS"
or variants.

Reason 1: Ruby is more object-oriented than Python.

Reason 2: The Principle of Least Surprise. You can, to a good extent,
almost figure out how parts of the language / syntax work, after you've
learnt a bit of it. Read the Pickaxe and other Ruby books and the docs
to see more on what this means.
I've been writing some Ruby code and can attest to it.

Reason 3: No indentation rules like in Python. Just open the logical
construct like if or while with its corresponding keyword ("if" /
"while"), close it with "end". Though I'm an experienced developer and
a very good typist, Python's syntax rules recently almost drove me mad,
trying to track down an elusive bug that was related to indentation.
The rules of indentation themselves are straightforward enough. The
problem arises when you accidentally, say, mix spaces and tabs, or, if
you're not using tabs (which is probably better), put in one more or
less space - stuff like that. This was not the problem in my case,
since I consistently use tabs. The problem arose - I think - because I
was switching text editors (Metapad and GVim on windows) at times in a
coding session. This somehow led to the changing of some tabs to
spaces. Hard to detect visually in a Windows style editor like Metapad.
Using the ":se list" option in GVim can help, but it still takes time
to track down and change all those spaces back to tabs. One can argue
away that one should not change editors in the middle of a session,
etc., but the point is that this problem simply would not happen in
Ruby, even if you switch editors midway.

Though I like Python a lot, this is one reason why I'm moving some of
my work to Ruby.
[ I finally did manage to identify and fix the problem. ]

I'm sure you'll get some other replies, which I'll read with interest
....

HTH
Vasudev
------------------------------------------------------------------------------------------------
Vasudev Ram
Independent software consultant
http://www.geocities.com/vasudevram
PDF conversion toolkit:
http://sourceforge.net/projects/xtopdf
------------------------------------------------------------------------------------------------

 
Reply With Quote
 
dblack@wobblini.net
Guest
Posts: n/a
 
      07-08-2006
Hi --

On Sat, 8 Jul 2006, (E-Mail Removed) 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. ..


I can give you the answer in my case: love. I fell in love with the
Ruby language, and subsequently with the Ruby culture and community.
That gives you a much more lucid, rigorous account of my experience
than anything I can say about blocks, significant whitespace, or other
language features possibly could.


David

--
"To fully realize the potential of Rails, it's crucial that you take
the time to fully understand Ruby--and with "Ruby for Rails" David
has provided just what you need to help you achieve that goal."
-- DAVID HEINEMEIER HANSSON, in the foreword to RUBY FOR RAILS.
Complete foreword & sample chapters at http://www.manning.com/black!

 
Reply With Quote
 
khaines@enigo.com
Guest
Posts: n/a
 
      07-08-2006
On Sat, 8 Jul 2006 (E-Mail Removed) wrote:

> Besides ROR, can you give me a reason why perfer ruby instead of
> python?


RoR is irrelevant to it.

Ruby is love.
Python is bondage.

I choose love.


Kirk Haines

 
Reply With Quote
 
James Britt
Guest
Posts: n/a
 
      07-08-2006
(E-Mail Removed) wrote:
> Besides ROR, can you give me a reason why perfer ruby instead of
> python?


The Ruby community is better-looking.



--
James Britt

"The use of anthropomorphic terminology when dealing with
computing systems is a symptom of professional immaturity."
- Edsger W. Dijkstra

 
Reply With Quote
 
Jamey Cribbs
Guest
Posts: n/a
 
      07-08-2006
James Britt wrote:
> (E-Mail Removed) wrote:
>> Besides ROR, can you give me a reason why perfer ruby instead of
>> python?

>
> The Ruby community is better-looking.
>

And more modest.

 
Reply With Quote
 
Robin Stocker
Guest
Posts: n/a
 
      07-08-2006
Jamey Cribbs wrote:
> James Britt wrote:
>> (E-Mail Removed) 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.

 
Reply With Quote
 
M. Edward (Ed) Borasky
Guest
Posts: n/a
 
      07-08-2006
vasudevram wrote:
> Hi,
>
> I'm sticking my neck out here a bit, since I'm relatively new to Ruby,
> but gonna do it anyway ... :0) [I do have a good amount of experience
> in other languages like Java, C, Python]. More knowledgeable Rubyists,
> feel free to flame away at what I say below I know I'll learn
> something from it anyway.
>

Not so much flames as challenges ...
> Reason 0: First of all, its not necessarily a matter of preferring Ruby
> *over* Python. Its not an either-or situation at all - unless you want
> 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.

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.

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.

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

One of the things that's attractive to me about Ruby is that it contains
features from most of the six. I haven't found much of APL or Forth, but
there are clearly influences from Algol, Lisp, Smalltalk and macro
assembler.
> Reason 1: Ruby is more object-oriented than Python.
>

Well ... Ruby objects were there from day one, and they resemble
"classical" object concepts like those in Smalltalk, C++ and Java, but I
don't think *today's* Python is "less object-oriented" than *today's*
Ruby, nor do I think Ruby is "more object-oriented" than R, Lisp or Scheme.
> Reason 2: The Principle of Least Surprise. You can, to a good extent,
> almost figure out how parts of the language / syntax work, after you've
> learnt a bit of it. Read the Pickaxe and other Ruby books and the docs
> to see more on what this means.
> I've been writing some Ruby code and can attest to it.
>

I haven't found Ruby code all that obvious to a newcomer. I've been
programming a long time, and I have a programming style that evolved
from macro assembler to FORTRAN to Perl to R, with influences from Lisp,
FORTH and Java.

Part of it is that I'm very much more familiar and comfortable with
functional programming than I am with object-oriented programming. In my
younger days, I was actually one of those people who went around on long
tirades declaiming that Functional Programming was the one true way.
I thought pure functional languages had a lot going for them. I still do.

I spent about three hours last night trying to understand Hal Fulton's
well-crafted example of metaprogramming that reads CSV files. I know it
will make sense to me eventually, but it didn't after three hours. I
know it's "good code", I know it's "elegant code", I know it's an
example of the wonders of Ruby, and I know it works. But I still don't
know why.
> Reason 3: No indentation rules like in Python. Just open the logical
> construct like if or while with its corresponding keyword ("if" /
> "while"), close it with "end". Though I'm an experienced developer and
> a very good typist, Python's syntax rules recently almost drove me mad,
> trying to track down an elusive bug that was related to indentation.
> The rules of indentation themselves are straightforward enough. The
> problem arises when you accidentally, say, mix spaces and tabs, or, if
> you're not using tabs (which is probably better), put in one more or
> less space - stuff like that. This was not the problem in my case,
> since I consistently use tabs. The problem arose - I think - because I
> was switching text editors (Metapad and GVim on windows) at times in a
> coding session. This somehow led to the changing of some tabs to
> spaces. Hard to detect visually in a Windows style editor like Metapad.
> Using the ":se list" option in GVim can help, but it still takes time
> to track down and change all those spaces back to tabs. One can argue
> away that one should not change editors in the middle of a session,
> etc., but the point is that this problem simply would not happen in
> Ruby, even if you switch editors midway.
>

Well ... there are language-specific IDEs for Python. If I were
planning/required to learn Python, I'd probably use Leo. I've got Leo
and if I can get it integrated with the languages I do use, Perl, R and
Ruby, I'll give it a shot. And there are language-specific IDEs for
Ruby. But don't *real* programmers use Emacs?

<ducking>

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


 
Reply With Quote
 
Doug H
Guest
Posts: n/a
 
      07-08-2006

(E-Mail Removed) 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VOIP over VPN over TCP over WAP over 3G Theo Markettos UK VOIP 2 02-14-2008 03:27 PM
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
#!/usr/bin/ruby , #!/usr/bin/ruby -w , #!/usr/bin/ruby -T?, #!/usr/bin/ruby -T1... anne001 Ruby 1 04-23-2006 03:02 PM
Why does split operate over multiple lines in the absence of "ms" ? And why doesn't $_ work with split? Sara Perl Misc 6 04-12-2004 09:07 AM



Advertisments