[#18121] [Ruby 1.8.7 - Bug #405] (Open) ssl.rb:31: [BUG] Bus Error — Anonymous <redmine@...>

Issue #405 has been reported by Anonymous.

14 messages 2008/08/04

[#18130] Re: New array methods cycle, choice, shuffle (plus bug in cycle) — Brian Candler <B.Candler@...>

> Seriously though... Array.first is a noun.

10 messages 2008/08/05

[#18319] NEW Command: absolute_path() -- — "C.E. Thornton" <admin@...>

Core,

14 messages 2008/08/16
[#18321] Re: NEW Command: absolute_path() -- — Yukihiro Matsumoto <matz@...> 2008/08/18

Hi,

[#18381] [Bug #496] DRb.start_service(nil) is very slow — Hongli Lai <redmine@...>

Bug #496: DRb.start_service(nil) is very slow

11 messages 2008/08/25

[ruby-core:18056] Re: New array methods cycle, choice, shuffle (plus bug in cycle)

From: Thomas Enebo <Thomas.Enebo@...>
Date: 2008-08-01 17:53:50 UTC
List: ruby-core #18056
Jim Weirich wrote:
> On Jul 31, 2008, at 7:33 PM, Charles Oliver Nutter wrote:
>
>> choice is a noun. choose, map, select, collect, etc are imperative 
>> verbs.
>
>
> Interesting.  I tend to prefer nouns for methods returning values and 
> verbs for methods called mainly for side effects.  But obviously the 
> Ruby library doesn't follow my preferred conventions. :)
>
I vote for Jim's naming conventions :)  Seriously though... Array.first 
is a noun.  Array.choice is also a noun.  I think from a convention 
standpoint this is ok.

It seems that most of the problem with choice is that the name does not 
adequately describe what it returns.  So it looks strange at first 
glance.  You could say 'random' would be a good CHOICE, but If I saw:

arr.random

I would assume a randomized array based on name.  Picking a good name is 
tough.  Picking a better name is not so easy.  Array.give_me_something

If I had my way...I would remove it since it seems like Array already 
has too many esoteric methods in it.  Isn't this method just 
arr[rand(arr.length)]?

-Tom

In This Thread