From: Juan Zanos Date: 2009-02-19T00:26:20+09:00 Subject: Re: What are your favorite Ruby features? On 18 févr. 09, at 10:04, David A. Black wrote: > This message is in MIME format. The first part should be > readable text, > while the remaining parts are likely unreadable without MIME- > aware tools. > Hi -- > > On Wed, 18 Feb 2009, Juan Zanos wrote: > >> >> On 18 févr. 09, at 09:07, Robert Dober wrote: >> >>> On Wed, Feb 18, 2009 at 2:38 PM, Rick DeNatale >>> wrote: >>>> On Tue, Feb 17, 2009 at 2:40 PM, David Masover >>>> wrote: >>>> def foo bar >>> That is very hard to read indeed, but why? >>> def foo( bar ) >>> This is not so much better! >>> We are all totally accustomed to the fact that foos and bars >>> designate >>> the same kind of thing. >>> I therefore think that >>> def fact n >>> is more readable for most people than >>> def n( fact ) >>> which is nonsense of course (in the particular context). >>> Naming seems more important than params or not params (of course >>> if I >>> might say?). >> >> Good point. Syntax isn't all there is to readability. But it >> does have some effect. >> >> In this case the parenthesis don't make anything inherently more >> readable and aren't helpful in resolving the nonsense names. The >> parenthesis are only meaningful if you already know what they >> mean. Readability arguments are often tainted by experience with >> previous languages. And it must be remembered that no programmer >> is born knowing a previous programming language. If we insist, >> implicitly or otherwise, that readability means that something >> looks like 'C' or Java or any other language then we place limits >> on how much we can simplify syntax. I'd actually say that each >> example with parenthesis requires a lot more explanation of why >> they are their, what they mean, what are the syntax rules that >> govern them, etc. > > I agree (except for your last sentence). I honestly don't give C or > Java (or Lisp, etc.) a moment's thought in any of this, when I'm > writing Ruby. Just Ruby. > > One thing I've had to come to terms with, reluctantly (because it > would be so nice if it were otherwise), is that there is literally no > such thing as inherent readability. Readability simply does not inhere > in the notation, any more than it does in a given alphabet. Ok. We don't have to agree completely. We both seem to agree that there are arbitrary aspects to syntax conventions that do not inherently affect readability. Perhaps where we disagree is that I do believe something can be inherently more or less readable and you do not. I believe that overly complicated syntax becomes less readable and even more unwritable. So I tend to prefer a simpler syntax even if it's slightly different from a particular convention. Cheers, Juan