Skip to content

Comment on Ruby's not ready

Comments

Everything appears to be a matter of taste:

Ruby has two range operators, .. and .... Why? The only difference is that the shorter one, with two periods, returns a longer range, and the longer one returns a shorter range, not including the endpoint. Can this possibly get any more confusing? 2 The language should have one, not two. It is not hard to add or subtract one when you want a range with, or without, its endpoints.

I like the shortcut. Then again, I like the English language. I like the fact that you can express things in a myriad of (yes, you can say "myriad of") different ways depending on how you want to express them.

A Pythonista friend of mine once complained over the simple fact that Ruby had so many ways to express a conditional but none as elegant as what was used in Python.

Python:

- if foo: bar()

Ruby:

- if foo then bar end

- if foo; bar end

- if foo: bar end # deprecated

- foo if bar

- foo && bar

- foo unless !bar

I love the diversity, however. Really, the first thing that sticks out to me with Python are those superfluous parentheses. Taste, taste, taste.

Its funny someone once wrote that Rails should have been written in Python - his main argument was that Ruby gives you so many ways to do things but Python tends to pick "a" way. The Rails framework tends to follow this Python like mentality of Picking a particular way.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.