Comment On True, False, or Yellow

One thing that I've always found annoying about languages with built-in Boolean data types is that values for those Booleans can only be TRUE or FALSE. Really, how useless is that? What happens when you want IsConnected() to return the string "I'll tell you, but it'll cost you a buck". This is why I'm glad that there's plenty of opportunities out there to work in languages like C that do not have such types built in. Look at how much easier it was for Duncan Young's colleague to add functionality to one of their applications ... [expand full text]
« PrevPage 1 | Page 2Next »

Re: True, False, or Yellow

2005-07-21 14:05 • by res2
priceless...[B]

Re: True, False, or Yellow

2005-07-21 14:08 • by Rank Amateur

What a dork. He's supposed to use bitfields. What happens tomorrow when they need to cover the case of applying the adjustment to only aggregates?


Doesn't he know what BOOL means? Bitfield Object Operating as Long.


--Rank


 

Re: True, False, or Yellow

2005-07-21 14:09 • by Handkor
38899 in reply to 38897

I guess his binary looks like this 11011012.


I can understand having more states than true and false like if I was working on software used for circuit design I could have a function IsConnected returning {true, false, HI_Z} but I would create a enum for this not put BOOL ret = 2.

Re: True, False, or Yellow

2005-07-21 14:15 • by tufty
38901 in reply to 38899
And there was me, innocently thinking it was going to be another SQL WTF to do with tri-state logic.

Nice.

Very, very, nice. I bow to obviously superior code-fu.

Simon

Re: True, False, or Yellow

2005-07-21 14:17 • by loneprogrammer
Okay . . . 

#define TRUE_TWO 2

// check if adjustment should be applied to aggregates as well
if ( IsAdministrative == TRUE_TWO )
{
// ...
}


Better?



Re: True, False, or Yellow

2005-07-21 14:18 • by mizhi
Pesky booleans.  Just a special case of an enum.



Could've been worse... he could've quantized the values between 0 and

1 on a float.



#define FALSE 0.0f

#define ALMOST_FALSE 0.1f

#define NOT_QUITE_FALSE 0.2f

#define COIN_FLIP 0.5f

#define MAYBE_TRUE 0.6f

#define PROBABLY_TRUE 0.7f

#define ALMOST_CERTAINLY_TRUE 0.8f

#define TRUE 1.0f



Re: True, False, or Yellow

2005-07-21 14:25 • by Charles Nadolski
All the above posts are all TWO_TRUE.

Re: True, False, or Yellow

2005-07-21 14:29 • by Paul
A friend put together an application that, at one point, asked the user:



Delete the User: J Smith



[Yes]  [No]  [Maybe]



.... gotta love programmers with a sense of humour

Re: True, False, or Yellow

2005-07-21 14:34 • by mizhi
38907 in reply to 38906
Anonymous:
A friend put together an application that, at one point, asked the user:



Delete the User: J Smith



[Yes]  [No]  [Maybe]



.... gotta love programmers with a sense of humour




Delete the User: J Smith



[Yes] [No] [Who?]

Re: True, False, or Yellow

2005-07-21 14:35 • by sinistral
38908 in reply to 38906
What did the [Maybe] button do?  A true Maybe button would use a random number generator and work 50% of the time.

Re: True, False, or Yellow

2005-07-21 14:48 • by Maurits
38911 in reply to 38908
sinistral:
What did the [Maybe] button do?




Pops up another dialog:



Are you sure?

[ Yes ] [ No ]

Re: True, False, or Yellow

2005-07-21 14:54 • by Ross Day
A similar but different problem I always hate in a lot of languages is just deciding whether something will be true or false.



For example, in Perl, you so often see just "if ($foo)" to check if the
variable is defined and not null.  The same thing happens in a lot
of languages, but these vague statements can have bad effects, like
when 0 or the emptry string becomes a valid value for $foo.  When
there is a built-in defined() function (same thing in PHP...isset()
built-in) or when you could just check != null), I amaze even myself
when I do the same thing of just putting "if ($foo)".  I only
change it when it comes back to bite me.



