Comment On Return of IsTrue()

Holy fricken' time-for-a-new-host! Jeeze ... the idea with going dedicated was to improve reliability ... but the site has been down since this morning. So if anyone knows of a good data center offering a package for around $150/month who will install Small Business Server, please let me know. [expand full text]
« PrevPage 1Next »

Re: Return of IsTrue()

2004-12-24 05:20 • by
I hadn't noticed it had gone down, but it's certainly been very slow from time to time recently...

Re: Return of IsTrue()

2004-12-24 05:21 • by

Funny [:)]. That could lead to a similar function:

public bool IsStringLength1( string s ) 
{
    return s.Length==1;
}

And of course to:

public bool IsStringLength2( string s ) 
public bool IsStringLength3( string s )
public bool IsStringLength4( string s )
...
public bool IsStringLength1024( string s )

and finally of course custom defined for sizes other than 1..1024:

public bool IsStringLengthEx( string s, int lengthToCheck )
{
    return s.Length==lengthToCheck;
}

Happy Holiday greetings from Germany [;)]
Uwe (www.magerquark.de)

Re: Return of IsTrue()

2004-12-24 06:40 • by
Well this function would be useful if you were using some form of
std::copy_if()-like function which requires a predicate to function.
Obviously the code is the work of a programmer that understands these
things on a higher level than mundane coders.



- Factory

Re: Return of IsTrue()

2004-12-24 07:53 • by

This could be a layer of abstraction that the programmer intends to use later for more discriminatory handling.  For example, he might later wish to treat 0 and 10 as false, but 1-9 as true.  Confining all Boolean tests to this single point of inflection would allow him this flexibility.


 


Given, he ought to have commented it accordingly if that were his intention.

Re: Return of IsTrue()

2004-12-24 09:02 • by
http://mindprod.com/unmain.html



That's where they get their ideas. No question. Also very funny, I
recommend all coders read it (but they have a LOT of misunderstandings
of how the C preprocessor works)

Re: Return of IsTrue()

2004-12-24 09:09 • by Bellinghman
Alex Papadimoulis: "Now lets see how it looks when we employ best practices and the the IsTrue function:

If IsTrue( objInstanceOfDocument.blnDocumentPropertyIsActive ) Then fn_DoStuff()

Crystal. Clarity."

No, no, no!

You've only followed your best practices one stage. Now step back and apply them a second time:

If IsTrue( IsTrue( objInstanceOfDocument.blnDocumentPropertyIsActive ) ) Then fn_DoStuff()

And continuing on that track a little further:

If IsTrue( IsTrue( IsTrue( IsTrue( IsTrue( IsTrue( IsTrue( IsTrue( objInstanceOfDocument.blnDocumentPropertyIsActive ) ) ) ) ) ) ) ) Then fn_DoStuff()


(BTW - I'm sure a LiveJournal community would do this site pretty well. At least the preview actually previews.)

Re: Return of IsTrue()

2004-12-24 09:18 • by
27010 in reply to 27009

If IsTrue( IsTrue( IsTrue( IsTrue( IsTrue( IsTrue( IsTrue( IsTrue( objInstanceOfDocument.blnDocumentPropertyIsActive ) ) ) ) ) ) ) ) Then fn_DoStuff()


Cant get any crystal clearn than this

Re: Return of IsTrue()

2004-12-24 09:21 • by
As far as the web hosting goes, how about www.1and1.com, they seem to
have reasonable prices and offer dedicated servers and other packages
offering Server 2003 with MSSQL.  I have personally never used
them, but their rates and infrastructure seems to be good from what I
have read.  [:)]

Re: Return of IsTrue()

2004-12-24 09:58 • by DJDanny
27012 in reply to 27011

:
As far as the web hosting goes, how about www.1and1.com, they seem to have reasonable prices and offer dedicated servers and other packages offering Server 2003 with MSSQL.  I have personally never used them, but their rates and infrastructure seems to be good from what I have read.  Smile


