On Tue, Jun 12, 2007 at 07:59:10PM +0900, dblack / wobblini.net wrote:
> On Tue, 12 Jun 2007, Anthony Martinez wrote:
> >On Tue, Jun 12, 2007 at 03:10:49AM +0900, Bas van Gils wrote:
> 
> >Parens can be omitted if it doesn't confuse the parser (or the reader)
> 
> Can be, but it's best not to get too cutesy with it :-)  In
> particular, please have mercy and don't leave the parens out in method
> signatures.  Things like this:
> 
>   def a b, c, d = 1
> 
> read very strangely, at least to my eyes.

It reads a little like OCaml to me -- which is pretty strange, in the
context of a Ruby program.  I tend to like a syntax that remains constant
across the language (which is one of the reasons I expect to find
IronRuby to be rather disconcerting in practice, once it's finalized, and
one of the reasons I tend to avoid .NET variants of languages in
general).


> 
> >As well, reserve the { } form of blocks to one-liners.
> 
> That's going to depend partly on whether you run across the
> (relatively rare) case where the precedence difference between {} and
> do/end actually matters.  There are also some interesting ideas on
> record (see archives) involving blocks with side effects vs. blocks
> that just calculate.  But I can't remember which is supposed to be
> which :-)

I have yet to see a practical case where the precedence actually came
into play -- and I suspect that, when I do finally see such a thing,
readability would benefit from a refactor so that it doesn't come into
play after all.


> 
> >Then again, these are highly subjective views, ones that I've absorbed
> >from reading other people's ruby and getting into arguments with friends
> >:)  Take them with a grain of salt, as I'm not a Ruby expert and thus I
> >might be wrong.
> 
> Reading Ruby code, in particular the Ruby source code itself, is a
> great way to see the traditional style.  I've never seen anyone
> improve on that style.  People get very excited about the fact that
> Ruby lets you "do your own thing" in terms of style -- like:
> 
>   printf( "My name is %s\n", thisPerson.name() );
> 
> and such... but if most Ruby were written like that I think I would
> have put the Pickaxe back on the shelf at the bookstore :-)

I like the flexibility of the language.  I also like the canonical style.

In other words, I think I agree.

-- 
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
Ben Franklin: "As we enjoy great Advantages from the Inventions of others
we should be glad of an Opportunity to serve others by any Invention of
ours, and this we should do freely and generously."