FWIW, please let the language war begin just because I mentioned the
two P languages...we all already know that it wouldn't be a problem
with a stricter-typed language and therefore all scripting languages
suck...and we all already know that stricter-typed languages are
cumbersome with too much typing and so all scripting languages rock.



WTFever...and BTW someone tell this guy to get an enum.

Re: True, False, or Yellow

2005-07-21 14:57 • by AaronStJ
You know, this really isn't that bad.  He just extended the
functionality of the function without correctly refactoring like he
should have.  It's more of a comment on how C works than how the
coder works.  Just make "BOOL IsAdministrative" into "int
AdministrativeCode", and use 0 and 1 instead of TRUE and FALSE (or
better yet, make new named constants).  A select instead of ifs
would be more efficient, but that's nitpicking.  Could be much
worse.

Re: True, False, or Yellow

2005-07-21 15:07 • by One Leg
38914 in reply to 38913
In quantum computing you need a "Yes And No" button.

Re: True, False, or Yellow

2005-07-21 15:13 • by Poppa Chubby
38916 in reply to 38902
loneprogrammer:

#define TRUE_TWO 2

Shouldn't that be...
#define TRUE_TOO  2

Re: True, False, or Yellow

2005-07-21 15:16 • by smitty_one_each
I love the smell of a Saturday, 0344 hack in the morning.

It smells like...victorEEEEEeeeeeeeeeeeeeee!

Re: True, False, or Yellow

2005-07-21 15:27 • by Sean Connery
Alex Papadimoulis:

What happens when you want IsConnected() to return the string "I'll tell you, but it'll cost you a buck". 





Use boost::tribool. The biggest WTF i've ever seen. I mean, why not just use enumerations.

Re: True, False, or Yellow

2005-07-21 15:42 • by richleick
In its simplest form this is a WTF, but if we dig a little deeper we
will find that it was a simple copy/paste error where the programmer
simply copied the wrong parameter from the function.



observe the function declaration

BOOL AcceptAdjustment( int AccountNumber, int AdjustmentCode, char* Comments, BOOL  IsAdministrative )

Then, since the programmer did a nice job of commenting their code

 // check if adjustment should be applied to aggregates as well
if ( IsAdministrative == 2 )
{
// ...
}

What they really meant was
if ( AdjustmentCode == 2 )

I think we can conclude that they simply used the wrong variable. So let's cut them some slack.
They didn't really fail, they just had "deferred success"
Haven't we all done this at least once in our coder careers?

Re: True, False, or Yellow

2005-07-21 15:50 • by Jeff S
38920 in reply to 38919
richleick:
In its simplest form this is a WTF, but if we dig a little deeper we will find that it was a simple copy/paste error where the programmer simply copied the wrong parameter from the function.

observe the function declaration
BOOL AcceptAdjustment( int AccountNumber, int AdjustmentCode, char* Comments, BOOL  IsAdministrative )

Then, since the programmer did a nice job of commenting their code

 // check if adjustment should be applied to aggregates as well
if ( IsAdministrative == 2 )
{
// ...
}

What they really meant was
if ( AdjustmentCode == 2 )

I think we can conclude that they simply used the wrong variable. So let's cut them some slack.
They didn't really fail, they just had "deferred success"
Haven't we all done this at least once in our coder careers?


 


ooh -- great point!  I think you are correct -- this is not a WTF, but rather a typo or a honest mistake in writing the code.  And, to be honest, it is well-commented and that helps us determine what the true intent was. 


So, I think we definitely cannot consider this a WTF but rather a simple coding error, and we should give some props to the coder for good comments which helps someone who is trying to debug the code quickly identify the mistake.


 

Re: True, False, or Yellow

2005-07-21 15:52 • by Alex Papadimoulis
38921 in reply to 38920
Jeff S:
richleick:
In its simplest form this is a WTF, but if we dig a little deeper we will find that it was a simple copy/paste error where the programmer simply copied the wrong parameter from the function.