I haven't used 1and1 for hosting, but I got a domain name through them once, and it was rubbish. They wouldn't even let me manage my own DNS, and there was some crappy web-based admin tool which only let you setup redirects, or a crappy frames page which LOOKS like it's pointing to www.yourdomain.com, but really just has one frame in it pointing to the IP of your choice!


Needless to say, I switched registrars as soon as the 60 day limit expired.

Re: Return of IsTrue()

2004-12-24 12:14 • by
27014 in reply to 27012
Also avoid finesthost.com. Recently my site was down for 2 days; no
mention anywhere on their homepage that they were having problems and
no response to email; their phone goes straight to an answering
machine. They also have an occasional irritating habit of turning PERL
off, so you get the script downloaded rather than have the server
execute it. This usually persists for a few days and then goes away
again and starts working.



Their webmail also looks dreadful, like it was written by a marketing intern or something.



If anybody could recommend a hosting company that isn't a load of crap I'd be interested to hear as well.

Re: Return of IsTrue()

2004-12-24 12:46 • by
I highly recommend DreamHost for hosting--they've done nothing but exceed my expectations by adding features and increasing the bandwidth/storage limits of my hosting plan as time has gone on. (Note that the above is an affiliate link, but I recommended them even before I knew about that program.)

BTW, thanks for the site--the WTFs really brighten my day sometimes!

--Joe Hughes

Re: Return of IsTrue()

2004-12-24 16:04 • by Irrelevant
nonono, it should be like this:


Function HowBigIsMyCallStack_IsTrue (test)
Try
HowBigIsMyCallStack_IsTrue(test)
Catch e As Exception
HowBigIsMyCallStack_IsTrue = test
End Try
End Function


to ensure that everything is as well-wrapped as possible on every system.




BTW, I second the proposal of moving to LJ. The current forum software
is full of WTFs even before you post on it. (<font> tags, anyone?)

Re: Return of IsTrue()

2004-12-26 00:01 • by
You know in late nights of programming I've made some poor choices by
reimplementing core functionality because I couldn't remeber that it
was there, but forgetting about how an if statement works is just too
much.



When you get these in do you find out if the person creating the code
is a programmer or an excel "expert" who got slapped into that role.



I think that part of the problem is how this is tought in
college.  Coming back from working for almost 10 years and
"learning" languages in a Computer Engineering program I realize that
they spend so much time trying to keep you from cheating and making
exams that have so little to do with "development" in the first place.



Sorry ramble.....

Re: Return of IsTrue()

2004-12-26 19:10 • by
Try this company out for hosting and you'll never regret it:

http://www.corbimite.com/



Contact the owner Frank Zander ( the owner ) directly and tell him
Cornbread sent you ( no I'm not joking I do admin on some forums on one
of the sites he hosts under that login name so he will know who you are
talking about ). Hosting will be way cheaper than anything else you can
find. He has something like two miles of servers and it never goes
down. Power to the building is redundant and everything has backup
systems. Halon fire supression too. I have never had anywhere give as
consistant and awesome service as they do. I don't get anything for
recommending this service to people I just believe it's the best you'll
find so I recommend it whenever I get the chance. My e-mail if you want
to contact me directly with any questions is andy underscore canfield
at hotmail dot com.

Re: Return of IsTrue()

2004-12-27 11:13 • by Jacob K
I have 1and1 hosting; both dedicated server and normal hosting and I have no complaints whatsoever.

Re: Return of IsTrue()

2004-12-28 10:45 • by Goudinov

Private bNotTrue, bNotFalse as Boolean


Public Function IsFalse(bFalse) as Boolean
   If Not IsTrue(bNotTrue) <> False Then
           Return (bNotTrue = bNotFalse)
   End If
End Function

Obligatory McConnell Tie-In

2004-12-28 11:22 • by
From Code Complete 2d ed (p 287):


Coding Horror


For example, the following code fragment is legal in PL/I, but you would be a certifiable idiot to use it:


if if = then then


  then = else;


else else = if;



Re: Return of IsTrue()

2004-12-28 14:35 • by
Quite seriously, I worked with a Java programmer who used to check his bool variables against true and false:



if (foo == true)

  ....



I tried suggesting that he change it to



if ((foo == true) == true)

  ....



But he didn't get it.



