On 10/2/06, Dave Watts <[EMAIL PROTECTED]> wrote:
>
> > Sorry so wordy with so little clarity, probably, but I'll use
> > this example, that I think Neil might have given:
> >
> > if(someQuery.recordcount GT 0)
> > vs.
> > if(someQuery.recordcount)
> >
> > The second, while being "true", isn't as "true" as the first.
>
> That's ridiculous, by definition. There are no gradations within truth
> values in Boolean logic.


This made me laugh out loud.  A good laugh, mind! =]

> If I were to switch languages, w/#1 it would be clear that
> > recordcount is numeric, and might shed some light on the
> > language as a whole.
>
> Yes, and I'm normally in favor of explicit, self-documenting code. But
> this
> is a trivial piece of information. It's not like, say, pre- and
> post-increment operators in C-style languages. A CF programmer will have
> to
> know the following, for either line of code to make sense:


It's amazing how the most "trivial" of things can turn out to be a stumbler
for
another individual. "Normally"... well, that's not very Boolean of you. =P

And hey, what if there is some warp hole, or what-have you, and the only bit
of code to survive is that one line?  How much info would those 5 chars
give?

There may not be any shades in boolean logic, (maybe- I'm not convinced =),
but you sure do have a lot of presuming and "external" info going on in
the following paragraphs, which those 5 chars /might/ help avoid, or make
clear instantly, first time around, or whatever. Maybe.

Like I said, it's important, and it doesn't really matter.  Whatever is
clever,
there is no "right" answer, etc., etc.. *shrug*

All I know is that whenever I switch projects, unless I'm in multi-mode,
there is a little ambiguity going on while getting my mind in gear, and
that is just how complicated systems are, at least for me, no matter
how "future thinking" or whatever you want to call it, the code is.

Maybe there is a level of simplicity that... well, I think it ties in with
Godel (insert the funky o back there, IIRC), really, and I'm betting
you know what I'm talking about (at least Re: Godel and The Truth ;).

I do have to stand on the side of someQuery.recordcount GT 0 though-
sorry man, but it just looks "more boolean". =-]

**

Things won't be different in the morning, right Dave?  You still love me?
I know, it would be impossible not to.
*|)3|\|*

-ps a "strange" 42170 to you too. But Not Normally !]

-pps all this is with laughter- if it comes across any other way, shoot the
net.

1. All query objects contain a value called "RecordCount".
> 2. This value contains the number of records within the query.
>
> Now, those things aren't immediately obvious, and therefore require some
> knowledge about CF. But many programming languages allow implicit
> evaluation
> of numeric values as Boolean values, and any programmer who reads the
> second
> line of code will either know that and realize that CF must be one of
> those
> languages, or they won't. If they don't, they will presumably know that
> RecordCount is a numeric value, but that CFIF requires a Boolean
> expression.
> They can then see, by simply running the code, that CF can figure out how
> to
> make sense of it. And this is the kind of problem that you only have to
> figure out once - the first time you see it, it might be mildly confusing,
> but once you understand it you'll never be confused again. This differs
> from
> generally ambiguous code, which requires you to reinterpret it practically
> every time you read it.
>
> And of course, we make similar assumptions all the time, when reading CF
> code:
>
> <cfset numericvar = "42">
> <cfset numericvar = numericvar & "17">
> <cfset result = numericvar * 10> <!--- wtf? I thought numericvar contained
> a
> string! --->
>
> Dave Watts, CTO, Fig Leaf Software
> http://www.figleaf.com/
>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255113
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to