Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
"Readability" inflation
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 69 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David A. Black  
View profile  
 More options Oct 28 2005, 12:10 pm
Newsgroups: comp.lang.ruby
From: "David A. Black" <dbl...@wobblini.net>
Date: Sat, 29 Oct 2005 01:10:21 +0900
Local: Fri, Oct 28 2005 12:10 pm
Subject: "Readability" inflation
Hi --

I'm writing this separately from any thread partly because it's a new
topic, and partly because I don't want to appear to be pouncing on any
particular post or person.  If anything, I'm pouncing on several of
each :-)  But really I'm just puzzling things through.

Over the years and, I think, particularly in recent months, there's
been a ton of suggestions for changing Ruby syntax.  The majority
involve adding new semantics through new punctuation.  Most of the
rest involve some kind of distillation of existing syntax into
something smaller.

Thus we've see talk of:

   lambda -> () {}
   ary.every.capitalize
   def some_method(:a: :b:,; c::d=:e => f) :-)

and so forth.

Ruby has always "sold itself" to programmers in large part because it
looks so good and, in the eyes of many, many people, successfully
balances expressiveness with clarity.  "Readability" is not an
absolute -- but the empirical evidence suggests that a lot of people
experience Ruby as very readable.

I'm certainly convinced that if even a few of the punctuation and/or
condensation things happen to the syntax, Ruby's reputation for
readability will decline rapidly and permanently.  I may be wrong, but
my belief and working hypothesis is that the "readability margin" is
quite narrow and easily erased.

That leaves me wondering why all these suggestions keep arising.

I think what's happening is that people who've used Ruby for a while
get used to it, and then they sort of shift their readability
threshold.  In other words, if you've seen this:

   a.map {|b| b.meth }

for several years, then even though it looked beautiful and concise
and transparent to you at first, it will start to look verbose and
syntactically inefficient.  So then you might want to have:

   a.every.meth {|b| (or implicit var, or whatever) }

Similarly, if you're used to:

   f = lambda {|a,b| ... }

then after a while, you might find that so natural that you feel
"ready" for

   f = lambda -> (a,b) { ... }

And yet... if you had encountered the latter version first, you would
never have had the feeling of balance and cleanness that you got (or
at least I did) from the former version.

So I think there's a kind of readability inflation going on: people
who are acclimatized to Ruby start feeling comfortable about going to
the "next" level of line-noise and/or compactness.

I'd like to sound a note of caution about this.  I think it has the
potential to disserve Ruby's interests, by moving the language away
from the thing that has been proven to be so attractive.

I've never been big on the idea of adding features to Ruby to make
newcomers "from" other languages feel at home.  But here, I am indeed
concerned about newcomers.  The point, though, is the same, but from
the other side: just as I do not advocate putting in C++, Java, or
Perl features to sweeten the pot for people considering Ruby, so I do
not advocate *removing* what I see as *Ruby* features (even at a
fairly fine-grained level).  I think either of these things can alter
the balance.

No, I do not think Ruby should stagnate and be dead.  If 1.8.3 were
the last version, it would not stagnate and be dead, because people
*use* it and do things with it.  The fact that, for me, that counts as
non-stagnation does perhaps mean that I am quite conservative about
language change.  I don't think the language needs to change, unless
something is truly broken or missing.

David

--
David A. Black
dbl...@wobblini.net


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Britt  
View profile  
 More options Oct 28 2005, 12:29 pm
Newsgroups: comp.lang.ruby
From: James Britt <jame...@neurogami.com>
Date: Sat, 29 Oct 2005 01:29:26 +0900
Local: Fri, Oct 28 2005 12:29 pm
Subject: Re: "Readability" inflation

David A. Black wrote:
> That leaves me wondering why all these suggestions keep arising.

My Instant Theory:

Early users (circa release of Programming Ruby, 1st edition , or
earlier) of Ruby were language geeks, the sort of people who actively
scan the horizon for interesting programming languages.  They are
already accustomed to a variety of syntax, so readability is a fairly
fluid concept.

Once Ruby started getting more attention it attracted a wider audience,
including many with less broad language experience and a different idea
of readability.

I haven't gone back to see who has been advocating or supporting what
change or additions, so I do not know if this is even remotely accurate.
  But there are certain topics that have attained permathread status,
and syntax munging is becoming one of them as Ruby attracts more users.