observe the function declaration
BOOL AcceptAdjustment( int AccountNumber, int AdjustmentCode, char* Comments, BOOL  IsAdministrative )

Then, since the programmer did a nice job of commenting their code

 // check if adjustment should be applied to aggregates as well
if ( IsAdministrative == 2 )
{
// ...
}

What they really meant was
if ( AdjustmentCode == 2 )

I think we can conclude that they simply used the wrong variable. So let's cut them some slack.
They didn't really fail, they just had "deferred success"
Haven't we all done this at least once in our coder careers?


 


ooh -- great point!  I think you are correct -- this is not a WTF, but rather a typo or a honest mistake in writing the code.  And, to be honest, it is well-commented and that helps us determine what the true intent was. 


So, I think we definitely cannot consider this a WTF but rather a simple coding error, and we should give some props to the coder for good comments which helps someone who is trying to debug the code quickly identify the mistake.


 



Sorry guys, that was my oversight. The original submission had nothing to do with accounts, adustments, etc. Everything to do, however, with a TRUE/FALSE/2 boolean tho ...


But good find none the less.

Re: True, False, or Yellow

2005-07-21 15:54 • by frozenfred
38922 in reply to 38920
Even if it is a cut'n'paste the wrong variable error, they're still
using TRUE, FALSE and 2.  maybe not a major WTF, but still very
odd...

Re: True, False, or Yellow

2005-07-21 16:06 • by loneprogrammer
38923 in reply to 38920
Jeff S:
ooh -- great point!  I think you are correct
-- this is not a WTF, but rather a typo or a honest mistake in writing
the code.


You're right!  Not only was it an honest mistake, it was some of the most clever code I have seen in a long time.



Re: True, False, or Yellow

2005-07-21 16:16 • by CornedBee
38924 in reply to 38918
Anonymous:


Use boost::tribool. The biggest WTF i've ever seen. I mean, why not just use enumerations.




There's nothing WTFery about tribool. You just need to know when to use
it. The indeterminate value could, for example, mean "impossible to
determine". Situation would be a generic stream, and you ask it if the
next read for 100 bytes will block. Problem is, the stream is in
reality a decompression wrapper, so it has no clue how many bytes are
really needed, and therefore whether the read will block.

Or it could mean "partially true", because not everything is black and
white. Just look at the checkboxes in Windows - checked, not checked,
or grey-checked (e.g. because only a part of the subfeatures will get
installed.



Sure, you can misuse it - but you can misuse normal booleans as well.

Re: True, False, or Yellow

2005-07-21 16:25 • by OneFactor
38925 in reply to 38923

Ah, the wonderful world of tri-state booleans.


In Java, you can have a java.lang.Boolean whose values are Boolean.TRUE, boolean.FALSE, and of course good old null.


In SQL, you can have a bit field of size one with values: 0, 1, and good old null.


In C# I even saw a third-party class called defaultable boolean. It was an enum with three values: True, False, and Default. I think it was for gui controls that were supposed to inherit their state from their container.


Kind of reminds me of those trilogies with four books in them. Or of Indiana Jones: "I said NO camels! Can't you count?"

Re: True, False, or Yellow

2005-07-21 16:35 • by JThelen
38927 in reply to 38925
Anonymous:
Kind of reminds me of those trilogies with four books in them.




I prefer my book trilogies in 5 parts, thank you very much.





Re: True, False, or Yellow

2005-07-21 16:43 • by Rick
38930 in reply to 38927
And you probably know where your towel is.

JThelen:
Anonymous:
Kind of reminds me of those trilogies with four books in them.




I prefer my book trilogies in 5 parts, thank you very much.




Re: True, False, or Yellow

2005-07-21 17:00 • by JThelen
38931 in reply to 38930
Rick:
And you probably know where your towel is.

JThelen:
Anonymous:
Kind of reminds me of those trilogies with four books in them.




I prefer my book trilogies in 5 parts, thank you very much.








I have indeed been referred to as a 'Hoopy Frood'.

Re: True, False, or Yellow

2005-07-21 17:14 • by Fregas
38933 in reply to 38912

Ross Day:
A similar but different problem I always hate in a lot of languages is just deciding whether something will be true or false.

For example, in Perl, you so often see just "if ($foo)" to check if the variable is defined and not null.  The same thing happens in a lot of languages, but these vague statements can have bad effects, like when 0 or the emptry string becomes a valid value for $foo.  When there is a built-in defined() function (same thing in PHP...isset() built-in) or when you could just check != null), I amaze even myself when I do the same thing of just putting "if ($foo)".  I only change it when it comes back to bite me.

