• ParkinT (unregistered)

    This is obviously VB. With the VB VARIANT type, I would expect TRUE, FALSE and HALF-TRUE.

  • (cs)

    It could fail if File Not Found or in this case Email List Not Found nods sagely

  • cheap shot (unregistered)

    This is good, simple, robust coding. Enterprise-ready.

  • (cs)

    Simple.

    It may throw a YouCantHandleThisException

  • (cs)

    Likely a stub function that was intended to be expanded later and was never completed.

  • Kaine (unregistered)

    It was probably set up for the debugger and the function's true purpose--excuse the pun--was never implemented. Put a breakpoint on the return statement, run the code, and wait for the breakpoint to be hit. You then have the option to set "return false" as the next statement and see how the rest of your code handles it.

    Granted, it should have been either removed from production or completed.

  • (cs)

    The Truth Is Out There

    (no, this is not spam)

  • (cs)
    Public Function AFewGoodMails() As Boolean
        Try
            Return True
        Catch ex As Exception
            'YOU CAN'T HANDLE THE TRUTH!!!
            Return False
        End Try
    End Function
    
    
  • Planet (unregistered)

    That is rather common on politics, where the True is ridiculed and the False reigns more often than not.

    In programming, however, the real fail is on a different level - a placeholder template, in which probably not rarely only the first part is replaced by code that makes any sense. The result is what I call exception munching.

  • Marius (unregistered)

    How can truth fail? Just ask a politician!

  • DHK (unregistered)

    TRWTF is

    Public Function EmailList() As Boolean

  • Anon Too (unregistered)

    Public Function WTF() As Boolean Try Return CBool("Frist") Catch ex As Exception Return CBool("File not Frist") End Try End Function

  • Steve (unregistered) in reply to Anketam
    Anketam:
    It could fail if File Not Found or in this case Email List Not Found *nods sagely*

    I'm guessing you're being sarcastic or something, but just in case you're not - how could it possibly fail? It's an empty function, it doesn't try to load a file or an email list.

  • (cs)

    This look like VB .NET which is not same as VB. Of course Java is moraly superior to all these .NET stuff langeuages.

  • cacarpenter (unregistered) in reply to Steve
    Steve:
    Anketam:
    It could fail if File Not Found or in this case Email List Not Found *nods sagely*

    I'm guessing you're being sarcastic or something, but just in case you're not - how could it possibly fail? It's an empty function, it doesn't try to load a file or an email list.

    http://thedailywtf.com/Articles/What_Is_Truth_0x3f_.aspx

  • Steve (unregistered)

    There was probably some exception throwing code in there at one point. Now that the code is no longer needed, it was just replaced with "return true" rather than just not calling the method. Wouldn't want to breakup some horribly complex logic when you can just return true. Plus, there's no harm in a little extra defense in your coding, no? I mean, after all, it does work. I could see myself doing this....when I was in high school.

  • Gordon Freeman (unregistered)

    Someone is going to say there probably was some code inside that was removed (probably when all of the email list's mail providers moved the company's domain to their antispam filter).

    That someone is then going to say this is not a WTF, because whatever has an explanation cannot be a WTF, for some reason.

  • (cs)

    Hopefully this is the remnant of formerly more complex code that was refactored.

    Also, he forgot to add 'finally'.

  • tim (unregistered) in reply to cacarpenter
    cacarpenter:
    Steve:
    Anketam:
    It could fail if File Not Found or in this case Email List Not Found *nods sagely*

    I'm guessing you're being sarcastic or something, but just in case you're not - how could it possibly fail? It's an empty function, it doesn't try to load a file or an email list.

    http://thedailywtf.com/Articles/What_Is_Truth_0x3f_.aspx

    zomg - that was over 6 years ago :-O

  • Hater (unregistered) in reply to frits
    frits:
    End Try

    You have no support on this site. You're alone. Stop trying.

  • Stop! ...Zunner-Time! (unregistered) in reply to Hater
    Hater:
    frits:
    End Try
    You have no support on this site. You're alone. Stop trying.
    I'll keep him company.

    Don't you have a baby, frits? I've got $200 in my wallet right now, let's do this thing!

  • monkeyPushButton (unregistered) in reply to tim
    tim:
    cacarpenter:
    Steve:
    Anketam:
    It could fail if File Not Found or in this case Email List Not Found *nods sagely*

    I'm guessing you're being sarcastic or something, but just in case you're not - how could it possibly fail? It's an empty function, it doesn't try to load a file or an email list.

    http://thedailywtf.com/Articles/What_Is_Truth_0x3f_.aspx

    zomg - that was over 6 years ago :-O
    And also the "fish" option: http://thedailywtf.com/Articles/Go-Fish.aspx

  • abadidea (unregistered) in reply to Steve
    Steve:
    Anketam:
    It could fail if File Not Found or in this case Email List Not Found *nods sagely*

    I'm guessing you're being sarcastic or something, but just in case you're not - how could it possibly fail? It's an empty function, it doesn't try to load a file or an email list.

    And I thought I didn't spend enough time here to know the memes :)

  • boog (unregistered) in reply to Hater
    Hater:
    frits:
    End Try

    You have no support on this site. You're alone. Stop trying.

    Who cares?

  • rd (unregistered) in reply to Steve

    How could it possibly fail? Well, I don't know... but why would the programmer have written failure handling code if it couldn't possibly fail? Answer that, Mr. Smarty Pants!

  • (cs) in reply to Lockwood
    Lockwood:
    Simple.

    It may throw a YouCantHandleThisException

    You win the Internets today!

  • (cs) in reply to frits
    frits:
    Public Function AFewGoodMails() As Boolean
        Try
            var iWantTheTruth = True
            Return iWantTheTruth
        Catch ex As YouCantHandleTheTruthException
            Return False
        End Try
    End Function
    
    FTFM
  • (cs) in reply to boog
    boog (surrogate):
    Hater:
    frits:
    End Try

    You have no support on this site. You're alone. Stop trying.

    Who cares?
    Thank you sir.

  • (cs) in reply to Hater
    Hater:
    You have no support on this site. You're alone.
    So? You come off like a butthurt bitch. What's your problem?
  • (cs) in reply to boog
    boog:
    boog (surrogate):
    Hater:
    frits:
    End Try

    You have no support on this site. You're alone. Stop trying.

    Who cares?
    Thank you sir.
    So you've finally adopted him/it?

  • Stop! ...Zunner-Time! (unregistered) in reply to C-Octothorpe
    C-Octothorpe:
    frits:
    Public Function AFewGoodMales() As String
        Try
            var bBackdoor = "OOOOOOOOHhhhhhhhh, Yeah!"
            Return bBackdoor
        Catch ex As OutOfLubeException
            Return "Ouch" 'The Good Kind
        End Try
    End Function
    
    FTFM
    FTF
  • Andreas (unregistered)

    look no further than the next election...

  • (cs) in reply to Hater
    Hater:
    frits:
    End Try
    You have no support on this site. You're alone. Stop trying.
    Whatever you're trying to do isn't working. Not even kind-of.

    But you hopelessly persevere. It's so inspiring...

  • (cs) in reply to frits
    frits:
    Hater:
    You have no support on this site. You're alone.
    So? You come off like a butthurt bitch. What's your problem?
    I dunno, kinda sounds like he's projecting...
  • (cs) in reply to C-Octothorpe
    C-Octothorpe:
    boog:
    boog (surrogate):
    Who cares?
    Thank you sir.
    So you've finally adopted him/it?
    No, but he does get it right once in a while, and in such cases I must commend him. Positive reinforcement, and all.
  • (cs) in reply to Stop! ...Zunner-Time!
    Stop! ...Zunner-Time!:
    C-Octothorpe:
    frits:
    Public Function AFewGoodMales() As String
        Try
            var bBackdoor = "OOOOOOOOHhhhhhhhh, Yeah!"
            Return bBackdoor
        Catch ex As OutOfLubeException
            Return "Blood"
        End Try
    End Function
    
    FTFM
    FTF
    FTFY. Amature...
  • gosse (unregistered)

    Obviously C++:

    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    
    #define Public int wtf() { srand ( (unsigned int)time(NULL) ); if( rand() % 2 == 0) throw 0; return 1; } int
    #define Function
    #define EmailList main
    #define As
    #define Boolean { try {
    #define Try
    #define Return return printf("%d",
    #define True wtf());
    #define Catch } catch(
    #define ex int exc)
    #define Exception {
    #define False exc);
    #define End }
    
    Public Function EmailList() As Boolean
    	Try
    		Return True
    	Catch ex As Exception
    		Return False
    	End Try
    End Function
    
  • (cs)

    This is clearly an attempt to address Russell's Paradox, albeit a poorly conceived one.

  • (cs) in reply to frits

    Then you certainly can understand him ;)

  • (cs)

    More than likely placeholder code that was never actually finished - I've seen it often.

    What really, really, really, really bugs me though is having methods that have an int/bool return value to indicate success/failure when the method is filling an object or performing an action, such as loading something from the database or, in this case, sending emails. My work's code is littered with things like this:

    public class Foo
    {
        // Properties...
    
        public bool Load()
        {
            if (this.m_Id = 0)
                throw new Exception("FooID must be set before using this");
            // retrieve stuff from database
    
            bool bResult = false; 
            if (dr.HasRows)
                bResult = true;
    
            return bResult;
        }
    }
    
    // Usage
    Foo oFoo = new Foo();
    oFoo.FooID = 42;
    if (oFoo.Load()) 
    {
        // Do stuff...
    }
    

    Really bugs me, as it should be a static method (or, better yet, use a DAO/Gateway/Repository/etc) that returns the Foo object or throws an error (or, better use, uses the NULL OBJECT pattern).

  • goob (unregistered) in reply to serguey123
    serguey123:
    Then you certainly can understand me ;-)
    FTFY
  • Ken B. (unregistered)
    Try
    [...]
    End Try
    The programmer who wrote this needs to listen to Yoda, and program in C instead. Do or do not. There is no "try".
  • (cs) in reply to C-Octothorpe
    C-Octothorpe:
    frits:
    Hater:
    You have no support on this site. You're alone.
    So? You come off like a butthurt bitch. What's your problem?
    I dunno, kinda sounds like he's projecting...

    Whatever, I guess when the daily posting is another round of a dead function reduced to a return true and not fully excised from the code, there's not a lot to say that's very pointful. Off you go, Hater. Knock yourself out. Just remember to put on your real fake identity if you think of anything clever to say.

    EDIT ('cause I'm legit now!): What would it mean to "have support on this site" anyway?

  • justn (unregistered) in reply to BTrey
    BTrey:
    Likely a stub function that was intended to be expanded later and was never completed.

    fo sho.

  • Ken B. (unregistered)

    So, what happens if the answer is FILE_NOT_FOUND, and the "Return False" fails, too?

  • Stop! ...Zunner-Time! (unregistered) in reply to C-Octothorpe
    C-Octothorpe:
    Stop! ...Zunner-Time!:
    C-Octothorpe:
    frits:
    Public Function AFewGoodMales() As String
        Try
            var bBackdoor = "OOOOOOOOHhhhhhhhh, Yeah!"
            Return bBackdoor
        Catch ex As OutOfLubeException
            If pTarget.Name = "C-Octothrope" Then
                Return "More blood? We need to break you in, Twink!"
            Else If pTarget.Name = "Zunesis" Then
                Return "Hey! I thought I told you to stop shitting on me!"
            End If
        End Try
    End Function
    
    FTFM
    ZTFY
    FTFY. Amateur...
    "Toot! Toot!"

    No, you see now you've caused a semantic inconsistency, which is not in keeping with my joke. Doesn't work. Sorry.

    And if you're still getting blood, ask yourself who the real amateur is. If you were more practiced (like me), you'd be a little tougher maybe.

  • Ken B. (unregistered) in reply to BTrey
    BTrey:
    Likely a stub function that was intended to be expanded later and was never completed.
    Unlikely, as there was no
    ' TODO: everything
    marker.
  • Nagesh (unregistered) in reply to Ken B.
    Ken B.:
    Try
    [...]
    End Try
    The programmer who wrote this needs to listen to Yoda, and program in C instead.
    Yoda is programing in Forcetran only.
  • (cs) in reply to Nagesh
    Nagesh:
    Ken B.:
    Try
    [...]
    End Try
    The programmer who wrote this needs to listen to Yoda, and program in C instead.
    Yoda is programing in Forcetran only.
    Oh come on... He's not *that* old!
  • (cs)
    I've just gotten so used to it that it doesn't faze me anymore.
    Set your fazers to WTF!
    But recently, when I was tracking down a bug, found this very special code.
    I sure hope you did the right thing:
    Public Function EmailList() As Boolean
        Try
            Return True
        Catch ex As Exception
            Log.print("Oh crap - we are not running in the correct Universe\n");
            Return False
        End Try
    End Function

Leave a comment on “The True Alternative”

Log In or post as a guest

Replying to comment #:

« Return to Article