In Java, numbers are not boolean values, and if you try to use one as
such you'll get a compiler error.
I'm not saying that "NOT len(string)" is a no-no, just that I think
"len(string) EQ 0" is clearer and easier to understand. It's all
personal preference. If Sean's guidelines recommend the former,
that's totally fine with me. I'm not going to do it that way, but
that's my choice. You'll also see my code littered with
find("substr", myString) EQ 0 and the like.
cheers,
barneyb
On 4/27/05, Russ <[EMAIL PROTECTED]> wrote:
> Actually this kind of stuff has been used in C, and as far as I remember c++
> and possibly java. In c, there are no Boolean values, so 0 is false, and
> everything else is true, and I don't remember if C++ introduced Booleans,
> and I believe java does have Booleans, but in any of those languages, 0
> should be counted as false and 1 as true.
>
> ColdFusion treats numbers the same way, and it's not just because of the
> typeless nature of CF, but because that's how it's been in most other
> languages, and it makes sense. Perhaps if len(somevalue) eq 0 is easier to
> read to some, but I think for most NOT len(somevalue) is just as clear.
>
> Russ
--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/
Got Gmail? I have 50 invites.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:204757
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54