From: Austin Ziegler Date: 2006-06-15T00:30:20+09:00 Subject: Re: A plan for another unicode string hack On 6/14/06, Mark Volkmann wrote: > On 6/14/06, Austin Ziegler wrote: > > ... in my code I > > have used #length and #size interchangeably depending on which reads > > better in context. > I've never been a fan of the Ruby practice of having many names for > the same thing, but I'm willing to be convinced. Can you give me an > example of two string variables where getting the number of characters > reads better with "length" for one and "size" for the other? It's all code context. "name.length" reads better than "name.size" and "box.size" reads better than "box.length". Remember, in Ruby you *don't* know whether you're dealing with a String, Array, or Hash (or something else) when you're dealing with simple method calls. Similarly, I will use #map most of the time, but sometimes I'll use #collect. In any case, these are well-established names and having them differ would be problematic. That *said*, I'll have to fix stuff in Ruby 2 for PDF::Writer because I'm currently doing byte counting, not character counting. -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca