Ian Bicking: the old part of his blog

Re: Ruby Meetup

I've been playing with Ruby (and Rails) a fair bit over the past couple of months, and one thing that took me a while to understand was the importance of being able to leave out parentheses on method calls. Initially, I found that ability pretty disgusting (I imagine in the same way that people new to Python are put off by the forced indentation) but I've begun to realise that it's one of the key features in making Rails so pleasant to use. The loose syntax actively encourages the creation of domain specific mini-languages, which is exactly what Rails is when you come down to it. It may seem like a small thing, but it's the small things that make all the difference.

I'm not saying Python should introduce this kind of loose syntax - in fact I'd argue against it, as one of Python's main strengths is its clarity and uniformity. It does make for a very interesting aspect of Ruby as a language though.

Comment on Ruby Meetup
by Simon Willison


simon says "The loose syntax actively encourages the creation of domain specific mini-languages"

I think this is one of the problems that makes reading Rails source code hard for me. Variables appear magically with no indication of where they are from, as if they were just another keyword. I'm easily lost without the use of explicit namespaces and imports that Python provides. All of the RoR code I've looked at doesn't do this, and it seems unpleasant to use. There's no accounting for taste though...

# John P. Speno

I think Ruby's calling syntax makes the distinction between variables and methods much more casual. Of course, that goes as far as having no public instance variables, just methods, but it looks the same as methods anyway. The equivalent in Python is actually less explicit, because the name embodies the privacy (leading underscores) and it tends to be casual what is public and what is not. You can always fix things up later with property, but I seldom do that.

# Ian Bicking

# Todd G