I also suspect that on this matter Ruby is a "victim" of its own
success.  It makes it far easier to create DSLs and more-readable code,
and may have raised users' expectations about such.

(In fact, when I explain Ruby to people, among the first things I tell
them about is method_missing and send, and how, with those two things,
you can write almost anything like you like and get Ruby to do something
useful.)

James

--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com  - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com  - Playing with Better Toys


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Schierbeck  
View profile  
 More options Oct 28 2005, 12:30 pm
Newsgroups: comp.lang.ruby
From: Daniel Schierbeck <daniel.schierb...@gmail.com>
Date: Fri, 28 Oct 2005 18:30:50 +0200
Local: Fri, Oct 28 2005 12:30 pm
Subject: Re: "Readability" inflation

I agree with you that many suggestions have arisen, but many of them are
simply a way to think outside the box (I hate myself for using that
phrase, but I can't think of anything better.)

I think one of the many great things about Ruby is that each new
addition is carefully considered; does it correspond to the Ruby Way? It
it clear to me that `collection.every.method' does not. Neither do I
think the `->' lambda syntax does. But in the case of named arguments,
the great amount of alternative syntax propositions is a huge advantage
- they may not look anything like what we'll end up with, but they've
been considered, and maybe parts of them can be melted into the final
syntax.

One thing I would like to add is that we really ought to reconsider the
heavy use of symbols, especially arrows. This just doesn't look good:

   def foo(a =>, b =>, c =>)
   obj = -> (a, b = 1){ block }

And it's not clear to an outsider what it means. Use English words when
possible, and don't abbreviate too much.

Cheers,
Daniel


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Trans  
View profile  
 More options Oct 28 2005, 1:03 pm
Newsgroups: comp.lang.ruby
From: "Trans" <transf...@gmail.com>
Date: 28 Oct 2005 10:03:20 -0700
Local: Fri, Oct 28 2005 1:03 pm
Subject: Re: "Readability" inflation

Daniel Schierbeck wrote:
> I agree with you that many suggestions have arisen, but many of them are
> simply a way to think outside the box (I hate myself for using that
> phrase, but I can't think of anything better.)

Ruby the Can-Do langauge :-)

> I think one of the many great things about Ruby is that each new
> addition is carefully considered; does it correspond to the Ruby Way? It
> it clear to me that `collection.every.method' does not. Neither do I
> think the `->' lambda syntax does.

The  { |x| ... } syntax never turned me on about Ruby. In fact, my
first thought what why not do(x) ... end. But it was the *utility* of
blocks that made the difference.

> But in the case of named arguments,
> the great amount of alternative syntax propositions is a huge advantage
> - they may not look anything like what we'll end up with, but they've
> been considered, and maybe parts of them can be melted into the final
> syntax.

> One thing I would like to add is that we really ought to reconsider the
> heavy use of symbols, especially arrows. This just doesn't look good:

>    def foo(a =>, b =>, c =>)
>    obj = -> (a, b = 1){ block }

Does

    def foo(a:, b:, c:)

look any better? Not to me. To me it looks worse b/c of what :a and
a::b are.

> And it's not clear to an outsider what it means. Use English words when
> possible, and don't abbreviate too much.

Case in point, what's the english equiv of #===. I'd really like to
have one.

T.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hugh Sasse  
View profile  
 More options Oct 28 2005, 1:04 pm
Newsgroups: comp.lang.ruby
From: Hugh Sasse <h...@dmu.ac.uk>
Date: Sat, 29 Oct 2005 02:04:13 +0900
Local: Fri, Oct 28 2005 1:04 pm
Subject: Re: "Readability" inflation

On Sat, 29 Oct 2005, David A. Black wrote:
> Hi --

> [...]  But really I'm just puzzling things through.

> Over the years and, I think, particularly in recent months, there's
> been a ton of suggestions for changing Ruby syntax.  The majority
> involve adding new semantics through new punctuation.  Most of the
        [...]
> Ruby has always "sold itself" to programmers in large part because it
> looks so good and, in the eyes of many, many people, successfully
> balances expressiveness with clarity.  "Readability" is not an
> absolute -- but the empirical evidence suggests that a lot of people
> experience Ruby as very readable.

Agreed.

> I'm certainly convinced that if even a few of the punctuation and/or
> condensation things happen to the syntax, Ruby's reputation for
> readability will decline rapidly and permanently.  I may be wrong, but
> my belief and working hypothesis is that the "readability margin" is
> quite narrow and easily erased.

And it doesn't take much.  I mean, people often object to
pluralization in Perl by means of @collection and
$collection[member]

> That leaves me wondering why all these suggestions keep arising.

> I think what's happening is that people who've used Ruby for a while
> get used to it, and then they sort of shift their readability
> threshold.  In other words, if you've seen this:

>   a.map {|b| b.meth }

> for several years, then even though it looked beautiful and concise
> and transparent to you at first, it will start to look verbose and
> syntactically inefficient.  So then you might want to

  [Compress the code by moving to a higher base :-)]