FWIW, please let the language war begin just because I mentioned the two P languages...we all already know that it wouldn't be a problem with a stricter-typed language and therefore all scripting languages suck...and we all already know that stricter-typed languages are cumbersome with too much typing and so all scripting languages rock.

WTFever...and BTW someone tell this guy to get an enum.


Ok. I'll bite.


This is in fact a great example of the downsides to loosely typed scripting languages, because of the weird side-effects you mention.  I've had the same problems in VB, Javascript, VBScript and Coldfusion.  There are definite down-sides to strictly typed languages as well, but its usally easier to convey your exact intentions to the runtime in a strongly typed language.


So when using a loosely typed lanuage, I discipline myself and DON'T do things like the above.  I treat the language as if its strongly typed unless i really need something flexible.  Heck, I hate how most of the strongly typed languages let you pass in null instead of a real object, rather than dictate if that's allowed in the method defiintion.


Ding! Ding! Round 2...

Re: True, False, or Yellow

2005-07-21 17:17 • by Fregas
38934 in reply to 38925
Anonymous:

Ah, the wonderful world of tri-state booleans.


In Java, you can have a java.lang.Boolean whose values are Boolean.TRUE, boolean.FALSE, and of course good old null.


In SQL, you can have a bit field of size one with values: 0, 1, and good old null.


In C# I even saw a third-party class called defaultable boolean. It was an enum with three values: True, False, and Default. I think it was for gui controls that were supposed to inherit their state from their container.


Kind of reminds me of those trilogies with four books in them. Or of Indiana Jones: "I said NO camels! Can't you count?"



Its amazing that this was the post today, and your response.  I JUST implemented an enumeration in C# that allowed True, False or "Not Applicable."  When saved to the sql server database, this comes out to a nullabel bit field (1, 0 or null.)


Is that bad?  The business requirements had to allow some bit fields to remain null, or even revert back to null if they edited the record later.

Re: True, False, or Yellow

2005-07-21 17:20 • by Hank Miller
38937 in reply to 38927
Come to think of it, I don't think I've ever read a trilogy that had
other than 5 book.   I've read several series with 3 novels,
but they were not called trilogies by anyone I can determine.  
I've read several trilogies that contain 5 novels.   (not
just the obvious one)



Unfortunatly I'm the type of guy who can never find his towel, hence I've been stuck on this backwater planet for years.

Re: True, False, or Yellow

2005-07-21 18:12 • by Anonymous
38942 in reply to 38937

And a bonus WTF for today:


  bool HasDst = (tzi.DaylightDate.wMonth == 0) ? false : true;


Taken from http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_21497706.html.

Re: True, False, or Yellow

2005-07-21 18:17 • by loneprogrammer
38943 in reply to 38942
Anonymous:

  bool HasDst = (tzi.DaylightDate.wMonth == 0) ? false : true;



That is simply redundant, but not wrong.



Re: True, False, or Yellow

2005-07-21 19:19 • by Peter Brodersen
"Ones and zeroes everywhere... and I thought I saw a two"

Re: True, False, or Yellow

2005-07-21 19:22 • by OneFactor
38947 in reply to 38934
Fregas:
OneFactor:

Ah, the wonderful world of tri-state booleans.


