Python vs Ruby

P

Premshree Pillai

Well, I'm inclined to blame "LAMP".

People are encouraged to use suboptimal tools for a task simply because
the tool name fits a snappy acronym.

If matz had only picked a name that began with "P", rather than "R" ...

Heh, once one of my friends called me a LAMeR. :D
 
D

Dick Davies

* tony summerfelt said:
and i think perl6 is going to be very wronger...i wish larry wall
would stop listening to the python complains about perl...they aren't
gonna use perl6 anyway...and from the sounds of it a lot of current
perl programmers won't either...

the perl oo always felt tacked on to me...most of the perl code i
write is perl4 anyway...


they make sense to a perl programmer :)

*A* perl programmer, yes.

Trouble is, it usually doesn't make as much sense to all the other perl
programmers. Or the same programmer in nine months time.

I quite liked perl until I stayed in the same job for more than 2 years,
and had to maintain those scripts I threw at the interpreter when they
stuck.

I've found ruby is more productive in the short term, so I get to spend
some time building maintenance into the script and save time in the long
term too.
 
P

Premshree Pillai

and i think perl6 is going to be very wronger...i wish larry wall
would stop listening to the python complains about perl...they aren't
gonna use perl6 anyway...and from the sounds of it a lot of current
perl programmers won't either...

the perl oo always felt tacked on to me...most of the perl code i
write is perl4 anyway...

Perl OO is terrible, but things are better with Perl 6.
 
Z

Zach Dennis

Premshree said:
Heh, once one of my friends called me a LAMeR. :D

That's pretty funny. =) Well if you drop the 'L' you can get:

RAM

Ruby, Apache, MySQL

And now you have a larger target audience of both Linux users, Windows
users, and those Mac folk to!

And if you like the naming convention of the Auto Industry you could do a:

RAM oLXW

Ruby, Apache, MySQL on Linux/OS X/Windows


Zach
 
J

Jim Weirich

James Britt said:
benjamin.ferrari wrote:
...
16:20:18-ferrari@herrober:~$ python
Python 2.3.3 (#1, May 18 2004, 19:29:58)
[GCC 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import this

The Zen of Python, by Tim Peters
...
Although that way may not be obvious at first unless you're Dutch.


"It also makes sense if you grew up Pennsylvania Dutch [...]"

Bruce Eckle, commenting on the readability of a given Ruby example.

http://onthethought.blogspot.com/2005/01/thinking-in-ruby-not.html

It all makes sense now. Although I, myself, do not speak Pennsylvania
Dutch (my father does), I grew up in a community of Amish and am very used
to the "backwards" style of English spoken there. Could this be the
reason I find Ruby so attractive.

BTW, Guido's Dutch and Pennsylvania Dutch are not related at all.
Pennsylvania Dutch is a (somewhat distant) dialect of German (Deutsch).
 
A

Alan Garrison

Zach said:
That's pretty funny. =) Well if you drop the 'L' you can get:

RAM

Ruby, Apache, MySQL

And now you have a larger target audience of both Linux users, Windows
users, and those Mac folk to!


RAP = Ruby + Apache + PostgreSQL? ;) Though various people's tastes in
music may lean against this.

/mysql makes my head hurt
 
G

gabriele renzi

Alan Garrison ha scritto:
RAP = Ruby + Apache + PostgreSQL? ;) Though various people's tastes in
music may lean against this.

I'm always been a fan of the FRAP acronym (freebsd ruby apache pgsql)
 
Z

Zach Dennis

Alan said:
RAP = Ruby + Apache + PostgreSQL? ;) Though various people's tastes in
music may lean against this.

/mysql makes my head hurt

How abuot we join forces and give the user the option:

RAMP or RAM/P

Zach
 
S

Stephen Kellett

Alan Garrison said:
RAP = Ruby + Apache + PostgreSQL? ;) Though various people's tastes
in music may lean against this.

Yeah, I'm trying to think of a tool beginning with 'C' that can go on
the front :)
 
M

Michael DeHaan

A few things to think about for those that worry about popularity.

(1) One learns a language because one learns something from learning
a language, not because the language is immediately the
end-all-beat-all. I still want to play with O'Caml and Haskell, and
I doubt I'll ever use them "for work".

(2) If we must chose what is widely adopted, we would always use Java
for every project -- or we might be stuck on Cobol. This is not the
case, as one can always choose the right tool for the job. That tool
is probably not Ruby in 1/2 the cases out there, but that doesn't
lessen Ruby's value. To mix metaphors, some people are always
looking for hammers in their toolbox, or sometimes swiss army knives.
Sometimes you need a torque wrench. It depends. Knowing "more"
can never hurt.

(3) However it is very clear that languages can grow in popularity
from the bottom up. Use a little Ruby on a special homebrew project,
use it on some build machines at work, and pretty soon you've
converted 1 or more new people to Ruby. Nothing wrong with that.
Ruby adoption levels do not prevent you from using it.