> And yet... if you had encountered the latter version first, you would
> never have had the feeling of balance and cleanness that you got (or
> at least I did) from the former version.

> So I think there's a kind of readability inflation going on: people
> who are acclimatized to Ruby start feeling comfortable about going to
> the "next" level of line-noise and/or compactness.

So what is so bad about introducing more keywords? Yes, they can
stamp on existing variables, but what if, just for parameter passing
we introduced "named"

  # A factory method
  def create_pizza(t=[:pepperoni, :ham] named :toppings,
                   c=[:thin] named :crust_thickness)
    imaginate(:pizza_factory).make_me(c,t)  # [1]
  end

nice short vars for codeing, then

  # My toppings for today
  mt=[:ham, :cheese, :pineapple]
  pizza = create_pizza(mt named :toppings)

There's no ambiguity with past forms, and the syntax is still fairly
English. (On the basis that the rest of Ruby is fairly English: I'm
not suggesting people should fit to my linguistic bias.)

Ruby has very few keywords now.  I know this might upset things that
talk to name daemons, because they already have the named string
inside the code, but if it improves readability it might be a price
worth paying.

        Hugh
[1]
http://www.toolshed.com/blog/articles/2004/09/01/imaginate-the-article


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
why the lucky stiff  
View profile  
 More options Oct 28 2005, 1:09 pm
Newsgroups: comp.lang.ruby
From: why the lucky stiff <ruby-t...@whytheluckystiff.net>
Date: Sat, 29 Oct 2005 02:09:38 +0900
Local: Fri, Oct 28 2005 1:09 pm
Subject: Re: "Readability" inflation

David A. Black wrote:
> Over the years and, I think, particularly in recent months, there's
> been a ton of suggestions for changing Ruby syntax.  The majority
> involve adding new semantics through new punctuation.  Most of the
> rest involve some kind of distillation of existing syntax into
> something smaller.

So, is your compaint about the suggestions?  Or about Matz' own recent
tinkerings with the language?  Because although your overall comments
lean toward the first, your specific examples point towards changes Matz
has messed with.  Discussions he has encouraged.

I think suggestions from the audience are harmless.  Matz rarely gives
credence to these and even accepted RCRs go untouched for upwards of 5
years.  Anyway, I'd hate to silence the crowd, these are our people.  
These are casual discussions, do they really have the gravity you think
they have?

And the syntax choices that Matz plays with often get shelved.  He's
played with the local block variables syntax since I can remember.  I
like that Ruby development is slow.  He does wait for our comfort.

_why


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Schierbeck  
View profile  
 More options Oct 28 2005, 1:14 pm
Newsgroups: comp.lang.ruby
From: Daniel Schierbeck <daniel.schierb...@gmail.com>
Date: Fri, 28 Oct 2005 19:14:18 +0200
Local: Fri, Oct 28 2005 1:14 pm
Subject: Re: "Readability" inflation

Trans wrote:
> Case in point, what's the english equiv of #===. I'd really like to
> have one.

"kind of equal to"? :)

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Trans  
View profile  
 More options Oct 28 2005, 1:14 pm
Newsgroups: comp.lang.ruby
From: "Trans" <transf...@gmail.com>
Date: 28 Oct 2005 10:14:15 -0700
Local: Fri, Oct 28 2005 1:14 pm
Subject: Re: "Readability" inflation
Or 'as'?

  # A factory method
  def create_pizza(t=[:pepperoni, :ham] as :toppings,
                   c=[:thin] as :crust_thickness)
    imaginate(:pizza_factory).make_me(c,t)  # [1]
  end

