On Fri, Mar 09, 2012 at 01:34:38PM -0500, Nick Sabalausky wrote:
> "Ary Manzana" <a...@esperanto.org.ar> wrote in message 
> news:jjd21r$6ni$1...@digitalmars.com...
> >
> > Sample Ruby session:
> >
> > > irb
> > ruby-1.8.7-p352 :001 > [1, 2, 3].count
> >  => 3
> > ruby-1.8.7-p352 :002 > [1, 2, 3].length
> >  => 3
> > ruby-1.8.7-p352 :003 > [1, 2, 3].size
> >  => 3
> >
> > I never saw *anyone* complaining about this. When you write, you
> > choose whatever is convenient to you (whatever comes to your mind
> > first). When you read it, it's understandable. Nobody wonders "why
> > didn't he wrote 'length' instead of 'size'", because the meaning is
> > clear.
> 
> I would wonder what the subtle distinction is. FWIW.
[...]

Me too. I would assume that 'count' counts array elements whereas 'size'
counts the number of bytes the array uses up.

IMAO, this sort of "write your mind and somehow it just works" thing
only encourages lazy programming (guessing what something does without
knowing for sure, and copy-n-pasting code without understanding it,
which leads to bit rot and hideous patchwork code that houses all sorts
of subtle bugs and corner-case failures).


T

-- 
Those who've learned LaTeX swear by it. Those who are learning LaTeX swear at 
it. -- Pete Bleackley

Reply via email to