Er, sorry, the smart-ass in me got the best of me.
I think Prototype is in danger of starting to bloat like other
libraries and I think requests like this are exactly why.
There's no possible reason to have a size method when there's a
perfectly good length property.
I'm certain someone will argue that Ruby strings have size methods.
And of course, they might be right. But that's not a compelling
reason to add a size method to JavaScript strings. Prototype is
already a large enough download without adding unnecessary "features".
On Sep 29, 2007, at 4:55 PM, Jeff Watkins wrote:
>
> Maybe you've heard of the length property on String?
>
> Why on earth would you need a size method?
>
> On Sep 29, 2007, at 8:45 AM, Sylvain ZIMMER wrote:
>
>>
>> Hi all,
>>
>> I was a bit surprised not to find a size() method on String (like
>> Array, Enumerable, Hash, ...)
>>
>> So maybe there is a good reason not to (and I'd like to know it ;-),
>> but wouldn't it be nice to have
>>
>> String.prototype.size = function() {
>> return this.length;
>> }
>>
>> so that we can call size() whatever the object type is?
>>
>> thanks!
>>
>>
>>>
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---