nice short vars for codeing, then

  # My toppings for today
  mt=[:ham, :cheese, :pineapple]
  pizza = create_pizza(mt as :toppings)

T.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Schierbeck  
View profile  
 More options Oct 28 2005, 1:24 pm
Newsgroups: comp.lang.ruby
From: Daniel Schierbeck <daniel.schierb...@gmail.com>
Date: Fri, 28 Oct 2005 19:24:15 +0200
Local: Fri, Oct 28 2005 1:24 pm
Subject: Re: "Readability" inflation

Hugh Sasse wrote:
>   # A factory method
>   def create_pizza(t=[:pepperoni, :ham] named :toppings,
>                    c=[:thin] named :crust_thickness)
>     imaginate(:pizza_factory).make_me(c,t)  # [1]
>   end

> nice short vars for codeing, then

>   # My toppings for today
>   mt=[:ham, :cheese, :pineapple]
>   pizza = create_pizza(mt named :toppings)

Looks interesting... I still think this is better, though

   class Pizza
     def initialize(named toppings, named crust_thickness = :thin)
       @toppings = toppings
       @crust_thickness = crust_thickness
     end
   end

   pizza = Pizza.new :crust_thickness => :really_thick,
                     :toppings => [:pepperoni, :ham]

Cheers,
Daniel


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Britt  
View profile  
 More options Oct 28 2005, 1:38 pm
Newsgroups: comp.lang.ruby
From: James Britt <jame...@neurogami.com>
Date: Sat, 29 Oct 2005 02:38:21 +0900
Local: Fri, Oct 28 2005 1:38 pm
Subject: Re: "Readability" inflation
why the lucky stiff wrote:

I agree that suggestions and discussion are important, and, with Matz
calling the shots, there is little risk of any sort of Ruby Community
Process goofiness.

Also do not believe that David is in any way trying to silence anyone.
He's offering a voice to a particular point of view, not trying to
discourage discussion.

James

--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com  - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com  - Playing with Better Toys


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joe Van Dyk  
View profile  
 More options Oct 28 2005, 1:46 pm
Newsgroups: comp.lang.ruby
From: Joe Van Dyk <joevan...@gmail.com>
Date: Sat, 29 Oct 2005 02:46:53 +0900
Local: Fri, Oct 28 2005 1:46 pm
Subject: Re: "Readability" inflation
On 10/28/05, David A. Black <dbl...@wobblini.net> wrote:

> Hi --
<snip>
> No, I do not think Ruby should stagnate and be dead.  If 1.8.3 were
> the last version, it would not stagnate and be dead, because people
> *use* it and do things with it.  The fact that, for me, that counts as
> non-stagnation does perhaps mean that I am quite conservative about
> language change.  I don't think the language needs to change, unless
> something is truly broken or missing.

I love the current Ruby syntax.

If 2.0 just contained a faster Ruby, and kept the same syntax, I'd be overjoyed.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pete  
View profile  
 More options Oct 28 2005, 1:55 pm
Newsgroups: comp.lang.ruby
From: Pete <pe...@gmx.org>
Date: Sat, 29 Oct 2005 02:55:30 +0900
Local: Fri, Oct 28 2005 1:55 pm
Subject: Re: "Readability" inflation

>    pizza = Pizza.new :crust_thickness => :really_thick,
>                      :toppings => [:pepperoni, :ham]

looks like a hash, if you ask me...

so what the extra keyword for ??

On Fri, 28 Oct 2005 19:27:03 +0200, Daniel Schierbeck  


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yukihiro Matsumoto  
View profile  
 More options Oct 28 2005, 1:57 pm
Newsgroups: comp.lang.ruby
From: Yukihiro Matsumoto <m...@ruby-lang.org>
Date: Sat, 29 Oct 2005 02:57:30 +0900
Local: Fri, Oct 28 2005 1:57 pm
Subject: Re: "Readability" inflation
Hi,

In message "Re: "Readability" inflation"
    on Sat, 29 Oct 2005 02:09:38 +0900, why the lucky stiff <ruby-t...@whytheluckystiff.net> writes:

|I like that Ruby development is slow.  He does wait for our comfort.

Thank you.  In fact, I don't like Ruby development is slow.  But
unfortunately, I am not smart enough besides being lazy.

                                                        matz.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ron M  