In Java, you can have a java.lang.Boolean whose values are Boolean.TRUE, boolean.FALSE, and of course good old null.


In SQL, you can have a bit field of size one with values: 0, 1, and good old null.


In C# I even saw a third-party class called defaultable boolean. It was an enum with three values: True, False, and Default. I think it was for gui controls that were supposed to inherit their state from their container.


Kind of reminds me of those trilogies with four books in them. Or of Indiana Jones: "I said NO camels! Can't you count?"



Its amazing that this was the post today, and your response.  I JUST implemented an enumeration in C# that allowed True, False or "Not Applicable."  When saved to the sql server database, this comes out to a nullabel bit field (1, 0 or null.)


Is that bad?  The business requirements had to allow some bit fields to remain null, or even revert back to null if they edited the record later.



I think there are valid usages of tristates. nullable bit field and a triple enum make a lot of sense for this. It just seems odd that the world tries so hard and so often to push you into that direction. I guess it is just hard in practice to constrain a field to two values.

Re: True, False, or Yellow

2005-07-21 19:29 • by loneprogrammer
38948 in reply to 38945
Anonymous:
"Ones and zeroes everywhere... and I thought I saw a two"


Don't worry, Bender.  There's no such thing as two.



Re: True, False, or Yellow

2005-07-21 19:46 • by Maurits
38949 in reply to 38924
CornedBee:


Or it could mean "partially true", because not everything is black and
white. Just look at the checkboxes in Windows - checked, not checked,
or grey-checked




Actually I've seen at least five checkbox states.



checked

unchecked



checked and disabled (that is, grey with a check)

unchecked and disabled (that is, grey without a check)



greyed out (that is, enabled but in a filled-with-grey state)



The last is usually the "third state" of a tri-state checkbox.

Re: True, False, or Yellow

2005-07-21 20:48 • by Anonymous
38951 in reply to 38943
loneprogrammer:
Anonymous:

  bool HasDst = (tzi.DaylightDate.wMonth == 0) ? false : true;



That is simply redundant, but not wrong.


Would you truly suggest that this line of code should not have been written as,


   bool HasDst = tzi.DaylightDate.wMonth!=0;


?


That aside, since when do WTFs have to do with right and wrong?  If the code compiles, does that make it right?  If redundancies are no longer WTFs, maybe we should have Alex remove the post at http://www.thedailywtf.com/forums/32119/ShowPost.aspx, and a few others.

Re: True, False, or Yellow

2005-07-21 21:01 • by loneprogrammer
38952 in reply to 38951
Anonymous:
Would you truly suggest that this line of code should not have been written as

bool HasDst = tzi.DaylightDate.wMonth!=0;

I'm not making a statement for or against that. Both ways do exactly the same thing and they are both one line of code. If that were the biggest "WTF" in my daily life, I would be happy.

I would write it your way, but if someone told me it is more readable to use the "? true : false" method, I would not call the kode kops to have them taken away.

Re: True, False, or Yellow

2005-07-21 22:43 • by gcon
38955 in reply to 38925
I know exactly which third party controls you are talking
about...Infra...whatever you get the GIST. Regardless of whether
tri-states are a WTF, the way they are implemented by this ISV is a
WTF. In most circumstances, the enum for DefaultableBoolean is
redeclared in every namespace, instead of being in some common
namespace.



For example, a control's property such as
Namespace.Object1Namespace.Object1.Visible isn't just of type
Namespace.DefaultableBoolean, it's of type
Namespace.Object1Namespace.DefaultableBoolean. That way if you have
Namespace.Object2Namespace.Object2.Visible, you need to use
Namespace.Object2Namespace.DefaultableBoolean.



Extreme WTFery with every control I have ever used w/ from vendor [but
when you figure it all out (because there is no documentation) the
controls look really pretty :P ].

Re: True, False, or Yellow

2005-07-21 23:25 • by Annonymous
38956 in reply to 38949
Maurits:
CornedBee:


