From: Austin Ziegler Date: 2006-06-15T05:51:04+09:00 Subject: Re: A plan for another unicode string hack On 6/14/06, Dave Howell wrote: > On Jun 14, 2006, at 9:17, Austin Ziegler wrote: > Yes, I undertstand. Making #size and #length return different values > is a mistake. Without referring to documentation, how would you know > which returns the number of characters and which one returns the > number of bytes? > > I cannot agree. "Length" (to me) unavoidably implies that it's the > answer to the question "How LONG is it?" I expect the answer to be "n > characters long." > > "Size" is the answer to "How BIG is it?" as in "How much space does > this thing take up?" and if it's a UTF-8 string, I expect an answer > like "1 byte per character + one more byte per character not in the > 7-bit ASCII range" > > I would never have to look up which is which. Obviously Austin's > mileage varies. As much as I like to say that I'm "from Ruby" these days, not everyone will be. Some languages use string.length(); others use string.size(). I do not think that the proposed distinction is meaningful and presents problems. -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca