Ruby and Python, questions (not a flamewar!)

D

Damian Terentyev

Good day!
First, let me apologise for some Japanese nationalism and Ruby=20
fanaticism, and do not be offended if I say something inappropriate.

Well, Ruby was written by a /person/, not a culture, and it's largely=20=
a tasteful amalgam of good ideas introduced in those old "Western"=20
languages. I'd be interested to hear what you (or anyone else) thinks=20=
is distinctively non-Western about Ruby, as opposed to C or Lisp or=20
Smalltalk.

It is worth noting that a person who created Ruby have originated from=20=

a distinct (Japanese) culture. And one of the key characteristics of=20
Japanese culture is its openness for adoption of other cultures. Many=20
great pieces of Japanese culture were taken from others and then=20
transformed by adding subtle differences, thus making them (IMHO)=20
perfect. Think about Zen Buddhism (a philosophy that came from China),=20=

or quality control (curiously, an American idea that originally didn't=20=

get support in the US and had to be adopted later from Japanese) =E2=80=94=
the=20
trend is obvious.
And I don't think it would be an exaggeration to see something similar=20=

in Ruby design. All Ruby's features were widely known and used in a=20
whole bunch of high-level languages, but it took a Japanese to unite=20
them together in such subtly unique way that was Ruby, and the result=20
was a (IMHO) perfect language.
Python has similar capabilities (and is even a little more advanced if=20=

we speak about Unicode support, and more mature if we speak about many=20=

third-party libraries available), but it doesn't make programming fun=20
as Ruby claims, and in fact, does. It is those small subtleties that=20
make this possible. The ability to write [1,2,3].length and=20
[1,2,3].size as it pleases you, those funny blocks instead of dull=20
for-loops or clumsy lambdas, optional use of parentheses =E2=80=94=C2=A0al=
l this=20
makes writing programs more natural and pleasant.

1. print is a statement in Python 2 and I can imagine no programmer who=20=

deliberately chooses to write print("boo") instead of just print "boo".=20=

And in Python 3 it's going to become a function so that only the former=20=

syntax will be correct. They say, to make it more readable. I don't=20
think lots of parentheses and brackets improve readability.
2. indentation eliminates multiple "end" clauses but makes pure python=20=

virtually unacceptable for use as a templating language. And again, I'm=20=

not sure that

if boo:
doo()

is more readable than simple "doo if boo"
3. can't understand why only in recent 2.5 Python became to agree with=20=

both "except" and "finally" clauses in exception handling.

These are the examples of constraints that Python puts on programmer's=20=

mind. They are not severe, but a creative mind searching for a solution=20=

doesn't want any limits at all! Ruby really gets out of your way when=20
you create programs. And maybe it is that freedom that makes=20
programming Ruby fun. And that's why there couldn't exist such thing as=20=

Python on Rails. Ruby attracts programmers that want to freely=20
experience their thoughts and have fun =E2=80=94 and this is why it =
yields such=20
original and convenient products.

An answer to the OP's questions =E2=80=94 why Ruby is not as wide-spread =
as=20
Python =E2=80=94 lies in two domains:

1. Aforementioned language barrier and Ruby's youn age in general.

2. Ruby's flexible syntax gives too much freedom =E2=80=94 and this may =
drive=20
away some less creative programmers that need something solid under=20
their feet. When you first com to Ruby you may become overwhelmed with=20=

all that freedom and panic :)

Thanks for your attention.

Your sincerely,
Damian/Three-eyed Fish=
 
P

Paddy3118

Drew said:
I've been using ruby for the past 6 months and I must say I am extremely
impressed. I find it a joy to write and I even find myself making
excuses to throw together simple scripts at work. I'm also teaching
myself rails and enjoying the experience as well.

At the same time, I'm looking at Python because I think it's also an
important language to know/understand today. However, the more I look at
Python the more I am convinced that ruby is just better. Syntax-wise,
language vision, design philosophy, I like them all from the ruby side
better.

So, I am kind of confused as to why Python is so mainstream and ruby
still seems so fringe. Apps like YouTube are written in Python and
powerful organizations like NASA, Google, etc. are using Python as well.
So basically, here are my questions:
Hi Drew,
Maybe your confusion on Python''s status is linked to your belief that
because Ruby is 'better' for you then it must be better than Python for
everyone?

- Paddy - A Pythonista who learned Python before Ruby, has seen no
compelling reason to switch, and would be more interested in getting
Python/Perl/Ruby/TCL/C#/Java to more seamlessly interoperate. Easy
access to modules written in any script, Yea!
 

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,982
Messages
2,570,190
Members
46,738
Latest member
TiffinyHol

Latest Threads

Top