Or it could mean "partially true", because not everything is black and
white. Just look at the checkboxes in Windows - checked, not checked,
or grey-checked




Actually I've seen at least five checkbox states.



checked

unchecked



checked and disabled (that is, grey with a check)

unchecked and disabled (that is, grey without a check)



greyed out (that is, enabled but in a filled-with-grey state)



The last is usually the "third state" of a tri-state checkbox.




Check/uncheck and enabled/disabled are two separate states,
enabled/disabled belonging to the base "window" object and
check/uncheck belonging to the checkbox object that is a child of
window.



Also the checkbox state is stored as an INT rather than a bool, thus allowing the tri-state check/uncheck/grey.

Re: True, False, or Yellow

2005-07-22 00:39 • by vhawk
38958 in reply to 38903
mizhi:
Pesky booleans.  Just a special case of an enum.



Could've been worse... he could've quantized the values between 0 and

1 on a float.



#define FALSE 0.0f

#define ALMOST_FALSE 0.1f

#define NOT_QUITE_FALSE 0.2f

#define COIN_FLIP 0.5f

#define MAYBE_TRUE 0.6f

#define PROBABLY_TRUE 0.7f

#define ALMOST_CERTAINLY_TRUE 0.8f

#define TRUE 1.0f






And don't forget



#define A_DEFINITE_MAYBE 1.0f





Re: True, False, or Yellow

2005-07-22 01:20 • by Drak
38959 in reply to 38958

At least with a tristate bool you can work around those pesky 'Assertion Failed' errors [;)]


if (true)
   alert("Yes");
else
   alert("No");
otherwise
   alert("Dunno");


Now that looks silly even to myself [:$]


Drak

Re: True, False, or Yellow

2005-07-22 01:21 • by Phelyan Sanjoin
38960 in reply to 38934

Oh, don't get me started on Boolean objects in Java. How about this construct, then:

try {
if( testValue.equals( Boolean.TRUE ) ) {
// something
}
else if( testValue.equals( Boolean.FALSE ) ) {
// something else
}
}
catch( NullPointerException npe ) {
// something completely different
}

Doesn't that bring a tear to the eye? Fortunately I was able to stop the programmer in time.

Re: True, False, or Yellow

2005-07-22 01:42 • by Aristotle Pagaltzis
38961 in reply to 38912
Ross Day:
For example, in Perl, you so often see just if ($foo) to check if the variable is defined and not null.  The same thing happens in a lot of languages, but these vague statements can have bad effects, like when 0 or the emptry string becomes a valid value for $foo.  When there is a built-in defined() function (same thing in PHP...isset() built-in) or when you could just check != null), I amaze even myself when I do the same thing of just putting if ($foo). I only change it when it comes back to bite me.

I consider overuse of defined and co to be a WTF. If you really mean to check whether a string contains anything, then yes, ( defined $str and length $str ) is the right conditional. But if $foo is a metasyntactic placeholder for $somebool in your example, then absolutely if( $somebool ) is the exact right thing to do.



Perl has a slightly peculiar, but very clear definition of truth: in scalar context, anything is true other than undef, the empty string, a numeric zero, or a string consisting of single 0 character. Checking for only one of these things specifically is bound to eventually get you in trouble with other people’s code. Particularly because in list context, anything other than the empty list is true.



A big WTF in Perl is saying return 0; to return a generic false. In context, that’s a list with a single element and actually means “true”. The right thing to do is to simply say return;, which will give the caller an undef in scalar context and an empty list in list context – both correctly false. You should only return 0; if you actually want to return a numeric zero.



The funny thing about Perl is that generally, the less work you do, the more correct and general your code is. Unfortunately, many people insist on using it like an awkward, strongly typed language instead of an expressive, weakly typed language, thereby playing to its weakness instead of its strength.

Re: True, False, or Yellow

2005-07-22 01:46 • by Aristotle Pagaltzis
38962 in reply to 38961
Aristotle Pagaltzis:
A big WTF in Perl is saying return 0; to return a generic false. In context, that’s a list with a single element and actually means “true”.