View profile  
 More options Oct 28 2005, 2:08 pm
Newsgroups: comp.lang.ruby
From: Ron M <rm_ra...@cheapcomplexdevices.com>
Date: Sat, 29 Oct 2005 03:08:55 +0900
Local: Fri, Oct 28 2005 2:08 pm
Subject: Re: "Readability" inflation

David A. Black wrote:

> ...a ton of suggestions for changing Ruby syntax....

> That leaves me wondering why all these suggestions keep arising.

> I think what's happening is that people who've used Ruby for a while
> get used to it, and then they sort of shift their readability

I'm pretty sure it's the opposite of what you think.

In the past, Ruby appealed to people who were fluent in Perl,
ML, Lisp, Smalltalk, the K language, and a bunch of other
languages with truly horrible readability problems.

Judged against that field, Ruby is beautiful.

Today Ruby is attracting people who may have more experience
in C, VHDL and Fortran (me) or Visual Basic (like marketing
departments for UI prototypes).

>  In other words, if you've seen this:
>   a.map {|b| b.meth }

> for several years, then even though it looked beautiful and concise
> and transparent to you at first, it will start to look verbose and
> syntactically inefficient.

For us people with less broad exposure to esoteric languages, this:
     c.map{|b| b.meth}
really isn't as intuitive as you'd think.

If I were to ask people around the office, I'd expect guesses
like these for  "c.map{|b| b.meth}":

   ? It defines a function with the funny name "c.map" that takes
     no arguments; that pipes the variable b it's input to b and
     then to b.meth (like MSFT's Monad shell's pipe operator)?

   ? It uses "c" to return a hashtable ("map" sounds like HashMap
     in Java) with one element with name "b" and value "b.meth"?

   ? It takes the locations in the object "c" and plots
     the meth labs on the google-map "b"?

In defense of "{|x| ...}",  I really like it over C-style for
loops.  But readability for new users certainly isn't one of
it's strengths.

Consider Microsoft's Monad's

   get-childitem | sort-object extension | foreach { $_.filename}

vs Ruby's

   get-childitem.sort_by{|child| child.extension}.map{|child| child.filename}

Msh makes Ruby's 4-time repetition of "child" look quite tedious,
without adding any readability that I can see over the Microsoft version.

> So I think there's a kind of readability inflation going on: people
> who are acclimatized to Ruby start feeling comfortable about going to
> the "next" level of line-noise and/or compactness.

I'd reiterate that I think it's the opposite.  Newbies without
the theoretical CS backgrounds are complaining about the parts
that they find confusing or tedious.

The one really great part about Ruby, though; is that almost any
time someone complains, someone else posts some magical addition
to some module that gives the complainer almost exactly what he
wanted -- so I'd tend to agree the language shouldn't need many
of these changes.

But I think what's driving the increased requests are mostly
things that people find hard to read, rather than clean
things that people are getting bored with.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joel VanderWerf  
View profile  
 More options Oct 28 2005, 2:26 pm
Newsgroups: comp.lang.ruby
From: Joel VanderWerf <vj...@path.berkeley.edu>
Date: Sat, 29 Oct 2005 03:26:16 +0900
Local: Fri, Oct 28 2005 2:26 pm
Subject: Re: "Readability" inflation

Daniel Schierbeck wrote:
> Trans wrote:

>> Case in point, what's the english equiv of #===. I'd really like to
>> have one.

> "kind of equal to"? :)

"matches" ? or "case-matches", to be explicit?

--
      vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Schröder  
View profile  
 More options Oct 28 2005, 2:38 pm
Newsgroups: comp.lang.ruby
From: Brian Schröder <ruby.br...@gmail.com>
Date: Sat, 29 Oct 2005 03:38:10 +0900
Local: Fri, Oct 28 2005 2:38 pm
Subject: Re: "Readability" inflation
On 28/10/05, David A. Black <dbl...@wobblini.net> wrote:

> Hi --

>  [snip concerns]

I totally agree with you. Thanks for summing it up so nicely.

best regards,

Brian

> David

> --
> David A. Black
> dbl...@wobblini.net

--
http://ruby.brian-schroeder.de/

Stringed instrument chords: http://chordlist.brian-schroeder.de/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Karl von Laudermann  
View profile  
 More options Oct 28 2005, 2:56 pm