(4) Ruby popularity isn't as small as one might think. I have the
Python list and the Ruby list side-by-side in GMail right now, and the
Ruby list is 80% as active as the Python list. Not bad!

I really don't think Python-fans are wrong in the least. It's a
decent language, and some of the decisions such as playing down lambda
and the blocks type approach means solutions are developed differently
-- but that doesn't make them wrong. I like list comprehensions,
for instance.

If you can grok the "C" and kernel development mindsets, a lot of this
makes sense. Simplicity and obviousness mean a lack of cleverness at
face value, but they are very practical, straight forward, and easy to
understand for the most part. Those goals aren't all bad.
Personally, I'm looking for convergence, not distance between the
languages.
 
S

Stephen Kellett

tony summerfelt said:
when i mentioned that ruby might be easier to embed into a C program
than python is, the response was 'BS'. keeping in mind that i've done
both but the python person hadn't.

I've done both. They are about the same level of difficulty(*), I found
the Python experience slightly easier - but thats down to better docs on
the Python side.

That said the recent Python 2.4 release on Windows will cause many
people linking dynamically to the CRT a lot of trouble (you built your
app with Python 2.2 or 2.3 and linked to the Visual C++ 6 runtime - when
you run with Python 2.4 you pass in a FILE * to a Python function and it
blows up because Python 2.4 is using the Visual C++ 7.1 runtime - that
is a really nasty bug that is not at all obvious in its cause - and the
fix to work in all scenarios (where you can't control which CRT will be
used) is not trivial or for the average developer as it requires some
mucking about to determine which CRT has been used prior to obtaining
the FILE *).

(*) Neither is sufficiently harder than the other to warrant a "mine's
better than yours" argument over language features.

Stephen
 
P

Premshree Pillai

A few things to think about for those that worry about popularity.

(1) One learns a language because one learns something from learning
a language, not because the language is immediately the
end-all-beat-all. I still want to play with O'Caml and Haskell, and
I doubt I'll ever use them "for work".

This is true for some folks; I wonder that's the case for a majority:
a lot of folks learn languages not necessarily because they are going
to use it; unfortunately, though, that lot, I suspect, is much lesser
than the other lot.

I use a lot of Ruby for my own projects, but _cannot_ use it for work.
Why? Because my colleagues don't know about it.
(2) If we must chose what is widely adopted, we would always use Java
for every project -- or we might be stuck on Cobol. This is not the
case, as one can always choose the right tool for the job. That tool
is probably not Ruby in 1/2 the cases out there, but that doesn't
lessen Ruby's value. To mix metaphors, some people are always
looking for hammers in their toolbox, or sometimes swiss army knives.
Sometimes you need a torque wrench. It depends. Knowing "more"
can never hurt.

(3) However it is very clear that languages can grow in popularity
from the bottom up. Use a little Ruby on a special homebrew project,
use it on some build machines at work, and pretty soon you've

The whole point about educating people about Ruby is that people know
the _existence_ of the language. People can then make an informed
choice. Ideally, every programmer in the world should be made aware of
Ruby; and that probably is what evangelizers should set as their goal.
converted 1 or more new people to Ruby. Nothing wrong with that.
Ruby adoption levels do not prevent you from using it.

(4) Ruby popularity isn't as small as one might think. I have the
Python list and the Ruby list side-by-side in GMail right now, and the
Ruby list is 80% as active as the Python list. Not bad!

Same here. But generally I've observed around 60% activity as the Python list.
 
T

tony summerfelt

Trouble is, it usually doesn't make as much sense to all the other perl
programmers.

that's been an argument used against perl for a long time. i think
it's a myth...people have posted some pretty horrendous code in the
perl newsgroup and other perl programmers had no trouble reading it...
but people who didn't program in perl coudln't...i see a connection
there...
Or the same programmer in nine months time.

i have some toothpick code i wrote ten years ago...i can still read
it...and i'm willing to bet any other perl programmer can also...

i can crank out working code the quickest in perl, then tcl...i'm
hoping to get my ruby up to speed also...
http://home.cogeco.ca/~tsummerfelt1
telnet://ventedspleen.dyndns.org
 
T

tony summerfelt

(*) Neither is sufficiently harder than the other to warrant a "mine's
better than yours" argument over language features.

i also mention that lua WAS easier, but got the same reaction...

either way, my experience with the python community was less than
pleasant...this was before i started flaming them on a regular
basis :)

i've had excellent contact here and in the tcl group though and that's
more than made up for it...
http://home.cogeco.ca/~tsummerfelt1
telnet://ventedspleen.dyndns.org
 
M

Mohammad Khan

A few things to think about for those that worry about popularity.

(1) One learns a language because one learns something from learning
a language, not because the language is immediately the
end-all-beat-all. I still want to play with O'Caml and Haskell, and
I doubt I'll ever use them "for work".

Play with them as long as you want !