That was meant to say “In context, that’s a list with a single element” – I wish we could actually edit our posts.

Re: True, False, or Yellow

2005-07-22 01:47 • by Aristotle Pagaltzis
38963 in reply to 38962

Err, “In list context, that’s a list with a single element,” goddammit.

Re: True, False, or Yellow

2005-07-22 02:32 • by V.

I've seen this a lot actually, that's because a BOOL is an integer, not a real boolean.  Even the bool in MFC isn't a real bool.  I once searched a whole day why


if(somebool == true){
  // code here
}


else{
  // code here
}


kept going in the else even when somebool in the quickwatch gave true.  Seemed that even the bool type could have a tri-state. [^o)]
When I did


if(somebool){
  // code here
}


else{
  // code here
}

Re: True, False, or Yellow

2005-07-22 04:16 • by Justin
38967 in reply to 38913
Anonymous:
You know, this really isn't that bad.  He just extended the
functionality of the function without correctly refactoring like he
should have.  It's more of a comment on how C works than how the
coder works.  Just make "BOOL IsAdministrative" into "int
AdministrativeCode", and use 0 and 1 instead of TRUE and FALSE (or
better yet, make new named constants).  A select instead of ifs
would be more efficient, but that's nitpicking.  Could be much
worse.




No, no, no, no, no! 



This is a simple case of not understanding your own data
relationships.  He does not have one datum here, he has two data
which he has wrongly amalgamated into one, thus losing
orthogonality.  Just because only threads for administrators will
ever need to consider adding aggregates, he has treated them as a
special type of administrator.



The correct answer is a pair of booleans.  By all means stick them
in a bitfield, but then write a proper set of functions by checking
each bit value rather than by checking for equality against
values.  In other words...

If bit0 is the administrator flag, then bitwise-and with 1 and check for non-zero in whatever language you choose.

If bit1 is the administrator flag, then bitwise-and with 2 and check for non-zero in whatever language you choose.



Justin.

Oracle and Java Guru who really should get a login here.

Re: True, False, or Yellow

2005-07-22 05:06 • by foxyshadis
38968 in reply to 38937
Anonymous:
Come to think of it, I don't think I've ever read a trilogy that had
other than 5 book.   I've read several series with 3 novels,
but they were not called trilogies by anyone I can determine.  
I've read several trilogies that contain 5 novels.   (not
just the obvious one)



Unfortunatly I'm the type of guy who can never find his towel, hence I've been stuck on this backwater planet for years.


Every hack fantasy series is either a trilogy or a double trilogy.
(Trilogy of trilogies are reserved for the esteemed L. Ron.) It's book
publishers' weapon against good writing: drown a little quality in a
lot of quantity and hope people keep paying for it.



I was really disappointed that this code did not end with
isAdministrative == YELLOW. I'd have paid good money to see a code
snippet like that. (If it walks like a wtf and quacks like a wtf...
maybe it's a TRUE2.)



I guess you could define true as GREEN and false as RED if you wanted
to put it in a framework that made a goofy sort of sense... but
wouldn't it be so much more surreal to spot a YELLOW out of nowhere in
a couple of source files with no comment and no obvious definition?
HELL YES.



Alex, your title has finally inspired me to create code that will have
my corporate descendants upping their medication levels. Score!

Re: True, False, or Yellow

2005-07-22 05:23 • by RobIII
38970 in reply to 38898
Rank Amateur:

What a dork. He's supposed to use bitfields. What happens tomorrow when they need to cover the case of applying the adjustment to only aggregates?


Doesn't he know what BOOL means? Bitfield Object Operating as Long.


--Rank



What?


You do know he's supposed to use XML, throw in some Javascript and then, using an XSLT needs to validate it with some Instr, Left$, Right$ and Mid$ don't you? Tsssssk, developers these days... always looking for an easy way out.

« PrevPage 1 | Page 2Next »

Add Comment