Newsgroups: comp.lang.ruby
From: "Karl von Laudermann" <doodpa...@mailinator.com>
Date: 28 Oct 2005 11:56:06 -0700
Local: Fri, Oct 28 2005 2:56 pm
Subject: Re: "Readability" inflation

Trans wrote:
> Does

>     def foo(a:, b:, c:)

> look any better? Not to me. To me it looks worse b/c of what :a and
> a::b are.

I admit I haven't read all of the posts in the named parameter threads,
so I apologize if my question is answered there, but why does there
even need to be a new syntax for declaring methods with named
parameters at all? My first thought as to  what "adding named
parameters to Ruby" means is that *any* method can be called using
named parameters or not. I.e., given a method:

def foo(a, b)
    a + b
end

It can be called in any of these ways:

foo(5, 3)
foo(a=5, b=3)
foo(b=3, a=5)

Why can't this be made to work?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David A. Black  
View profile  
 More options Oct 28 2005, 3:42 pm
Newsgroups: comp.lang.ruby
From: "David A. Black" <dbl...@wobblini.net>
Date: Sat, 29 Oct 2005 04:42:02 +0900
Local: Fri, Oct 28 2005 3:42 pm
Subject: Re: "Readability" inflation
Hi --

On Sat, 29 Oct 2005, why the lucky stiff wrote:

> I think suggestions from the audience are harmless.  Matz rarely gives
> credence to these and even accepted RCRs go untouched for upwards of 5 years.
> Anyway, I'd hate to silence the crowd, these are our people.  These are
> casual discussions, do they really have the gravity you think they have?

I can't say because I don't know what gravity you think I think they
have :-)  I don't really want to get into the meta-meta-... thing,
though.  It's just a bunch of observations and comments -- "from the
audience" and hopefully harmless, as you say.

David

--
David A. Black
dbl...@wobblini.net


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christophe Grandsire  
View profile  
 More options Oct 28 2005, 3:49 pm
Newsgroups: comp.lang.ruby
From: Christophe Grandsire <christophe.grands...@free.fr>
Date: Sat, 29 Oct 2005 04:49:41 +0900
Local: Fri, Oct 28 2005 3:49 pm
Subject: Re: "Readability" inflation
Selon Karl von Laudermann :

Because "a=5" is an expression that returns a value, and is thus allowed
as an argument. That would create an ambiguity between "a=5" as an
expression whose return value is used as argument and "a=5" as a named
argument receiving a value.

Anyway, quite a few people, including myself, don't like the idea of all
arguments being optionally named arguments. It obliges method arguments
to be part of the method interface, and that should only happen *when
the developer explicitly wants it that way.*

I know it's a feature of Python, and maybe it hasn't brought anything
bad to it. However, it's one of the reasons why I quit learning the
language. It wasn't the only syntax feature I disliked, but it didn't
balance things out either.
--
Christophe Grandsire.

http://rainbow.conlang.free.fr

You need a straight mind to invent a twisted conlang.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Schröder  
View profile  
 More options Oct 28 2005, 4:21 pm
Newsgroups: comp.lang.ruby
From: Brian Schröder <ruby.br...@gmail.com>
Date: Sat, 29 Oct 2005 05:21:32 +0900
Local: Fri, Oct 28 2005 4:21 pm
Subject: Re: "Readability" inflation
On 28/10/05, Brian Schröder <ruby.br...@gmail.com> wrote:

> On 28/10/05, David A. Black <dbl...@wobblini.net> wrote:
> > Hi --

> >  [snip concerns]

> I totally agree with you. Thanks for summing it up so nicely.

> best regards,

> Brian

After reading the other posts I wanted to make clear that I understood
davids comment as a reminder not too be too eager with change
proposals, but to weight them on a beauty scale. I did not understood
it as a discouragement for proposals. I think it is a good thing, that
not only matz stands against the tide, but that there are other
conservative people as well.

best regards,

Brian

> > David

> > --
> > David A. Black
> > dbl...@wobblini.net

--
http://ruby.brian-schroeder.de/

Stringed instrument chords: http://chordlist.brian-schroeder.de/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nikolai Weibull  
View profile  
 More options Oct 28 2005, 5:10 pm
Newsgroups: comp.lang.ruby
From: Nikolai Weibull <mailing-lists.ruby-t...@rawuncut.elitemail.org>
Date: Sat, 29 Oct 2005 06:10:12 +0900
Local: Fri, Oct 28 2005 5:10 pm
Subject: Re: "Readability" inflation