I can bet you will use them in work, once you will find they are better
than your current one. Or, someday you will find yourself that you are
not playing with them anymore because its worthless.
 
D

Douglas Livingstone

doesn't seem to be very supported at all like Python.
I don't understand "supported".

I think he means supported by hosts etc, though that is changing too I think.

Douglas
 
J

Jimmie Houchin

Please count me out as a serious programmer, then. I care deeply about
the aesthetics of Ruby. I derive great joy from writing beautiful
programs. Ruby let's me write the most beautiful programs I've ever
done. Ergo, Ruby makes me happy.

I couldn't think of a higher praise to bestow upon a programming
language.

I agree, beauty is a tremendous asset of a language.

Pleasure in the reading and writing of the code must most definitely have some
postive impact on the productivity of the programmer.

Even in the thread you reply to it has a comment from Tim Peters on Python:

http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/125873
Beautiful is better than ugly.


Erlang programmers like beautiful code also.
I believe they qualify for "serious" programmers also.

Joe Armstrong says in a message on the Erlang list:
http://www.erlang.org/ml-archive/erlang-questions/200301/msg00260.html

"""I never said "write dumb code" - to me beautiful code is clear,
"""concise and does *exactly* what it is supposed to and *nothing* else
"""with a minuimum of fuss. It usually ends up being faster than ugly
"""code - that's because God likes your code if it's beautiful.
"""
"""Think of code as an exercise in applied poetry - rather like Haiku
"""only more difficult - now writing Haiku Erlang functions *that* would
"""be difficult


And in another message by Chris Pressey:
http://www.erlang.org/ml-archive/erlang-questions/200303/msg00508.html

"""Plenty are the languages with which you can crank out code,
"""and plenty are the languages with which you can write beautiful code.
"""Rare is the language with which you can crank out beautiful code...

It sounds like David thinks that Ruby is just such a language.
By David's performance, I would have to agree. :)


And one last quote from Joe Armstrong:
http://www.erlang.org/ml-archive/erlang-questions/200202/msg00031.html

"""Given the choice you should always choose beauty over efficiency -
"""It will probably turn out the that the beautiful solution will be
"""fast enough anyway.
"""
"""It is, after all, easy to make an incorrect program run arbitrarly fast
"""
"""If, and it can happen, the final beautiful program is too slow
"""then you will be in a good position to optimise the algorithm
"""since it should at least be clear what the thing is supposed to do
"""and you will have a good set of test cases to test your
"""efficient version on.

I am slowly working my way through the PickAxe II book and am enjoying it and
what I see.

I am very glad a post on c.l.python spurred me on to explore Rails and thus
Ruby. :)

I like what I have found.

Jimmie Houchin
 
D

Douglas Livingstone

IMHO the different syntax shouldn't be an argument for a "serious"
Please count me out as a serious programmer, then. I care deeply about
the aesthetics of Ruby.

Well... he did put it in quotes. I think what he means by "serious" is
someone who writes code simply to get a job done - nothing more.
"Serious" is the wrong word, it implies that people who cares about
more than the functionality are not "serious", which is BS. I find
that people who care what their code looks like end up caring more
about the functionality and how that functionality is used/accessed in
the long run than people who only care about the inital "working"
state. (For me, a good programmer will be able to work in both modes:
a problem may recieve an "ugly" solution to start with, but over time
that would be refactored into "nice" code. If it wasn't, then the ugly
code would more than likely build up and choke the applicatin into a
ground up rewrite, much like fat deposits building up in arteries.)

Douglas
 
D

Dick Davies

* Douglas Livingstone said:
.... (For me, a good programmer will be able to work in both modes:
a problem may recieve an "ugly" solution to start with, but over time
that would be refactored into "nice" code. If it wasn't, then the ugly
code would more than likely build up and choke the applicatin into a
ground up rewrite, much like fat deposits building up in arteries.)

That's the gist of what i was trying to say earlier about my perl experience

* I write a small script in perl
(because I don't have time to run an advocacy campaign and train all
the other guys in ruby. they're all too busy to sit through a rant.)
I swear a bit through all the $ and for loops but it's fairly painless.
* it gets cobbled up into a working prototype
* we trial it
* it ends up being a production script because too many people find out about it
* someone asks for a feature, I bolt it on
* repeat the last step a few times
(some stuff breaks due to my testing being 'that looks alright')
* it passes some kind of critical mass where I want to refactor the whole shambles
* I find it incredibly hard to do and wish I'd bitten the bullet and used ruby to start with

the last point is a consequence of perls shitty oop mainly - I find it nigh on
impossible to do effective unit testing in perl, and it encourages bodging.
At least with ruby my quick and dirty hacks are hidden away behind a method
and testable, lifes' too short to grit your teeth through all the $self->method($thing);
rubbish.

(admittedly the perl version has a test suite - or 'the university'
as I call it. The phone rings instead of the bar going red.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top