• Bednee (unregistered)

    Actually, the way to open a link in a new window makes sense. The reason is that "target" attibute isn't valid in some XHTML doctype (I believe it's Strict, which else right). So in order to keep validity it has to be done this way.

  • the beholder (unregistered)

    How the hell someone creates a 83-parameter function and doesn't see anything wrong with that?

    One can achieve only so much FAIL, FAIL, FAIL .

  • (cs)

    There's a cogent reason for defining SLASH = "/" and PERCENT as "%". They're control characters. When you want to build a string using them, in certain contexts, you don't want to muddy the waters by having to remember to escape them. Often more trouble-free to do it this way.

  • Se (unregistered) in reply to Bednee
    Bednee:
    Actually, the way to open a link in a new window makes sense. The reason is that "target" attibute isn't valid in some XHTML doctype (I believe it's Strict, which else right). So in order to keep validity it has to be done this way.

    Agreed. That one isn't a WTF.

  • (cs) in reply to the beholder
    the beholder:
    How the hell someone creates a 83-parameter function and doesn't see anything wrong with that?

    One can achieve only so much FAIL, FAIL, FAIL .

    How the hell someone counts the parameters to an 83-parameter function and doesn't see anything wrong with that? Get back to work immediately!

  • the beholder (unregistered)

    true1: twice as false as any plain, regular false booleans out there.

    I'll propose John D. to change the code to

    bool true1 =true;
    bool true12 = true;
    .... snip ....
    true1 = false;
    true1 = false;

    for thrice the falseness.

  • anony-mouse (unregistered) in reply to Bednee
    Bednee:
    Actually, the way to open a link in a new window makes sense. The reason is that "target" attibute isn't valid in some XHTML doctype (I believe it's Strict, which else right). So in order to keep validity it has to be done this way.
    Indeed. Remember, blame the developer before being open minded about why they would do something a certain way.
  • My Name (unregistered)

    link text

    I don't know more than HTML basics, so I assume there is a way to do this without Javascript? Otherwise, I don't see the wtf.

  • Konrads (unregistered)

    The X-Backside-transport FAIL FAIL comes from IBM WebSphere DataPower SOA and it says it when it can't service the request.

  • ¯\(°_o)/¯ I DUNNO LOL (unregistered)

    Hmm, that seems to be missing something...

    bool filenotfound1 =true; bool filenotfound12 = true; .... snip .... filenotfound1 = false; filenotfound1 = false;
    Much better.

  • (cs)

    Clearly, the programmer in example 3 had practice for the company softball team on his mind.

  • SergeS (unregistered) in reply to My Name
    My Name:
    link text

    I don't know more than HTML basics, so I assume there is a way to do this without Javascript? Otherwise, I don't see the wtf.

    Yes, but this is not valid XHTML way

  • the beholder (unregistered) in reply to the beholder
    the beholder:
    true1: twice as false as any plain, regular false booleans out there.

    I'll propose John D. to change the code to

    bool true1 =false;
    bool true12 = true;
    .... snip ....
    true1 = false;
    true1 = false;

    for thrice the falseness.

    FTFM. Stupid work-related hurry...

  • (cs) in reply to My Name
    My Name:
    link text

    I don't know more than HTML basics, so I assume there is a way to do this without Javascript? Otherwise, I don't see the wtf.

    Yep. You can just set "_blank" as the target attribute of the a tag, statically, in the HTML code, without using JS at all.

    [Edit:added example]
  • (cs) in reply to QJo
    QJo:
    the beholder:
    How the hell someone creates a 83-parameter function and doesn't see anything wrong with that?

    One can achieve only so much FAIL, FAIL, FAIL .

    How the hell someone counts the parameters to an 83-parameter function and doesn't see anything wrong with that? Get back to work immediately!

    What makes you think he manually counted? All you have to do is copy and paste it into the editor of your choosing and get the line number.

  • Darth Paul (unregistered)

    Johnny B Guid... tee hee.

  • x (unregistered)
    "The comment says it all," wrote Michael.
         /**
         * Defines the value for none. Default is "none".
         */
        public static String NONE = "none";
    Say you are dealing with an API like this:
       
       bool Framework.Object.SetData(string key, string value);
       string Framework.Object.GetData(string key);
    
    You can write code like this:
       
       Object o = Framework.FindObject(x);
       if (o.GetData("foo") == "bar") { /* do stuff */ }
    
    Or, like this:
       
       public static class Keys {
          public static readonly string FOO = "foo";
       }
       public static class Values {
          public static readonly string BAR = "bar";
       }
       Object o = Framework.FindObject(x);
       if (o.GetData(Keys.FOO) == Values.BAR) { /* do stuff */ }
    
    There may be any number of reasons why here, the NONE string is not readonly; indeed, the comment about it having a default value implies that it is specifically not intended to be.
  • Stefan (unregistered)

    /**

    • Defines the value for none. Default is "none". */ public static String NONE = "none";

    That ain't so bad. Probably just a text when a var. is empty. although something like String blankText = "none"; or would have been better.

  • Otto (unregistered) in reply to DaveK

    The "target" parameter is not valid in XHTML 1.0 Strict, so using it like that would not pass validation.

    You have to consider your use-case with HTML, basically. Which makes HTML the real WTF here.

  • Foo Bar (unregistered)

    If you read TDWTF via RSS, TRWTF was the bizarre indentation of the various paragraphs in this article.

  • $$ERR:get_name_fail (unregistered) in reply to x
    x:
    There may be any number of reasons why here, the NONE string is not readonly; indeed, the comment about it having a default value implies that it is specifically not intended to be.
    The WTF is not the string not being constant, it's the comment which - while being technically correct - includes no relevant information whatsoever.

    Anyone who got beyond the value assignment part of the tutorial understands that the value of NONE is initialized to "none" in this line. Relevant information would be the meaning of the variable in the code below and why it is initialized to "none".

  • XXXXX (unregistered)

    Can someone explain what's wrong with the JS validation?

    Looks like they are doing some crappy validation on the client side before sending it to the server for true validation.

  • Nagesh (unregistered) in reply to Stefan
    Stefan:
    /** * Defines the value for none. Default is "none". */ public static String NONE = "none";

    That ain't so bad. Probably just a text when a var. is empty. although something like String blankText = "none"; or would have been better.

    Ain't problem being veriable storage as Java is not creating new string instances when used insted of constants. Problem is coments redundancies (which some shops are actual requiring). I also try ain't to use redudancy coments instead trying to reword.

  • Nagesh (unregistered) in reply to Nagesh

    Also, value for NONE ain't being constant.

  • Nappy (unregistered)

    The HTML 4.0 specification took away the target attribute, but it added another attribute: rel. This attribute is intended to specify the relationship between the document that contains the link, and the target of the link. The specification defines a bunch of standard values for this attribute (e.g. next, previous, chapter, section), most of which have to do with relationships between small sections of a larger document. However, the spec leaves the developer free to use nonstandard values for site-specific purposes.

    http://www.sitepoint.com/standards-compliant-world/

  • $$ERR:get_name_fail (unregistered) in reply to XXXXX
    XXXXX:
    Can someone explain what's wrong with the JS validation?

    Looks like they are doing some crappy validation on the client side before sending it to the server for true validation.

    The WTFs are:

    1. using cryptic variable names t1 - t13
    2. copying the values of more verbose variables to them although all that is done with them is read them once.
    3. having a variable to store the return value of the function, and then always return immediately after setting it. Instead of "dataok = false; return(dataok);" you could just do "return false;"

    Another thing you could nag about is the lack of localization, but this might not be required when the target demographic of the website are only english-speakers.

  • That Guy (unregistered) in reply to XXXXX
    XXXXX:
    Can someone explain what's wrong with the JS validation?

    Indeed. The variable names suck, and the inconsistent use of the the return-value flag is sloppy, but those don't make this a WTF.

  • Charles (unregistered) in reply to Se

    Yup. I've done this before when we're trying to achieve XHTML 1.0 Strict doctype.

  • x (unregistered) in reply to $$ERR:get_name_fail
    $$ERR:get_name_fail:
    x:
    There may be any number of reasons why here, the NONE string is not readonly; indeed, the comment about it having a default value implies that it is specifically not intended to be.
    The WTF is not the string not being constant, it's the comment which - while being technically correct - includes no relevant information whatsoever.

    Anyone who got beyond the value assignment part of the tutorial understands that the value of NONE is initialized to "none" in this line. Relevant information would be the meaning of the variable in the code below and why it is initialized to "none".

    No relevant info whatsoever? Fast-forward two years when the code looks like this:

       /**
        * Defines the value for none.
        */
       public static String NONE = "nil";
    

    Perhaps there is no further explanation as to the purpose of this string elsewhere in comments or design docs. That would be bad. I see no problem, though, in a) indicating the intention of the variable where it is defined, and b) not documenting the entire system at this particular location.

  • (cs) in reply to Otto
    Otto:
    The "target" parameter is not valid in XHTML 1.0 Strict, so using it like that would not pass validation.

    You have to consider your use-case with HTML, basically. Which makes HTML the real WTF here.

    Links which open in new windows are TRWTF.

  • (cs) in reply to $$ERR:get_name_fail
    $$ERR:get_name_fail:
    ... which - while being technically correct - includes no relevant information whatsoever.

    Sort of like software documentation in that respect, then.

  • (cs) in reply to $$ERR:get_name_fail
    $$ERR:get_name_fail:
    3. having a variable to store the return value of the function, and then always return immediately after setting it. Instead of "dataok = false; return(dataok);" you could just do "return false;"

    I wondered about that, too, but it's also possible from what we see that dataok is a global variable (well, in which case it's not necessary to return it, unless it's to cancel the event bubbling up).

    But yeah, spot-on with the rest of the analysis (and in all likelihood, with this part, too).

  • (cs)

    I like how they need a byte to describe the sex of a client. That's very… modern of them…

  • (cs) in reply to Charles
    Charles:
    Yup. I've done this before when we're trying to achieve XHTML 1.0 Strict doctype.

    And the question is, "Why?"

    OK, if you have to do it to satisfy the client, then you gotta do what you gotta do to get paid. But the requirement (opening in a new window, not XTHML compliance) is and will always be TRWTF.

  • (cs)
    I guess GUID from our production db servers are better than local GUID

    For Type 1 Guids, there are some valid reasons for wanting all of the Guids from the same source. For Type 3 Guids, the reasons are different, less important, but still exist [however, I would be accused of being pedantic if I pointed out why...<grin>]

  • (cs)
    byte ClientSex,

    Kinky.

    (And only with ClientPermission, please ... )

  • Ben Jammin (unregistered) in reply to XXXXX
    XXXXX:
    Can someone explain what's wrong with the JS validation?

    Looks like they are doing some crappy validation on the client side before sending it to the server for true validation.

    It is totally cause he could've put t13 with the rest of the required fields. I mean... WTF...

    CAPTCHA: oppeto - You say oppeto, I say oppato

  • dark Yuris (unregistered) in reply to Stefan

    not bad indeed. it's just a workaround of not having language constructs like symbols in ruby.

  • (cs)
    public static final String SLASH = "/"; public static final String PERCENT = "%";
    I usually name constants for what they do:
    private static final String DELIMITER = "%";
    This way, if you need to change the value, you don't need to change the variable NAME everywhere.
  • (cs)

    This one is clearly cargo-cult programming:

    if ( resData.state() == RESOURCE_STATE_ACTIVE ) { elapsedTime.setBase( resData.startTime() ); if ( elapsedTime.diff() >= maxDuration ) { // Do one more validity check, the paranoid programmer knows // the state may have changed since the last check. if ( resData.state() == RESOURCE_STATE_ACTIVE ) { resourceActiveTooLong( resData ); } } }

    I'm strongly reminded of the test-lock-test pattern you often see with singleton creation.

  • (cs)
    Giga B wrote, "it's pretty serious about the number of parameters in functions.":

    byte ClientSex, string ClientFatherName,

    I applaud them for acknowledging more than 2 sexes, completely logical in some cultures.

    It gets creepy when really personal details about the guarantor gets recorded.

    byte? GuarantorSex string GuarantorFatherName, string GuarantorBirthPlace, string GuarantorCityAttendingToReg, string GuarantorJobActivity, string GuarantorJobPosition, string Guarantor*JobCodeWord*,

    Seems like provision for secret agencies as well, neat.

    Tinfoil hats looking good now, eh?

  • x (unregistered) in reply to snoofle
    snoofle:
    public static final String SLASH = "/"; public static final String PERCENT = "%";
    I usually name constants for what they do:
    private static final String DELIMITER = "%";
    This way, if you need to change the value, you don't need to change the variable NAME everywhere.

    Akismet won't let me post the code, but you also have the situation where you want to conditionally compile something like a platform-specific path separator.

  • $$ERR:get_name_fail (unregistered) in reply to dkf
    dkf:
    I like how they need a byte to describe the sex of a client. That's very… modern of them…
    With all the transgenders, pangenders, third-genders and their different flavors fighting for society recognition, a single byte might in fact not be enough to cover all relevant cases.

    Maybe a bunch of slider controls would do the trick.

    Captcha: genitus. How fitting.

  • emaN ruoY (unregistered)

    Object Orientation took a core dump and cried at Giga B's submission

  • big picture thinker (unregistered)
    Public Function Save() As Boolean
        Try
            SaveMeeting()
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    BS, this won't even "build". (That's is .NET's equivalent to "compile")

    The function doesn't return a value.

  • (cs)

    As a .Net developer, I ABHOR the "throw ex" construct: It strips the exception of its stack trace, making debugging harder.

  • (cs)

    Bunch of crap.

    Each code sample shown here with no explanation is like showing me a picture of an empty chair in front of a computer and then allowing me to guess what is wrong with the picture.

    What a damned waste of time.

  • (cs)
            Throw ex
    

    So much satisfaction in one line of code ... who hasn't wanted to do this at one time or another?

  • (cs) in reply to $$ERR:get_name_fail
    $$ERR:get_name_fail:
    XXXXX:
    Can someone explain what's wrong with the JS validation?

    Looks like they are doing some crappy validation on the client side before sending it to the server for true validation.

    The WTFs are:

    1. using cryptic variable names t1 - t13
    2. copying the values of more verbose variables to them although all that is done with them is read them once.
    3. having a variable to store the return value of the function, and then always return immediately after setting it. Instead of "dataok = false; return(dataok);" you could just do "return false;"

    Another thing you could nag about is the lack of localization, but this might not be required when the target demographic of the website are only english-speakers.

    Three minor WTFs in one function! That's got to be some kind of record.

    TRWTF is using a system that has makes you write the forms in one language AND validate them in another language AND validate them again in another language.

    Maybe in a few years web developers will be able to use native HTML5 form validation?

  • codemonkey73 (unregistered) in reply to Otto

    "target" isn't valid in HTML 4.0 Strict either.

Leave a comment on “FAIL FAIL,FAIL FAIL,FAIL FAIL and More”

Log In or post as a guest

Replying to comment #:

« Return to Article