• (unregistered)

    I hadn't noticed it had gone down, but it's certainly been very slow from time to time recently...

  • (unregistered)

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

    <FONT color=#a52a2a>public bool IsStringLength1( string s ) 
    {
        return s.Length==1;
    }</FONT>

    And of course to:

    <FONT color=#a52a2a>public bool IsStringLength2( string s ) 
    public bool IsStringLength3( string s )
    public bool IsStringLength4( string s )
    ...
    public bool IsStringLength1024( string s )</FONT>

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

    <FONT color=#a52a2a>public bool IsStringLengthEx( string s, int lengthToCheck )
    {
        return s.Length==lengthToCheck;
    }</FONT>

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

  • (unregistered)

    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
  • (unregistered)

    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.

  • (unregistered)

    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)

  • (cs)

    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.)

  • (unregistered) in reply to Bellinghman

    <FONT size=2>If IsTrue( IsTrue( IsTrue( IsTrue( IsTrue( IsTrue( IsTrue( IsTrue( objInstanceOfDocument.blnDocumentPropertyIsActive ) ) ) ) ) ) ) ) Then fn_DoStuff() </FONT>

    Cant get any crystal clearn than this

  • (unregistered)

    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.  [:)]

  • (cs) in reply to

    :
    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.

  • (unregistered) in reply to DJDanny

    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.

  • (unregistered)

    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

  • (cs)

    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?)
  • (unregistered)

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

  • (unregistered)

    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.

  • (cs)

    I have 1and1 hosting; both dedicated server and normal hosting and I have no complaints whatsoever.

  • (cs)

    Private bNotTrue, bNotFalse as Boolean

    <FONT face="Courier New">Public Function IsFalse(bFalse) as Boolean
       If Not IsTrue(bNotTrue) <> False Then
               Return (bNotTrue = bNotFalse)
       End If
    End Function</FONT>

  • (unregistered)

    From Code Complete 2d ed (p 287):<p>

    Coding Horror

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

    <font face="Courier New"> if if = then then

      then = else;

    else else = if;</font>

  • (unregistered)

    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.

  • (cs)

    Why not

    <FONT face="Courier New">If Not IsTrue(objInstanceOfDocument.blnDocumentPropertyIsActive) = IsTrue(False) Then fn_DoStuff()</FONT>

  • (unregistered) in reply to Goudinov

    @Goudinov - that is hilarious

  • (unregistered)

    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/

  • (unregistered) in reply to DJDanny
    DJDanny:

    [image]  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.  

  • (cs)
    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...

  • (unregistered)

    You could also try Joe's Web Shack...your credit card may get charged, but don't expect anything in return.

  • (cs) in reply to
    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?

  • Anonymous coward (unregistered)

    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?

  • ethical_anarhist (unregistered)

    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.

  • (cs) in reply to ethical_anarhist

    Surely we don't have to explain why the string class has a tostring method, Mr. Troll!

    -blue

  • (cs) in reply to

    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;

    }

  • Me (unregistered) in reply to ethical_anarhist
    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.

Leave a comment on “Return of IsTrue()”

Log In or post as a guest

Replying to comment #:

« Return to Article