Joe Van Dyk wrote:
> On 10/28/05, David A. Black <dbl...@wobblini.net> wrote:
> > No, I do not think Ruby should stagnate and be dead.  If 1.8.3 were
> > the last version, it would not stagnate and be dead, because people
> > *use* it and do things with it.  The fact that, for me, that counts
> > as non-stagnation does perhaps mean that I am quite conservative
> > about language change.  I don't think the language needs to change,
> > unless something is truly broken or missing.
> I love the current Ruby syntax.

> If 2.0 just contained a faster Ruby, and kept the same syntax, I'd be
> overjoyed.

I agree.  If all Ruby 2.0 brought was a VM I’d be happy.  That, and
M17N...and perhaps keyword arguments ;-D,
        nikolai

--
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gwtm...@mac.com  
View profile  
 More options Oct 28 2005, 6:09 pm
Newsgroups: comp.lang.ruby
From: gwtm...@mac.com
Date: Sat, 29 Oct 2005 07:09:56 +0900
Local: Fri, Oct 28 2005 6:09 pm
Subject: Re: "Readability" inflation

On Oct 28, 2005, at 1:07 PM, Trans wrote:

> Case in point, what's the english equiv of #===. I'd really like to
> have one.

How about "contains" or "includes"?

     String contains "abc"
     0..10 contains 5
     1,2,3,4 contains 3
     /^[a-z]*$/ includes "apple"

It would be nice if Array#=== was aliased to Array#include?  So that

     somearray === someval

would check for membership.  You can "cheat" a bit with the case
statement as follows:

     a = [1,2,3,4]
     b = 3

     case b
     when *a
       puts "match"
     else
       puts "no match"
     end

This works with any object that responds to to_a but of course
requires that an array be constructed instead of a more efficient
lookup into the object that could be done via a
customized === method.

See my recent posting about this (ruby-talk:162999)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joel VanderWerf  
View profile  
 More options Oct 28 2005, 6:36 pm
Newsgroups: comp.lang.ruby
From: Joel VanderWerf <vj...@path.berkeley.edu>
Date: Sat, 29 Oct 2005 07:36:10 +0900
Local: Fri, Oct 28 2005 6:36 pm
Subject: Re: "Readability" inflation

And I'd be happy with just native threads. Nothing else.

I find it interesting that before 1.8 was released, I was frequently
installing the latest 1.7.x because it had some new feature I needed. I
kept that up for a while with 1.9.x just out of habit, but didn't really
need anything that was in 1.9 but not 1.8. I'm very happy with 1.8.2, in
fact.

--
      vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Schierbeck  
View profile  
 More options Oct 28 2005, 7:45 pm
Newsgroups: comp.lang.ruby
From: Daniel Schierbeck <daniel.schierb...@gmail.com>
Date: Sat, 29 Oct 2005 01:45:07 +0200
Local: Fri, Oct 28 2005 7:45 pm
Subject: Re: "Readability" inflation

Pete wrote:
>>    pizza = Pizza.new :crust_thickness => :really_thick,
>>                      :toppings => [:pepperoni, :ham]

> looks like a hash, if you ask me...

> so what the extra keyword for ??

In my example, the value :really_thick will be assigned to the method's
local variable `crust_thickness', and `[:pepperoni, :ham]' to
`toppings'. Otherwise, you would have to do the following:

   def initialize(opts)
     opts[:crust_thickness] ||= :thin
     @toppings = opts[:toppings]
     @crust_thickness = opts[:crust_thickness]
   end

Which of course would be even more confusing if there were a great many
keywords.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gabriele renzi  
View profile  
 More options Oct 28 2005, 7:45 pm
Newsgroups: comp.lang.ruby
From: gabriele renzi <surrender...@-remove-yahoo.it>
Date: Fri, 28 Oct 2005 23:45:18 GMT
Local: Fri, Oct 28 2005 7:45 pm
Subject: Re: "Readability" inflation
Trans ha scritto:

I agree with David in the general points, but for what is worth, I agree
with TRANS on this, I always thought {|x|...} was unrubyish, even when I
did'nt had a grasp of what rubyish could mean (and probably I still don't)

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 69   Newer >
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google