Hi all.
Can we please try to stay on topic.
This thread's topic is about renaming methods whose ruby counterparts
were suffixed with a question mark.
It would be very helpful to list all of the methods which fall in that
category so we have a better idea of the implications of such a
change.
F
On Sun, Oct 4, 2009 at 4:53 AM, joneff wrote:
> It's worth noting that (!aString) is more or less equal to
> (String.isUndefinedOrNullOrEmpty) than it is equal to (String.isEmpty).
It just means developers have to know the difference between "!
aString" and "aString == ''". 'Don't think that c
Tobie, I find myself wondering what other reasons you might have for keeping
these methods, because the arguments you give don't seem to convincing (to
me). In fact, it seems like you may have just phrased the same argument
three different ways ...
On Sun, Oct 4, 2009 at 4:25 AM, Tobie Langel wr
On Oct 3, 5:24 pm, Robert Kieffer 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 con
String#isEmpty checks not the length of a string, but absence of non-space
characters, which is quite useful i.e. in form validation.
On Sun, 04 Oct 2009 11:30:00 +0400, T.J. Crowder
wrote:
>
> I'm with Robert, is there a good use case for these or should we just
> deprecate them?
>
> But i
Hi everyone.
There are various reasons to keep those methods around, some of which
are:
1) Follow the Principle Of Least Surprise (POLS) by exposing a similar
API across the whole platform,
2) simplify duck-typing, and
3) abstract implementation details (for example, Hash#isEmpty isn't as
trivia
I'm with Robert, is there a good use case for these or should we just
deprecate them?
But if we're going to get into renaming things, Enumerable#include is
crying out for an "s" on the end ("if this thing include*s* this other
thing then..."); without one it seems to say "include this argument in
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 great that Prototype is in
It's specifically because JavaScript disallows certain characters in
identifiers (such as '?', for example), that we have decided to prefix
certain methods with 'is', 'has', etc. for version 1.7 / 2.0. Without
neither those characters nor adequate prefixes, the name of certains
methods are ambiguo
Prototype.js is an attempt to make Javascript more Ruby-like, so one of the
reasons that these methods exists and are named that way, is that they are
in Ruby (of cause Javascript lacks the ‘?’ in the method name).
http://ruby-doc.org/core/classes/String.html#M000776
http://ruby-doc.org/core/classe
+1 for REMOVE this methods
--~--~-~--~~~---~--~~
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
+1 for renaming both.
2009/10/2 Samuel Lebeau
> I totally agree.
> `Array#isEmpty` would be useful too.
> Maybe we should rename those methods and deprecate the original names in
> 1.7.
>
> Best,
> Samuel.
>
> 2009/10/2 Allen Madsen
>
> I'd prefer isEmpty as well.
>> Allen Madsen
>> http://www.a
I totally agree.
`Array#isEmpty` would be useful too.
Maybe we should rename those methods and deprecate the original names in
1.7.
Best,
Samuel.
2009/10/2 Allen Madsen
> I'd prefer isEmpty as well.
> Allen Madsen
> http://www.allenmadsen.com
>
>
>
> On Fri, Oct 2, 2009 at 3:34 PM, joneff wrot
I'd prefer isEmpty as well.
Allen Madsen
http://www.allenmadsen.com
On Fri, Oct 2, 2009 at 3:34 PM, joneff wrote:
>
> I've been pondering on this one for quite a long time -- why is it
> String#empty instead of String#isEmpty? To me String.empty should be a
> field equal / referencing the empty
14 matches
Mail list logo