Hello,

While fixing ticket #534 [1] _again_ (really sorry about my previous  
patch), I've been wondering which convention to use when testing for  
empty string.

Original source code was showing `while (source.length > 0)` which is  
really intention revealing, but while writing my patch I mecanically  
wrote `if (!source) break;`, instead of `if (!source.length)` of `if  
(source.length == 0)`.
I think everybody knows the empty string is a falsy value in  
Javascript and the above tests are all equivalents, but what do you  
guys (especially core) think about a consistent convention to use in  
those cases ?

Intention revealing versus concise code...

[1] http://prototype.lighthouseapp.com/projects/8886-prototype/tickets/534

Best,
Samuel.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to