Re: Return of IsTrue()

2004-12-29 19:06 • by gondalez
Why not

If Not IsTrue(objInstanceOfDocument.blnDocumentPropertyIsActive) = IsTrue(False) Then fn_DoStuff()

Re: Return of IsTrue()

2005-01-05 08:53 • by
27322 in reply to 27056
@Goudinov - that is hilarious

Re: Return of IsTrue()

2005-01-10 18:29 • by
Your best hosting bet is almost certainly ServerMatrix.  Good
prices, ridiculous redundancy.  They're the entry level division
of "The Planet" (in case you've heard of them).



http://www.servermatrix.com/



Re: Return of IsTrue()

2005-02-03 14:17 • by
28962 in reply to 27012
DJDanny:








  wrote:




As far as the web hosting goes, how about www.1and1.com, they seem to have reasonable prices and offer dedicated servers and other packages offering Server 2003 with MSSQL.  I have personally never used them, but their rates and infrastructure seems to be good from what I have read.  Smile


I haven't used 1and1 for hosting, but I got a domain name through them once, and it was rubbish. They wouldn't even let me manage my own DNS, and there was some crappy web-based admin tool which only let you setup redirects, or a crappy frames page which LOOKS like it's pointing to www.yourdomain.com, but really just has one frame in it pointing to the IP of your choice!


Needless to say, I switched registrars as soon as the 60 day limit expired.



 


 


Umm yeah, you can change DNS without problem in 1&1... they have a DNS section in the control panel.   I had messed around with an FTP server running off my local machine for a while.  Changed hosting on other domains as well.  

Re: Return of IsTrue()

2005-02-03 16:46 • by Katja
Alex Papadimoulis:

Holy fricken' time-for-a-new-host! Jeeze ... the idea with going dedicated was to improve reliability ... but the site has been down since this morning. So if anyone knows of a good data center offering a package for around $150/month who will install Small Business Server, please let me know.


Try http://www.siteturn.com because they cost around $150 per year, not per month. [;)] But okay, their quality might not be that high either...

Re: Return of IsTrue()

2005-02-03 17:41 • by
You could also try Joe's Web Shack...your credit card may get charged, but don't expect anything in return.

Re: Return of IsTrue()

2005-03-21 17:36 • by dubwai
31504 in reply to 27007
Anonymous:

This could be a layer of abstraction that the programmer intends to use later for more discriminatory handling.  For example, he might later wish to treat 0 and 10 as false, but 1-9 as true.  Confining all Boolean tests to this single point of inflection would allow him this flexibility.


 


Given, he ought to have commented it accordingly if that were his intention.



Sorry I don't get this at all.  The input is boolean the output is boolean.  All the developer can is change IsTrue to evaluate to a not which would be pretty stupid.  Or am I missing something?

Re: Return of IsTrue()

2005-03-23 04:34 • by Anonymous coward

Sorry, but I don't see something after scanning the replies...


If test happens to be Null, is it true or false? And if it's Form1?

Re: Return of IsTrue()

2005-04-26 03:06 • by ethical_anarhist
But then there are things like
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#toString()
out there, and nobody seems to notice.

Re: Return of IsTrue()

2005-04-26 16:58 • by Blue
33355 in reply to 33311
Surely we don't have to explain why the string class has a tostring method, Mr. Troll!



-blue



Re: Return of IsTrue()

2005-04-29 10:58 • by TickleMeElmo
33554 in reply to 27073

My favourite WTF is one that I see on nearly every large project I work on, at least once:  "<boolean expression> ? true : false".


You can tell that someone has just discovered the magic elegance of the ternary operator.


Another common one:


if (<boolean expression>) {


   return true;


} else {


   return false;


}

Re: Return of IsTrue()

2007-10-06 07:37 • by Me (unregistered)
156228 in reply to 33311
ethical_anarhist:
But then there are things like
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#toString()
out there, and nobody seems to notice.


I will be charitable and assume you are not a troll, but the reason that String implements toString() is because Object has a toString method, which is somewhat brain-dead and is expected to be overridden in every child class.
« PrevPage 1Next »

Add Comment