On Oct 3, 5:24 pm, Robert Kieffer <bro...@gmail.com> wrote:
> Quick reality check: Where is the value in String/Array functions that
> test for emptiness?  'These methods are nothing more than wrappers
> around code like,  "if (!aString) ...", or "if (!anArray.length) ..."
> - i.e. JS already has perfectly good constructs for this.

It's worth noting that (!aString) is more or less equal to
(String.isUndefinedOrNullOrEmpty) than it is equal to
(String.isEmpty). Also, since we have no type hinting, (!aString) will
work easily with objects, strings, numbers, booleans and basically
everything, where as (String.isEmpty), or any string method for that
matter, should throw an argument exception when receiving different
type of arguments.

At the same time (!aString/anArray.length) are perfect examples of JS
magic in use. But then, the logical question is why use
(Object.isFunction) over (typeof object === "function")?

It seems that the more questions are asked about the core semantics of
Prototype, more questions arise.


On Oct 4, 10:30 am, "T.J. Crowder" <t...@crowdersoftware.com> wrote:
> I'm with Robert, is there a good use case for these or should we just
> deprecate them?

Now that is and interesting question. To me, to using (aString ==
String.empty) over (aString == "") is all about the sugar.

Never the less I agree that any JS library should be bloated with
useless code.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to