FAIL FAIL,FAIL FAIL,FAIL FAIL and More

  • Bednee 2012-05-14 09:08
    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 2012-05-14 09:08
    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 .
  • QJo 2012-05-14 09:15
    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 2012-05-14 09:15
    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.
  • QJo 2012-05-14 09:16
    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 2012-05-14 09:18
    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 2012-05-14 09:20
    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 2012-05-14 09:21
    <a href="/the/path/to/the/url"
    onclick="window.open(this.getAttribute('href'),'_blank');return false;">
    link text
    </a>

    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 2012-05-14 09:21
    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 2012-05-14 09:24
    Hmm, that seems to be missing something...
    bool filenotfound1 =true;
    bool filenotfound12 = true;
    .... snip ....
    filenotfound1 = false;
    filenotfound1 = false;
    Much better.

  • operagost 2012-05-14 09:24
    Clearly, the programmer in example 3 had practice for the company softball team on his mind.
  • SergeS 2012-05-14 09:25
    My Name:
    <a href="/the/path/to/the/url"
    onclick="window.open(this.getAttribute('href'),'_blank');return false;">
    link text
    </a>

    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 2012-05-14 09:30
    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...
  • DaveK 2012-05-14 09:30
    My Name:
    <a href="/the/path/to/the/url"
    onclick="window.open(this.getAttribute('href'),'_blank');return false;">
    link text
    </a>

    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.

    <a href="/the/path/to/the/url" target="_blank"> link text </a>

    [Edit:added example]
  • Anketam 2012-05-14 09:31
    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 2012-05-14 09:34
    Johnny B Guid... tee hee.
  • x 2012-05-14 09:35
    "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 2012-05-14 09:36
    /**
    * 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 2012-05-14 09:42
    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 2012-05-14 09:44
    If you read TDWTF via RSS, TRWTF was the bizarre indentation of the various paragraphs in this article.
  • $$ERR:get_name_fail 2012-05-14 09:47
    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 2012-05-14 09:50
    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 2012-05-14 09:51
    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 2012-05-14 09:52
    Also, value for NONE ain't being constant.
  • Nappy 2012-05-14 09:58
    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 2012-05-14 10:01
    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 2012-05-14 10:04
    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 2012-05-14 10:06
    Yup. I've done this before when we're trying to achieve XHTML 1.0 Strict doctype.
  • x 2012-05-14 10:08
    $$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.
  • oheso 2012-05-14 10:12
    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.
  • oheso 2012-05-14 10:14
    $$ERR:get_name_fail:
    ... which - while being technically correct - includes no relevant information whatsoever.


    Sort of like software documentation in that respect, then.
  • oheso 2012-05-14 10:17
    $$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).
  • dkf 2012-05-14 10:18
    I like how they need a byte to describe the sex of a client. That's very… modern of them…
  • oheso 2012-05-14 10:19
    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.
  • TheCPUWizard 2012-05-14 10:19
    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>]
  • oheso 2012-05-14 10:22
    byte ClientSex,


    Kinky.

    (And only with ClientPermission, please ... )
  • Ben Jammin 2012-05-14 10:22
    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 2012-05-14 10:22
    not bad indeed. it's just a workaround of not having language constructs like symbols in ruby.
  • snoofle 2012-05-14 10:27

    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.
  • Loren Pechtel 2012-05-14 10:31
    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.
  • nobulate 2012-05-14 10:41
    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 2012-05-14 10:44
    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 2012-05-14 10:44
    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 2012-05-14 10:45
    Object Orientation took a core dump and cried at Giga B's submission
  • big picture thinker 2012-05-14 10:48
    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.
  • Medinoc 2012-05-14 10:50
    As a .Net developer, I ABHOR the "throw ex" construct: It strips the exception of its stack trace, making debugging harder.
  • SilentRunner 2012-05-14 10:52
    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.
  • oheso 2012-05-14 10:58

    Throw ex


    So much satisfaction in one line of code ... who hasn't wanted to do this at one time or another?
  • Strolskon 2012-05-14 11:08
    $$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 2012-05-14 11:21
    "target" isn't valid in HTML 4.0 Strict either.
  • snoofle 2012-05-14 11:23
    x:
    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.

    So, something like:

    private String SEPARATOR="%"; // default value
    ...
    String osName = System.getProperty("os.name").toUpperCase();
    if ("LINUX".equals(osName)) {
    SEPARATOR = "X";
    } else if ("...".equals(osName)) {
    SEPARATOR = "Y";
    }
  • Keith H 2012-05-14 11:37
    There is actually an argument for the GUID from the production DB server: in SQL newid() returns a sequential ID, so it's much better for indexing than most GUIDs (which are much more random).

    If the GUIDs are sequential new records appear at the end of the index, not somewhere in the middle, making inserts to clustered indexes not require as many page splits.

    If the GUID could be generated by multiple client instances and needed to be indexed at serious scale then getting the GUID from the server makes sense.

    Otherwise it probably is just stupid.
  • xorsyst 2012-05-14 11:41
    oheso:
    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.


    Worse - links which open in new windows, but use javascript in such a way that middle-clicking them opens a blank new window.
  • English Man 2012-05-14 11:44
    public static String NONE = "none";


    There's nothing wrong with that. Named parameters to some service are best done this way for reasons such as:

    1)Ensuring no silly, hard to track down, case mistakes
    2)Finding all references without using "find string"
    3)Refactoring
  • Anon 2012-05-14 11:49
    $$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;"


    Actually, I think the bigger WTF is returning immediately. It stops them from reporting more than one problem with the validation at a time. Nothing is more annoying that submitting a form, finding a validation error, fixing that problem, submitting again and then having it tell you there's another error (which existed on the first submission).

    If they remove the returns and let it fall through to the bottom, it would report all the identified errors in one go.
  • Anon 2012-05-14 11:50
    xorsyst:
    oheso:
    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.


    Worse - links which open in new windows, but use javascript in such a way that middle-clicking them opens a blank new window.


    Agreed. I hate that.
  • Anon 2012-05-14 11:51
    QJo:
    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.


    That would be a great point. If they were, you know, actually escaped.
  • x 2012-05-14 12:05
    snoofle:
    x:
    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.

    So, something like:

    private String SEPARATOR="%"; // default value
    ...
    String osName = System.getProperty("os.name").toUpperCase();
    if ("LINUX".equals(osName)) {
    SEPARATOR = "X";
    } else if ("...".equals(osName)) {
    SEPARATOR = "Y";
    }

    Something along those lines; I was trying to post C preprocessor stuff, but I've also had to do it at runtime in Ruby and such. You can get by feeding the OS forward slashes, but for reading existing data and/or formatting for display purposes, you have to deal with platform differences manually, unless you have the luxury of running on top of some other OS-abstraction layer.
  • pjt33 2012-05-14 12:08
    $$ERR:get_name_fail:
    XXXXX:
    Can someone explain what's wrong with the JS validation?

    ...

    The WTFs are:
    ...
    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;"
    ...

    Ah, but. dataok isn't declared with var, so its scope isn't local to the function. It could be used by some other code which we weren't shown. If you really want to be sure not to change the behaviour the cleanest way (with idiomatic JavaScript) is probably an anonymous inner function:

    function checkdata() {
    
    dataok = (function() {
    t1 = document.forms.signup.firstName.value;
    t2 = document.forms.signup.lastName.value;
    t3 = document.forms.signup.userName.value;
    t4 = document.forms.signup.password.value;
    t5 = document.forms.signup.passwordConfirm.value;
    t6 = document.forms.signup.email.value;
    t7 = document.forms.signup.url.value;
    t8 = document.forms.signup.adminFrontname.value;
    t9 = document.forms.signup.locale.options.selectedIndex;
    t10 = document.forms.signup.currency.options.selectedIndex;
    t11 = document.forms.signup.timezone.options.selectedIndex;
    t12 = document.forms.signup.packetType.options.selectedIndex;
    t13 = document.forms.signup.captcha_code.value;
    if(t1 == '' || t2 == '' || t3 == '' || t4 == '' || t5 == '' || t6 == '' || t7 == '' || t8 == ''){
    alert("Please fill-up all the fields");
    return false;
    }
    if(t4 != t5){
    alert("Please enter the password again");
    return false;
    }
    if(t9 == 0){
    alert("Please select a locale");
    return false;
    }
    if(t10 == 0){
    alert("Please select a currency");
    return false;
    }
    if(t11 == 0){
    alert("Please select a time zone");
    return false;
    }
    if(t12 == 0){
    alert("Please select a packet type");
    return false;
    }
    if(t13 == ''){
    alert("Please fill-up the code field");
    return false;
    }
    return true;
    })();
    return dataok;
    }
  • @Deprecated 2012-05-14 12:40
    Eli:
    "I learned a neat trick from our enterprise framework," Eli noted, "if you want to convert an int to a double, just do this!"

    double d = Double.valueOf(new Integer(i).toString()).doubleValue();



    Too funny. I always wondered how to convert an int to a double.
  • poohshoes 2012-05-14 12:45
    When you Throw Ex it resets the stack trace of the exception to the current position. To keep your valuable exception stack information just Throw.
  • Anon 2012-05-14 12:46
    > "So," wonders Johnny B, "I guess GUID from our production
    > db servers are better than local GUID?"

    Of course, it is better. If all GUIDs are generated on the DB server, they increase monotonically (depending on type of GUID but I presume this is why it was done) and it is faster to add rows with such GUIDs if any indexes are applied to these columns (like when primary key column is a GUID). TRWTF is the programmer who sent this.
  • Ralph 2012-05-14 12:46
    My Name:
    I don't know more than HTML basics
    Right, so you must be the guy who wrote 97% of the sites on the web, right? Or else the guy everyone else is copying? (Sigh!)
    My Name:
    <a href="/the/path/to/the/url"
    onclick="window.open(this.getAttribute('href'),'_blank');return false;">
    link text
    </a>

    I assume there is a way to do this without Javascript?
    Uh, yeah. You know, there was a web before someone got the profoundly indefensible idea to let every random idiot worldwide take control of your browser.

    <a href="/the/path/to/the/url">link text</a>

    That's it! Simple, right? But that's all you have to do! In fact that's all you should do.

    (Whine) But I want it to open in a new window...

    Fuck you and the horse you rode in on, arrogant asshole! It is ***MY*** computer not yours!!! If I want a new window I can right click and open the link in a new window or a new tab. That's my choice not yours. Go to hell.
  • jmacpherson 2012-05-14 12:57
    Anon:
    $$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;"


    Actually, I think the bigger WTF is returning immediately. It stops them from reporting more than one problem with the validation at a time. Nothing is more annoying that submitting a form, finding a validation error, fixing that problem, submitting again and then having it tell you there's another error (which existed on the first submission).

    If they remove the returns and let it fall through to the bottom, it would report all the identified errors in one go.


    this.true

  • Anon 2012-05-14 13:02
    poohshoes:
    When you Throw Ex it resets the stack trace of the exception to the current position. To keep your valuable exception stack information just Throw.


    Yes, well done. Thank you for explaining the WTF that everybody else had already got.
  • Harrow 2012-05-14 13:14
    public static final String SLASH = "/";
    public static final String PERCENT = "%";
    I always do this to make localization easier.

    For example, keyboards in Tajikistan don't have the "%" character, so they use ":" when writing percentages. (The ":" does not otherwise appear in Tajikistanish.) For Tajikistanian deployment I need change only one line:
    public static final String SLASH = "/";
    public static final String PERCENT = ":";
    Unfortunately, in Kyrgyzstan the "/" is called "SKLON", so for that country I still had to a global search and replace of all my back-end code:
    public static final String SKLON = "/";
    public static final String PERCENT = "%";
    Etc.

    -Harrow.

  • AN AWESOME CODER 2012-05-14 13:17
    The "open new window" WTF is not a WTF if the intention is to degrade gracefully. If the onclick event isn't caught, the link will still open.

  • Nagesh 2012-05-14 13:20
    Lot of code is writing because of comercial demand. If business want to have 83 params or 84 params in function, developer should do it.


    After all, the person holding the cheque book is always right!


    If you had told Shah Jehan, Taj mahal can not be built, he would have cut off your head and fed it to the pigs. Great monument in art always built on sacrifice.

    So don't worry if getting code to production ready state is going to upset a few people like your wife and children.
  • foo 2012-05-14 13:31
    Ralph:
    My Name:
    I don't know more than HTML basics
    Right, so you must be the guy who wrote 97% of the sites on the web, right? Or else the guy everyone else is copying? (Sigh!)
    My Name:
    <a href="/the/path/to/the/url"
    onclick="window.open(this.getAttribute('href'),'_blank');return false;">
    link text
    </a>

    I assume there is a way to do this without Javascript?
    Uh, yeah. You know, there was a web before someone got the profoundly indefensible idea to let every random idiot worldwide take control of your browser.

    <a href="/the/path/to/the/url">link text</a>

    That's it! Simple, right? But that's all you have to do! In fact that's all you should do.

    (Whine) But I want it to open in a new window...

    Fuck you and the horse you rode in on, arrogant asshole! It is ***MY*** computer not yours!!! If I want a new window I can right click and open the link in a new window or a new tab. That's my choice not yours. Go to hell.
    Thanks! I was about to post the same, but wasn't able to keep so calm.
  • AN AWESOME CODER 2012-05-14 13:31
    oheso:
    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.



    Why?

    Silly absolutists comments like this are TRWTF.

    First off, if there's not a "client" for what you're building, then it doesn't count. Who cares about _anything_ with your toy code, testing, validation, standards, code smells, etc. all included.

    Secondly, I can name some generic cases where you "need" to open a new window. The first being ajaxified oauth where opening the oauth flow in the same window is not possible (or undesirable).

  • foo 2012-05-14 13:36
    AN AWESOME CODER:
    oheso:
    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.



    Why?

    Silly absolutists comments like this are TRWTF.

    First off, if there's not a "client" for what you're building, then it doesn't count. Who cares about _anything_ with your toy code, testing, validation, standards, code smells, etc. all included.

    Secondly, I can name some generic cases where you "need" to open a new window. The first being ajaxified oauth where opening the oauth flow in the same window is not possible (or undesirable).

    B is TRWTF, A requires B => A is TRWTF too.
  • Nagesh 2012-05-14 13:53
    Harrow:
    public static final String SLASH = "/";
    public static final String PERCENT = "%";
    I always do this to make localization easier.

    For example, keyboards in Tajikistan don't have the "%" character, so they use ":" when writing percentages. (The ":" does not otherwise appear in Tajikistanish.) For Tajikistanian deployment I need change only one line:
    public static final String SLASH = "/";
    public static final String PERCENT = ":";
    Unfortunately, in Kyrgyzstan the "/" is called "SKLON", so for that country I still had to a global search and replace of all my back-end code:
    public static final String SKLON = "/";
    public static final String PERCENT = "%";
    Etc.

    -Harrow.


    This ain't the right aproach for Java app. Resource bundling is propar way for localization.
  • Larrik Jaerico 2012-05-14 13:53
    I don't really see much wrong with #3.

    Is it because Save() looks like a pointless wrapper around SaveMeeting()? I can imagine a few situations that may mean it isn't so pointless. I also do know (VB.Net?) well enough to see if this is actually a method, which would make it even less of a WTF.

    Is it that they re-throw the exception? That's clearly so they can breakpoint on the exception. I do that all the time. It's not supposed to to get into production, but it ain't a WTF.
  • x 2012-05-14 14:07
    Ralph:
    Fuck you and the horse you rode in on, arrogant asshole! It is ***MY*** computer not yours!!! If I want a new window I can right click and open the link in a new window or a new tab. That's my choice not yours. Go to hell.

    Oh, the humanity!
  • You should quit trolling 2012-05-14 14:13
    Ralph:
    My Name:
    I don't know more than HTML basics
    Right, so you must be the guy who wrote 97% of the sites on the web, right? Or else the guy everyone else is copying? (Sigh!)
    My Name:
    <a href="/the/path/to/the/url"
    onclick="window.open(this.getAttribute('href'),'_blank');return false;">
    link text
    </a>

    I assume there is a way to do this without Javascript?
    Uh, yeah. You know, there was a web before someone got the profoundly indefensible idea to let every random idiot worldwide take control of your browser.

    <a href="/the/path/to/the/url">link text</a>

    That's it! Simple, right? But that's all you have to do! In fact that's all you should do.

    (Whine) But I want it to open in a new window...

    Fuck you and the horse you rode in on, arrogant asshole! It is ***MY*** computer not yours!!! If I want a new window I can right click and open the link in a new window or a new tab. That's my choice not yours. Go to hell.


    You're wrong, the feature was implemented for a reason. Sometimes (frequently) the user flow only makes sense to open as a popup or new tab. Just because you can't follow the simple flow of a website doesn't mean we should all become ludites.
  • _ 2012-05-14 14:32
    You should quit trolling:
    Ralph:
    My Name:
    I don't know more than HTML basics
    Right, so you must be the guy who wrote 97% of the sites on the web, right? Or else the guy everyone else is copying? (Sigh!)
    My Name:
    <a href="/the/path/to/the/url"
    onclick="window.open(this.getAttribute('href'),'_blank');return false;">
    link text
    </a>

    I assume there is a way to do this without Javascript?
    Uh, yeah. You know, there was a web before someone got the profoundly indefensible idea to let every random idiot worldwide take control of your browser.

    <a href="/the/path/to/the/url">link text</a>

    That's it! Simple, right? But that's all you have to do! In fact that's all you should do.

    (Whine) But I want it to open in a new window...

    Fuck you and the horse you rode in on, arrogant asshole! It is ***MY*** computer not yours!!! If I want a new window I can right click and open the link in a new window or a new tab. That's my choice not yours. Go to hell.


    You're wrong, the feature was implemented for a reason. Sometimes (frequently) the user flow only makes sense to open as a popup or new tab. Just because you can't follow the simple flow of a website doesn't mean we should all become ludites.

    Name one.
  • Stefan 2012-05-14 14:38
    From an (older) program of mine:
    ------
    CONST EmptyString : STRING[1] = '';
    CONST LetterH : STRING[1] = 'H';
    CONST PlusStr : STRING[1] = '+';
    CONST MinusStr : STRING[1] = '-';
    CONST ClosePar : STRING[1] = ')';
    CONST StartIdStr : STRING[3] = ' (#';
    CONST YesStr : STRING[3] = 'Yes';
    CONST NoStr : STRING[2] = 'No';
    CONST CCExt : STRING[3] = '.cc';
    CONST Percent : STRING[1] = '%';
    CONST SpacerStr : STRING[3] = ' - ';
    CONST ColonSP : STRING[2] = ': ';
    ------

    Why? The Turbo Pascal compiler generates code which is magnitudes more efficient for string constants taken from named values than for literals. At least in many cases. And those constants are used a few hundred times each.
  • You should quit trolling 2012-05-14 14:46
    _:
    You should quit trolling:
    Ralph:
    My Name:
    I don't know more than HTML basics
    Right, so you must be the guy who wrote 97% of the sites on the web, right? Or else the guy everyone else is copying? (Sigh!)
    My Name:
    <a href="/the/path/to/the/url"
    onclick="window.open(this.getAttribute('href'),'_blank');return false;">
    link text
    </a>

    I assume there is a way to do this without Javascript?
    Uh, yeah. You know, there was a web before someone got the profoundly indefensible idea to let every random idiot worldwide take control of your browser.

    <a href="/the/path/to/the/url">link text</a>

    That's it! Simple, right? But that's all you have to do! In fact that's all you should do.

    (Whine) But I want it to open in a new window...

    Fuck you and the horse you rode in on, arrogant asshole! It is ***MY*** computer not yours!!! If I want a new window I can right click and open the link in a new window or a new tab. That's my choice not yours. Go to hell.


    You're wrong, the feature was implemented for a reason. Sometimes (frequently) the user flow only makes sense to open as a popup or new tab. Just because you can't follow the simple flow of a website doesn't mean we should all become ludites.

    Name one.


    When opening up a reference, you should be able to maintain the article you are reading while being able to flip to the reference material seamlessly. Before you say "Oh but I know how to open a new window if I want to". All of us know that for every person that knows how to use their browser that way and is willing to, there is at least 50 users that don't have a clue.
  • Zylon 2012-05-14 14:47
    _:
    You should quit trolling:
    You're wrong, the feature was implemented for a reason. Sometimes (frequently) the user flow only makes sense to open as a popup or new tab. Just because you can't follow the simple flow of a website doesn't mean we should all become ludites.

    Name one.

    The oh-so-common "(What's this?)" links. When you're in the middle of filling out a form, the very last thing you want is to dump the current page. Popup windows are ideal for presenting, y'know, popup information.

    Cripes, there are some genuine idiots floating around these forums.
  • Zylon 2012-05-14 15:02
    Stefan:
    Why? The Turbo Pascal compiler generates code which is magnitudes more efficient for string constants taken from named values than for literals. At least in many cases. And those constants are used a few hundred times each.

    Ha! I'd do the same thing with numbers in ye olde Atari BASIC. Numeric literals were all 6-byte floats, but a variable reference was only one byte (possibly two... it's been a while). When coding in a paltry 8K of RAM, the advantages of doing this were significant.

    10 N1=1 : N2=N1+N1 : N3=N2+N1 : N4=N3+N1 : N5=N4+N1 : N100=100 : N256=256

    etc...
  • Matt Westwood 2012-05-14 15:16
    Ralph:
    My Name:
    I don't know more than HTML basics
    Right, so you must be the guy who wrote 97% of the sites on the web, right? Or else the guy everyone else is copying? (Sigh!)
    My Name:
    <a href="/the/path/to/the/url"
    onclick="window.open(this.getAttribute('href'),'_blank');return false;">
    link text
    </a>

    I assume there is a way to do this without Javascript?
    Uh, yeah. You know, there was a web before someone got the profoundly indefensible idea to let every random idiot worldwide take control of your browser.

    <a href="/the/path/to/the/url">link text</a>

    That's it! Simple, right? But that's all you have to do! In fact that's all you should do.

    (Whine) But I want it to open in a new window...

    Fuck you and the horse you rode in on, arrogant asshole! It is ***MY*** computer not yours!!! If I want a new window I can right click and open the link in a new window or a new tab. That's my choice not yours. Go to hell.


    It's not "your" computer. It belongs to the Government, like everything else in this country. They just let you use it in exchange for you parting with some money. They can get it back from you at any time, by arresting you for some crime you've probably done (and if not they'll make one up) and confiscating all your "assets" as proceeds of illegal activity. Then you'll be arseraped in jail for the rest of your life.

    Have a nice day.
  • It's happened to me 2012-05-14 15:30
    I guess GUID from our production db servers are better than local GUID?

    I faced this very issue on my team. Two other developers insisted that we use a common database and its GUID function to generate all UUIDs in our code. The reason... to prevent duplicates. *sigh* To encourage "team harmony", (i.e. two against one) I was told by the tech lead to do such. We thus introduced the performance hit of going to a database to get a UUID.
  • dkf 2012-05-14 15:39
    Matt Westwood:
    It's not "your" computer. It belongs to the Government, like everything else in this country.
    And there I was thinking it was big business that had bought the government. Or is there no real point in distinguishing between the two, and we're in fascist wonderland?
  • BoringJames 2012-05-14 15:41
    The "public static final String PERCENT = "%";" thing reminds me of what you have to do in VB6 code because of how stupid the string tables are.

    If you say:

    Msgbox "Project completion rate is: " & intCompletion & "%"
    
    Msgbox "Project completion goal is: " & intCompletion2 & "%"

    The compiler will create two separate string constants, both set to "%", because it is too stupid to check to see if they are identical strings. If you have a VB6 app with a lot of strings, this can bloat up the EXE file really fast. The workaround is to define a string constant like PERCENT = "%" and use that in string expressions.
  • Spudley 2012-05-14 15:46
    <X-Backside-Transport>


    [voice=buthead] heh, heh, heh. He said "Backside" [/voice]
  • the beholder 2012-05-14 15:47
    Zylon:
    _:
    You should quit trolling:
    You're wrong, the feature was implemented for a reason. Sometimes (frequently) the user flow only makes sense to open as a popup or new tab. Just because you can't follow the simple flow of a website doesn't mean we should all become ludites.

    Name one.

    The oh-so-common "(What's this?)" links. When you're in the middle of filling out a form, the very last thing you want is to dump the current page. Popup windows are ideal for presenting, y'know, popup information.
    There's another situation: when you're writing an email on Gmail and you remember you need info that's in a message somewhere in your Inbox/Sent box/whatever. Why lose your current email when you can click the nice little diagonal arrow to pop your mail out and enable you to use the other window to search for the info you want?

    That said, I tend to agree with Ralph and _. These cases when _blank is a good thing are few and far between, but this option is abused whenever some idiot decides they like it.

    Zylon:
    Cripes, there are some genuine idiots floating around the whole internet.
    FTFY.
  • Spudley 2012-05-14 15:51

    <a href="/the/path/to/the/url"
    onclick="window.open(this.getAttribute('href'),'_blank');return false;">
    link text
    </a>


    I guess the standard answer would be to use the 'target' attribute. However if you're trying to write xhtml with strict compliance, you can't do that, because 'target' was not a permitted attribute.

    Given that restriction, this javascript solution suddenly doesn't look so bad.

    However that said, xhtml strict mode is a WTF in itself.
  • Ralph 2012-05-14 15:59
    You should quit trolling:
    Sometimes (frequently) the user flow only makes sense to open as a popup or new tab. Just because you can't follow the simple flow of a website doesn't mean we should all become ludites.
    So you think you are in control of the "user flow"? More arrogance.

    By the way, the word you are looking for is "Luddite" not "ludite". Looooser.

    In case you haven't noticed, the idea that anyone anywhere should be able to take control of your browser has led to billions in financial fraud, not to mention the frustration of countless users who lost data because their systems were hosed and they were too clueless to make backups.

    But you don't care about all that, just so long as you get to control the "flow".

    By calling people who understand what you apparently don't "ludites" you suggest that any technology must be accepted, no matter how bad. When we finally get flying cars who cares if most of them randomly explode? To speak against them means you are just resisting progress.

    I hope the Terminators come for you first.
  • Ralph 2012-05-14 16:05
    Spudley:
    I guess the standard answer would be to use the 'target' attribute. However if you're trying to write xhtml with strict compliance, you can't do that, because 'target' was not a permitted attribute.

    Hmmm. Why do you suppose they deprecated it? I guess they probably had no reason. Never mind that studying and defining standards is pretty much what they do. You know better. Right?
    Spudley:
    Given that restriction, this javascript solution suddenly doesn't look so bad.

    No, this javascript "solution"^W hack is a back door the standard didn't successfully close, that you are exploiting to continue your misbehavior.

    Captcha: vindico. See? I'm right. The captcha gods said so.
  • dogmatic 2012-05-14 16:11
    SilentRunner:
    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.


    Sounds like you have a PEBCAK problem :)
  • Zylon 2012-05-14 16:21
    Ralph:
    So you think you are in control of the "user flow"? More arrogance.

    Controlling the "flow" of user interaction is in fact one of the major issues that competent UI design concerns itself with, you blithering tinfoil-encrusted halfwit. The abuse of popup windows does not invalidate their legitimate application.

    Ralph:
    Hmmm. Why do you suppose they deprecated it? I guess they probably had no reason. Never mind that studying and defining standards is pretty much what they do. You know better. Right?

    Apparently so, because they reinstated the _target attribute in HTML5.

    If you're trolling, you're really not doing a very good job of it. And if not... god help you.
  • dogmatic 2012-05-14 16:28
    Ralph:
    My Name:
    I don't know more than HTML basics
    Right, so you must be the guy who wrote 97% of the sites on the web, right? Or else the guy everyone else is copying? (Sigh!)
    My Name:
    <a href="/the/path/to/the/url"
    onclick="window.open(this.getAttribute('href'),'_blank');return false;">
    link text
    </a>

    I assume there is a way to do this without Javascript?
    Uh, yeah. You know, there was a web before someone got the profoundly indefensible idea to let every random idiot worldwide take control of your browser.

    <a href="/the/path/to/the/url">link text</a>

    That's it! Simple, right? But that's all you have to do! In fact that's all you should do.

    (Whine) But I want it to open in a new window...

    Fuck you and the horse you rode in on, arrogant asshole! It is ***MY*** computer not yours!!! If I want a new window I can right click and open the link in a new window or a new tab. That's my choice not yours. Go to hell.


    There are many times when a stateful web app cannot be easily restored with a back click. Sure you might be able to put everything in a session var, and restore from that, but that could be hours to days of work to implement... or you could just have the click spawn a new window. Try explaining to grandma that she has to fill out the 30 field form page again because she should've ctrl-clicked that link, or how about "sorry you lost your flash game score little kid when you clicked to read the contests rules, shoulda right-clicked that link dontchya know". Your arrogance is pretty funny though, you must be a real treat to work with.
  • oheso 2012-05-14 16:46
    Strolskon:

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


    We'll still need to revalidate server-side, which ain't gonna be in HTML anyway.
  • stew 2012-05-14 16:48
    Actually, the way to open a link in a new window makes sense.

    No, it doesn't. The "target" attribute provides this functionality built-in. "target" is in HTML 5, and HTML 4 offers three standards-compliant doctypes of which two allow it.

    Insisting on "strict" HTML compliance, only to pollute your source with needless Javascript hacks to regain functionality lost through that choice, means you really didn't want strict HTML.

    Understand your options. Make the correct choice.
  • oheso 2012-05-14 16:50
    AN AWESOME CODER:
    The "open new window" WTF is not a WTF if the intention is to degrade gracefully.



    Adding onclicks in in-line code isn't the right way to degrade gracefully. See, e.g., Heilmann.
  • oheso 2012-05-14 16:52
    AN AWESOME CODER:
    ajaxified oauth where opening the oauth flow in the same window is not possible (or undesirable).



    But it's not necessary to open a new window to accomplish that.
  • Ralph 2012-05-14 16:54
    dogmatic:
    stateful web app
    WTF #1. The web is stateless. Most hacks to pretend otherwise have harmful side effects.
    dogmatic:
    cannot be easily restored with a back click
    WTF #2. Breaking the back button. Do Not Want.
  • oheso 2012-05-14 16:55
    You should quit trolling:
    there is at least 50 users that don't have a clue.


    Code written for these users is usually a real WTF. See, e.g., the ribbon and Clippy.
  • Zylon 2012-05-14 16:57
    Ralph's position isn't degrading gracefully.
  • oheso 2012-05-14 16:59
    the beholder:
    Why lose your current email when you can click the nice little diagonal arrow to pop your mail out and enable you to use the other window to search for the info you want?


    Can give the user the choice without forcing it on him. IOW, a regular link with no target specified.

    FTFY.
  • oheso 2012-05-14 17:03
    Zylon:
    they reinstated the _target attribute in HTML5.


    They (re)instated a whole bunch of crap in HTML5 and made code soup the norm.

    I'm not saying there isn't a whole bunch of useful stuff in HTML5; there is. But to say something is right because it was included/allowed for in HTML5 is pretty much akin to justifying spelling and grammar via finding matching examples on the internet.
  • Ralph 2012-05-14 17:04
    dogmatic:
    sorry you lost your flash game score little kid when you clicked to read the contests rules, shoulda right-clicked that link dontchya know
    Oops, almost missed that one! So explain to me again how you got that game running on little Timmy's computer without sending him any executable code?

    You see, this is the core problem.

    The web is for distributing knowledge.

    Ignorant cool-tards have turned it into a medium for distributing software.

    This is a fundamentally flawed idea that can never be made secure. We knew in the 1960s not to mix data and code! But then we forgot, I guess.

    But who cares about all the victims of this silliness? Timmy must have his dancing cartoons, mustn't he? And we can't think of any other way to get him some entertainment software. Pathetic.
  • oheso 2012-05-14 17:07
    dogmatic:

    There are many times when a stateful web app cannot be easily restored with a back click.


    It's doable and it should be done. Don't pop up a new window on me because you're a lazy programmer.

    I have to work every day with other peeps' screwy web apps where the back button breaks stuff, and it gives me pleasure every day to think of awful things happening to those developers. Really awful things.
  • Zylon 2012-05-14 17:08
    oheso:
    But to say something is right because it was included/allowed for in HTML5 is pretty much akin to justifying spelling and grammar via finding matching examples on the internet.

    No, saying something is right because it's in a spec is exactly as valid as saying something is wrong because it's NOT in a spec, which is what Ralph tried to claim.

    Do try to keep up, would you?
  • oheso 2012-05-14 17:11
    Zylon:

    No, saying something is right because it's in a spec ...


    Inclusion in the spec does not make it mandatory.

    I am not Ralph. I understand his position. I don't keep to it myself exclusively, but I will say that by default sites I visit do not execute JS on my computer.
  • DataURI 2012-05-14 17:35
    Ralph:
    dogmatic:
    sorry you lost your flash game score little kid when you clicked to read the contests rules, shoulda right-clicked that link dontchya know
    Oops, almost missed that one! So explain to me again how you got that game running on little Timmy's computer without sending him any executable code?

    You see, this is the core problem.

    The web is for distributing knowledge.

    Ignorant cool-tards have turned it into a medium for distributing software.

    This is a fundamentally flawed idea that can never be made secure. We knew in the 1960s not to mix data and code! But then we forgot, I guess.

    But who cares about all the victims of this silliness? Timmy must have his dancing cartoons, mustn't he? And we can't think of any other way to get him some entertainment software. Pathetic.

  • Zylon 2012-05-14 17:38
    oheso:
    Zylon:

    No, saying something is right because it's in a spec ...


    Inclusion in the spec does not make it mandatory.

    Congratulations on insisting on following the conversation in your head, and not the one that's actually happening.
  • Sigivald 2012-05-14 17:40
    That is true, in its place.

    But what I noted in:


    Public Function Save() As Boolean
    Try
    SaveMeeting()
    Catch ex As Exception
    Throw ex
    End Try
    End Function


    was that the obvious explanation is that the catch block is there to let you <I>place a breakpoint</i> to catch it in the act, rather than being 'real' code intended to do anything useful in and of itself.

    This makes even more sense if SaveMeeeting is, say, a method in a DLL that you don't have access to the internals of.
  • J 2012-05-14 18:33
    dogmatic:
    There are many times when a stateful web app cannot be easily restored with a back click. Sure you might be able to put everything in a session var, and restore from that, but that could be hours to days of work to implement... or you could just have the click spawn a new window. Try explaining to grandma that she has to fill out the 30 field form page again because she should've ctrl-clicked that link, or how about "sorry you lost your flash game score little kid when you clicked to read the contests rules, shoulda right-clicked that link dontchya know". Your arrogance is pretty funny though, you must be a real treat to work with.


    This is a job for one of those little floating page elements, warning you you're about to lose all your form data. Or better yet, the information she's looking for itself should go in a little floating box, instead of opening a new window.

    You can probably tell I don't know a whole lot about web development. I'm speaking from a user's perspective -- I prefer if the sites I visit never open new windows on their own.
  • Zylon 2012-05-14 18:41
    J:
    This is a job for one of those little floating page elements, warning you you're about to lose all your form data. Or better yet, the information she's looking for itself should go in a little floating box, instead of opening a new window.

    You know what those little floating boxes are called? "Windows".

    Don't try to re-invent the tools that the OS has already given you.
  • anon 2012-05-14 19:31
    Congratulations, Ralph. You've just convinced anyone that previously thought there was no place for opening links in a new window to change their mind. Simply because they don't want to be on the same side as you.
  • Norman Diamond 2012-05-14 19:34
    Michael:
    /**
    
    * Defines the value for none. Default is "none".
    */
    public static String NONE = "none";

    The original code was:
    /**
    
    * Defines the value for none. Default is "無".
    */
    public static String NONE = "無";

    Then a foreigner tried to localize it but didn't know how. They changed the default instead of adding an option to deviate from the default.
  • Friedrice the Great 2012-05-14 19:34
    OVERWHELMED, OVERWHELMED, OVERWHELMED, OVERWHELMED, OVERWHELMED, OVERWHELMED and More.
  • Norman Diamond 2012-05-14 19:37
    Ralph:
    The web is for distributing knowledge.

    Ignorant cool-tards have turned it into a medium for distributing software.

    Yeah, I always wondered who allowed "ftp://" in URLs, and why. Next I wondered why someone allowed http to transport the same kinds of files.
  • J 2012-05-14 19:38
    Zylon:
    J:
    This is a job for one of those little floating page elements, warning you you're about to lose all your form data. Or better yet, the information she's looking for itself should go in a little floating box, instead of opening a new window.

    You know what those little floating boxes are called? "Windows".

    Don't try to re-invent the tools that the OS has already given you.


    Yes, that's what I meant. Instead of a window, why don't you try a window?
  • Ralph 2012-05-14 19:57
    anon:
    Congratulations, Ralph. You've just convinced anyone that previously thought there was no place for opening links in a new window to change their mind. Simply because they don't want to be on the same side as you.
    I didn't realize this was a popularity contest. I'll get back in line immediately sir!
  • Johnny come lately 2012-05-14 20:10
    QJo:
    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.
    But, but...

    Oh, never mind, I see you're a troll....
  • Ching 2012-05-14 20:15
    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.
    and if we ever decide that "none" is a valid value we can simply change it to "zilch"
  • Dongle 2012-05-14 20:19
    oheso:
    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.
    Exactly. When surfing pr0n and you want videos in each window you can right click and explicitly choose what should be opened in a new window
  • Samran 2012-05-14 20:31
    Nagesh:
    Lot of code is writing because of comercial demand. If business want to have 83 params or 84 params in function, developer should do it.


    After all, the person holding the cheque book is always right!


    If you had told Shah Jehan, Taj mahal can not be built, he would have cut off your head and fed it to the pigs. Great monument in art always built on sacrifice.

    So don't worry if getting code to production ready state is going to upset a few people like your wife and children.
    Don't trust man with cheque book - he can't pay...
    Better work for company with cash or card
  • Chief 2012-05-14 20:43
    Ralph:
    dogmatic:
    sorry you lost your flash game score little kid when you clicked to read the contests rules, shoulda right-clicked that link dontchya know
    Oops, almost missed that one! So explain to me again how you got that game running on little Timmy's computer without sending him any executable code?

    You see, this is the core problem.

    The web is for distributing knowledge.

    Ignorant cool-tards have turned it into a medium for distributing software.

    This is a fundamentally flawed idea that can never be made secure. We knew in the 1960s not to mix data and code! But then we forgot, I guess.

    But who cares about all the victims of this silliness? Timmy must have his dancing cartoons, mustn't he? And we can't think of any other way to get him some entertainment software. Pathetic.
    Damn-straight Ralphy. They should pay for it like we used to!!
  • JB 2012-05-14 20:48
    anon:
    Congratulations, Ralph. You've just convinced anyone that previously thought there was no place for opening links in a new window to change their mind. Simply because they don't want to be on the same side as you.
    Not true - if anything he's strengthened my opinion...

  • Cheong 2012-05-14 22:20
    "I had to look over some C# code written by a colleague of mine," notes John D, "the following lines represent just the tip of the iceberg of the pain that I had to go through while understanding the code."

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

    Don't mind. Just change the interpretation of these trueX variable as boolX and you'll be fine. (Or will it?)
  • Coyne 2012-05-14 23:20
    Fixed that for them:


    if(t1 == '' || t2 == '' || t3 == '' || t4 == '' || t5 == '' || t6 == '' || t7 == '' || t8 == ''){
    alert("Please fill-up all the fields");
    dataok = false; return(dataok);}
    t4 = t5;
    if(t4 != t5){
    alert("Please enter the password again");
    dataok = false; return(dataok);}
    if(t9 == 0){
  • dogmatic 2012-05-15 01:50
    Ralph:
    dogmatic:
    sorry you lost your flash game score little kid when you clicked to read the contests rules, shoulda right-clicked that link dontchya know
    Oops, almost missed that one! So explain to me again how you got that game running on little Timmy's computer without sending him any executable code?

    You see, this is the core problem.

    The web is for distributing knowledge.

    Ignorant cool-tards have turned it into a medium for distributing software.

    This is a fundamentally flawed idea that can never be made secure. We knew in the 1960s not to mix data and code! But then we forgot, I guess.

    But who cares about all the victims of this silliness? Timmy must have his dancing cartoons, mustn't he? And we can't think of any other way to get him some entertainment software. Pathetic.


    Hahaha oh man that's the best laugh I have all day. Thanks for taking the time out of filing your punch cards to discuss!
  • peter 2012-05-15 02:30
    _:
    You should quit trolling:
    Ralph:
    My Name:
    I don't know more than HTML basics
    Right, so you must be the guy who wrote 97% of the sites on the web, right? Or else the guy everyone else is copying? (Sigh!)
    My Name:
    <a href="/the/path/to/the/url"
    onclick="window.open(this.getAttribute('href'),'_blank');return false;">
    link text
    </a>

    I assume there is a way to do this without Javascript?
    Uh, yeah. You know, there was a web before someone got the profoundly indefensible idea to let every random idiot worldwide take control of your browser.

    <a href="/the/path/to/the/url">link text</a>

    That's it! Simple, right? But that's all you have to do! In fact that's all you should do.

    (Whine) But I want it to open in a new window...

    Fuck you and the horse you rode in on, arrogant asshole! It is ***MY*** computer not yours!!! If I want a new window I can right click and open the link in a new window or a new tab. That's my choice not yours. Go to hell.


    You're wrong, the feature was implemented for a reason. Sometimes (frequently) the user flow only makes sense to open as a popup or new tab. Just because you can't follow the simple flow of a website doesn't mean we should all become ludites.

    Name one.


    Opening a help window on a form that is now halfway filled out comes to mind.
  • David 2012-05-15 02:31
    Ralph:
    The web is for distributing knowledge.

    Ignorant cool-tards have turned it into a medium for distributing software.

    This is a fundamentally flawed idea that can never be made secure. We knew in the 1960s not to mix data and code! But then we forgot, I guess.

    But who cares about all the victims of this silliness? Timmy must have his dancing cartoons, mustn't he? And we can't think of any other way to get him some entertainment software. Pathetic.


    (The scene: somewhere, in the past.)

    Luser: I shouldnt have to put in any effort whatsoever! The computer should just *work*!

    Marketroid: Yeah! You engineers, make it just *work*!

    Engineers: What? No. Just... no.

    PHB: Do it or youre fired.

    Engineers: Well, all right then. But this is a *really* *bad* *idea*.

    (The scene: some time later.)

    Luser: It broke and all my stuff is gone! Waa! Waa!

    Engineer (to second engineer): Fancy a cup of tears? I saved some for you.

    Second engineer: Mmm. Delicious!
  • will 2012-05-15 02:34
    Don't have a problem with the GUID code.<br>
    Worked on one system where the application language, middleware language, and database all had GUID function and all three created them in different formats. Finally standardized on just one and because of the nature of the project GUID had to be created but not used in the database you had stuff like that to get a GUID.
  • dk 2012-05-15 02:34
    You're wrong. This will compile; and return 'False'.

    In VB.Net, you can ommit the 'return' and the method will return the default value (which is 'False' for boolean).
  • lolwtf 2012-05-15 02:56
    public static final String BACKSLASH = "\";
    public static final String QUOTE = """;

    hey, why is our code leaking out of our backslash?
  • toon 2012-05-15 03:10
    About those constants, and how the submitter questioned they were real, I found this in our code the other day:

    $us = "_"; // underscore
  • xorsyst 2012-05-15 04:31
    the beholder:
    There's another situation: when you're writing an email on Gmail and you remember you need info that's in a message somewhere in your Inbox/Sent box/whatever. Why lose your current email when you can click the nice little diagonal arrow to pop your mail out and enable you to use the other window to search for the info you want?


    I never noticed that arrow before. I've always just middle-clicked on "Inbox", to open my inbox in another window. No silly javascript required.
  • Artem Chachanidze 2012-05-15 04:58
    Recording ALL possible personal details abount clients is a common practice in Georgia (Country in Caucasus).
    (I'm one of the maintainers of that 'serious' banking app)
  • zirias 2012-05-15 05:07
    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, definitely not a WTF. Even has a nice fallback for clients without javascript and avoids data duplication.
  • TheRider 2012-05-15 05:21
    Ralph:
    (Whine) But I want it to open in a new window...

    Fuck you and the horse you rode in on, arrogant asshole! It is ***MY*** computer not yours!!! If I want a new window I can right click and open the link in a new window or a new tab. That's my choice not yours. Go to hell.
    This definitely depends on the audience. I know plenty of people in my vicinity who don't have a CS degree, who only use computers very irregularly and who can't distinguish between entering a URL in the address line of the browser and entering a search term in the Google window that happens to be their startup site. These people also have no clue that their mouse has more than just the left button. When I tell them to right-click to open the context menu, I am regularly met with blank stares -- or prolonged, astonished silence, when on the phone. To help these people out, I regularly make within-a-homepage-links open in the same window and outside-of-the-current-homepage-links open in a new tab. They love me for that. So it's not so much that *I* want it to open in a new window (I, personally, couldn't care less), it is more of an ease-of-use thing.

    peter:
    Opening a help window on a form that is now halfway filled out comes to mind.
    You are, of course, right in so far as most of the time, in these circumstances, we would lose the form content if the help came up inside the same window. But that is only because most web programmers don't know their asses from their elbows. Technical correct solutions are possible, and help-in-a-new-window is just the easy way out. Don't get me wrong, I don't hate new windows when they make sense, and they *do* make sense if the web developer doesn't know any better.
  • MORAN 2012-05-15 05:37
    David:
    Ralph:
    The web is for distributing knowledge.

    Ignorant cool-tards have turned it into a medium for distributing software.

    This is a fundamentally flawed idea that can never be made secure. We knew in the 1960s not to mix data and code! But then we forgot, I guess.

    But who cares about all the victims of this silliness? Timmy must have his dancing cartoons, mustn't he? And we can't think of any other way to get him some entertainment software. Pathetic.


    (The scene: somewhere, in the past.)

    Luser: I shouldnt have to put in any effort whatsoever! The computer should just *work*!

    Marketroid: Yeah! You engineers, make it just *work*!

    Engineers: What? No. Just... no.

    PHB: Do it or youre fired.

    Engineers: Well, all right then. But this is a *really* *bad* *idea*.

    (The scene: some time later.)

    Luser: It broke and all my stuff is gone! Waa! Waa!

    Engineer (to second engineer): Fancy a cup of tears? I saved some for you.

    Second engineer: Mmm. Delicious!

    I don't get it. Are you agreeing with him or not?
  • Jake 2012-05-15 05:42
    Bednee:
    Se:
    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.


    Disagreed. Although the author of that particular snippet of code may have had no choice, it's most definitely a WTF to be forced to use Javascript over plain standard HTML to open a link in a new window. Forcing your own WTF upon thousands of other developers? Not only is that a WTF, it takes WTF to a whole different level.
  • TheSHEEEP 2012-05-15 06:03
    It's like WTF domination.

    Captcha - nisl. Fa-shizzle?
  • Mathew 2012-05-15 06:04
    SergeS:
    My Name:
    <a href="/the/path/to/the/url"
    onclick="window.open(this.getAttribute('href'),'_blank');return false;">
    link text
    </a>

    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


    Sure, it is, you fail. It has nothing to do with XHTML - HTML strict doesn't allow it either.

    Not allowing the target-attribute is the real wtf. Just because some fascists wrongly believe this shouldn't be possible.
  • Mathew 2012-05-15 06:07
    Dongle:
    oheso:
    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.
    Exactly. When surfing pr0n and you want videos in each window you can right click and explicitly choose what should be opened in a new window


    Links to external websites should ALWAYS be opened in a new tab. If you don't agree you're a fucking retard that know nothing about ux.
  • Mathew 2012-05-15 06:11
    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.


    No, Otto, the WTF is you. HTML Strict doesn't allow the target-attribute (not, parameter - moron) either. Fucking wannabe.
  • nobulate 2012-05-15 06:12
    Medinoc:
    As a .Net developer, I ABHOR the "throw ex" construct: It strips the exception of its stack trace, making debugging harder.


    Or to put it another way:

    DestroyCallStackException up = new DestroyCallStackException();
    
    throw up;
  • Glad 2012-05-15 06:42
    Try
    SaveMeeting()
    Catch ex As Exception
    Throw ex
    End Try

    Will actually result in the stack being lost beyond the line Throw Ex.

    If you wanted the stack to keep earlier entries in the stack, then you will have todo:
    Try
    SaveMeeting()
    Catch ex As Exception
    Throw New Exception(ex.ToString(), e)
    End Try


    Well in C# anyway
  • omghi 2012-05-15 06:45
    How odd that .NET behaves that way. In the sane world of Java, catching e and throwing e a bit later preserves the original stack trace, as you're throwing exactly the same exception object you caught. Of course, catching e, and throwing new Exception() would lose it...

  • Herr Otto Flick 2012-05-15 06:52
    oheso:
    the beholder:
    Why lose your current email when you can click the nice little diagonal arrow to pop your mail out and enable you to use the other window to search for the info you want?


    Can give the user the choice without forcing it on him. IOW, a regular link with no target specified.

    FTFY.


    Because users are idiotic twats who need to be guided by the hand to do anything. This doesn't cover you? Tough shit matey, the world doesn't revolve around "making things perfect for oheso".

    It's people like you that ensure that the target attribute of an href is not valid in so many 'standards'*, because it upsets their semantic sensibilities of what HTML 'should be'. TRWTF is arguing about how evil opening a new window is to the extent that people use some crufty JS to work around the 'standard'.

    * The best thing about standards is that there are so many to choose from.
  • Medinoc 2012-05-15 07:02
    Glad:

    If you wanted the stack to keep earlier entries in the stack, then you will have todo:
    Try
    SaveMeeting()
    Catch ex As Exception
    Throw New Exception(ex.ToString(), e)
    End Try

    Well in C# anyway

    Or you could simply use Throw without argument.
  • Mathew 2012-05-15 07:17
    Nappy:
    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/


    Please don't cite bs. the rel-attribute was there long before HTML4.
  • NMe 2012-05-15 08:55
    Ralph:
    Fuck you and the horse you rode in on, arrogant asshole! It is ***MY*** computer not yours!!! If I want a new window I can right click and open the link in a new window or a new tab. That's my choice not yours. Go to hell.

    You give the guy more credit than he deserves. I'd bet he used XHTML, validated the site and got the message saying that the target-attribute is not allowed, then figured this would be the way to solve that. Classroom example of someone who uses validation as a goal instead of a means to an end.
    Jake:
    Bednee:
    Se:
    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.


    Disagreed. Although the author of that particular snippet of code may have had no choice, it's most definitely a WTF to be forced to use Javascript over plain standard HTML to open a link in a new window. Forcing your own WTF upon thousands of other developers? Not only is that a WTF, it takes WTF to a whole different level.

    Validation is not a goal in itself. There is not a single browser out there that will break upon seeing a target="_blank". Worst case scenario, a browser will ignore it. It will never break the website. It will never cause the user problems.

    Twisting and turning yourself into the strangest code constructions just to conform to a guideline is the kind of mindless idiocy that ruins so many websites out there. A site does not have to validate as long as you can explain why it doesn't and why you need the feature that breaks validation. Choosing to break your site's functionality just to have a validating site shows to me you clearly haven't gotten the point.
  • Martin 2012-05-15 09:59
    Actually there is a good reason why DB GUIDs are better. We've had a problem with Windows generating a repeating GUID about once every 20 000 times where SQL Server does not.
  • Mathew 2012-05-15 10:04
    anon:
    Congratulations, Ralph. You've just convinced anyone that previously thought there was no place for opening links in a new window to change their mind. Simply because they don't want to be on the same side as you.


    Generally, complete retards don't change their mind that fast
  • Zylon 2012-05-15 10:51
    Norman Diamond:
    Ralph:
    The web is for distributing knowledge.

    Yeah, I always wondered who allowed "ftp://" in URLs, and why.

    Technically speaking (which we bloody well should be), FTP isn't "the web".
  • xorsyst 2012-05-15 11:41
    Mathew:

    Links to external websites should ALWAYS be opened in a new tab. If you don't agree you're a fucking retard that know nothing about ux.


    Maybe they "should", for "normal" users, but I know that when I'm browsing, I don't want them to. If I want a new tab/window, I'll tell the browser I want one, thank you very much. I'd be perfectly happy if I could configure my browser to ignore target.

    As I said in a previous post, the thing that really bugs me is when javascript it used for this in a way that means that me opening a link in a new window doesn't actually work, and I have to normal-click it instead. That's just brain dead implementation.
  • blowhole 2012-05-15 11:53
    Would have liked XXX-Backside-Service even more.
  • Mathew 2012-05-15 12:05
    xorsyst:
    Mathew:

    Links to external websites should ALWAYS be opened in a new tab. If you don't agree you're a fucking retard that know nothing about ux.


    Maybe they "should", for "normal" users, but I know that when I'm browsing, I don't want them to. If I want a new tab/window, I'll tell the browser I want one, thank you very much. I'd be perfectly happy if I could configure my browser to ignore target.

    As I said in a previous post, the thing that really bugs me is when javascript it used for this in a way that means that me opening a link in a new window doesn't actually work, and I have to normal-click it instead. That's just brain dead implementation.


    Oviously you don't know always beforehand know whether it makes sense to open a page in a new tab. This is why the target-attribute is important.
    And yes, browsers should provide an option to ignore it. Just like you can disable js, images, css.
    Even better they should allow you to configure rules which pages to open in a new tab and which not - taking presedence over the authors target suggestion (just like user/author css).

    The reason this doesn't exist yet, maybe is due that most people like having external links in new tabs.
  • Mr Anon 2012-05-15 15:06
    Sigivald:
    That is true, in its place.

    But what I noted in:


    Public Function Save() As Boolean
    Try
    SaveMeeting()
    Catch ex As Exception
    Throw ex
    End Try
    End Function


    was that the obvious explanation is that the catch block is there to let you <I>place a breakpoint</i> to catch it in the act, rather than being 'real' code intended to do anything useful in and of itself.

    I'd love to believe that, but I doubt it somehow. Our current codebase is full of this thanks to former VB6 developers learning C# who've been lead to believe that including a try-catch counts as "error checking", even if they haven't actually done anything with it.

    And, as others have pointed out, throw ex will mess up the stack trace info so even if you really needed to put a breakpoint there (instead of just breaking on exception) you ought to rethrow the original exception properly.

    I have a whole slew of WTFs from the same developers that I really ought to submit at some point....
  • dogmatic 2012-05-15 15:25
    NMe:

    Validation is not a goal in itself. There is not a single browser out there that will break upon seeing a target="_blank". Worst case scenario, a browser will ignore it. It will never break the website. It will never cause the user problems.


    Validation could be a client requirement, it has been for me on a few projects. Perhaps HTML Strict is TRWTF, but it's also possible that the project was inherited with that doctype already set. Without context we can't really know if this is a WTF or not. I do know one thing, it's definitely no big deal, not like some monstrosities I've seen, like CC numbers that pass over http and are stored unencrypted in a db. Or perhaps the nice Flex "Framework" that I had to work with one time that had it's own broken way of parsing xml, even though e4x had been around for years already. When I suggested we just use e4x instead of debugging their crap, I was met with angry silence. That's months of hard work gone to waste dontchyaknow!
  • Meep 2012-05-15 15:44
    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!


    You assume he's counting 83 lines by hand instead of copy and pipe the pasteboard into wc -l? You FAIL, FAIL, FAIL.
  • me solve 2012-05-15 19:39
    TheRider:
    Ralph:
    (Whine) But I want it to open in a new window...

    Fuck you and the horse you rode in on, arrogant asshole! It is ***MY*** computer not yours!!! If I want a new window I can right click and open the link in a new window or a new tab. That's my choice not yours. Go to hell.
    This definitely depends on the audience. I know plenty of people in my vicinity who don't have a CS degree, who only use computers very irregularly and who can't distinguish between entering a URL in the address line of the browser and entering a search term in the Google window that happens to be their startup site. These people also have no clue that their mouse has more than just the left button. When I tell them to right-click to open the context menu, I am regularly met with blank stares -- or prolonged, astonished silence, when on the phone. To help these people out, I regularly make within-a-homepage-links open in the same window and outside-of-the-current-homepage-links open in a new tab. They love me for that. So it's not so much that *I* want it to open in a new window (I, personally, couldn't care less), it is more of an ease-of-use thing.

    Yes, that's right, users shouldn't have to right click. Instead, each time they select a link we should prompt them "Would you like to open a new tab for this window or replace the page you're viewing". Much more friendly for the morons.

    MS made the mistake of trying to cater for idiot users, and only succeeded in creating more idiotic users.
    Idiots will always find a way to make their own life inconvenient. Write GUI's for competent (not necessarily expert) users. Users will (out of necessity) either become competent or fall by the wayside.
    Writing GUI's to support idiots only makes a cumbersome interface for everyone else, and (if anything) turns otherwise competent users into morons.
  • L. 2012-05-16 01:42
    AN AWESOME CODER:
    oheso:
    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.



    Why?

    Silly absolutists comments like this are TRWTF.

    First off, if there's not a "client" for what you're building, then it doesn't count. Who cares about _anything_ with your toy code, testing, validation, standards, code smells, etc. all included.

    Secondly, I can name some generic cases where you "need" to open a new window. The first being ajaxified oauth where opening the oauth flow in the same window is not possible (or undesirable).


    Are you absolutely sure you can't use an iframe for that ?
  • L. 2012-05-16 01:48
    the beholder:
    Zylon:
    _:
    You should quit trolling:
    You're wrong, the feature was implemented for a reason. Sometimes (frequently) the user flow only makes sense to open as a popup or new tab. Just because you can't follow the simple flow of a website doesn't mean we should all become ludites.

    Name one.

    The oh-so-common "(What's this?)" links. When you're in the middle of filling out a form, the very last thing you want is to dump the current page. Popup windows are ideal for presenting, y'know, popup information.
    There's another situation: when you're writing an email on Gmail and you remember you need info that's in a message somewhere in your Inbox/Sent box/whatever. Why lose your current email when you can click the nice little diagonal arrow to pop your mail out and enable you to use the other window to search for the info you want?

    That said, I tend to agree with Ralph and _. These cases when _blank is a good thing are few and far between, but this option is abused whenever some idiot decides they like it.

    Zylon:
    Cripes, there are some genuine idiots floating around the whole internet.
    FTFY.

    few and far between. like every single download link. or every time you don't want to implement your own tabbing system - which is exactly what you described for gmail - and exactly what I do for webapps.

    Holding a grudge against _blank just because your porn sites spammed you isn't very smart either.
  • L. 2012-05-16 01:59
    oheso:
    dogmatic:

    There are many times when a stateful web app cannot be easily restored with a back click.


    It's doable and it should be done. Don't pop up a new window on me because you're a lazy programmer.

    I have to work every day with other peeps' screwy web apps where the back button breaks stuff, and it gives me pleasure every day to think of awful things happening to those developers. Really awful things.


    You may be living in the past.

    My webapps are single page and your back button is both useless and not supported.

    What I mean there, is that there are much better ways to navigate than simply back and forward (that scheme only handles one path by the way), like a recent list adapted to your application for example.

    IMHO, any application DIRECTLY supporting the back button is a WTF in this day and age, there is only bad consequences to that kind of stuff.

    And any application supporting it INDIRECTLY is so missing the point because for the same work, one could simply put a better navigation scheme in place than ol' stupid backforward reload everything except some is cached but some is not ...
  • L. 2012-05-16 02:02
    Zylon:
    J:
    This is a job for one of those little floating page elements, warning you you're about to lose all your form data. Or better yet, the information she's looking for itself should go in a little floating box, instead of opening a new window.

    You know what those little floating boxes are called? "Windows".

    Don't try to re-invent the tools that the OS has already given you.


    Actually you have so much more control AND interaction possibilities with a popup div that using the OS windows would be the worst approach, hitting popup blockers as well.
  • L. 2012-05-16 02:09
    Martin:
    Actually there is a good reason why DB GUIDs are better. We've had a problem with Windows generating a repeating GUID about once every 20 000 times where SQL Server does not.


    lol.

    And this is why you shouldn't trust anyone's GUID code to be correct.

    By the way, do you know if the source for SQL Server GUID uses hashes ?

    Cuz if it's the case, you've got hidden collision potential ;)

    Oh and, even java's GUID function is broken, so I doubt you'll find a perfect implementation in microsoft land ;)
  • Neil 2012-05-16 10:42
    Foo Bar:
    If you read TDWTF via RSS, TRWTF was the bizarre indentation of the various paragraphs in this article.
    You don't need to read it via RSS to see that the third <BLOCKQUOTE> in the source should be </BLOCKQUOTE>.
  • Zylon 2012-05-16 10:57
    L.:
    IMHO, any application DIRECTLY supporting the back button is a WTF in this day and age, there is only bad consequences to that kind of stuff.

    IMHO, you're a troll and/or utterly clueless.

    Do users understand the browser back button?

    Also, fuck you Akismet. Let's see how much blather I have to tack on here before your incompetent heuristics decide this isn't spam.
  • L. 2012-05-16 12:24
    Zylon:
    L.:
    IMHO, any application DIRECTLY supporting the back button is a WTF in this day and age, there is only bad consequences to that kind of stuff.

    IMHO, you're a troll and/or utterly clueless.

    Do users understand the browser back button?

    Also, fuck you Akismet. Let's see how much blather I have to tack on here before your incompetent heuristics decide this isn't spam.

    Interesting study, but that makes no goddamn difference.
    I'm talking about web applications, not websites or blogs or whatever.
    I'm talking about an application that has much easier ways to handle nav than back or forward.

    The fact that people using the web as it is today, i.e. ever so retarded and still in dire need of back forward nav due to its mainly folder file tree design, require a back button has absolutely no relevance when you design an application.

    Do you have a back button in Outlook ? calc ? notepad ?

    No, there are only back buttons where it makes sense, explorer, winamp and vlc.

    So quit using your failed rethoric on how websites should remain in the dark ages of folder-based html and join us in 2012, it's great here.
  • Zylon 2012-05-16 14:27
    "Folder-based HTML"?

    Hooooo boy, this thread is really bringing out the moonbats.
  • Callin 2012-05-16 15:07
    I don't fail often.

    But when I do, I FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL!
  • Cricket 2012-05-16 15:15
    Zylon:
    moonbats

    Fucking racist.
  • Fred 2012-05-16 18:24
    L.:
    oheso:
    dogmatic:

    There are many times when a stateful web app cannot be easily restored with a back click.


    It's doable and it should be done. Don't pop up a new window on me because you're a lazy programmer.

    I have to work every day with other peeps' screwy web apps where the back button breaks stuff, and it gives me pleasure every day to think of awful things happening to those developers. Really awful things.


    You may be living in the past.

    My webapps are single page and your back button is both useless and not supported.

    What I mean there, is that there are much better ways to navigate than simply back and forward (that scheme only handles one path by the way), like a recent list adapted to your application for example.

    IMHO, any application DIRECTLY supporting the back button is a WTF in this day and age, there is only bad consequences to that kind of stuff.

    And any application supporting it INDIRECTLY is so missing the point because for the same work, one could simply put a better navigation scheme in place than ol' stupid backforward reload everything except some is cached but some is not ...
    Maybe I just don't get what you're saying (or maybe you a troll), but I would think supporting the back button is important irrespective of the paths you intend to support in your page - if it exists in the browser, user will (try to) use it - if you circumvent their ability to use the back button as they believe it will work then you are merely pissing off potential clients. You don't have to believe the back button is necessarily a good idea, but you have to understand that users expect certain behaviours in browsers where it's present (which I think is all of them at the mo)
  • Fred 2012-05-16 18:43
    L.:
    Zylon:
    L.:
    IMHO, any application DIRECTLY supporting the back button is a WTF in this day and age, there is only bad consequences to that kind of stuff.

    IMHO, you're a troll and/or utterly clueless.

    Do users understand the browser back button?

    Also, fuck you Akismet. Let's see how much blather I have to tack on here before your incompetent heuristics decide this isn't spam.

    Interesting study, but that makes no goddamn difference.
    I'm talking about web applications, not websites or blogs or whatever.
    I'm talking about an application that has much easier ways to handle nav than back or forward.

    The fact that people using the web as it is today, i.e. ever so retarded and still in dire need of back forward nav due to its mainly folder file tree design, require a back button has absolutely no relevance when you design an application.

    Do you have a back button in Outlook ? calc ? notepad ?

    No, there are only back buttons where it makes sense, explorer, winamp and vlc.

    So quit using your failed rethoric on how websites should remain in the dark ages of folder-based html and join us in 2012, it's great here.
    Now I'm even more confused.

    "I'm not talking about Websites, I'm talking about web apps, which is why Websites shouldn't support a back button". So...Websites are old fashioned are they? I notice the likes of google, yahoo and facebook are still banking on them pretty heavily.

    When they start trying to get out of them at a rate of knots, I might start to worry...
  • Ladel 2012-05-16 18:47
    Fred:
    L.:
    Zylon:
    L.:
    IMHO, any application DIRECTLY supporting the back button is a WTF in this day and age, there is only bad consequences to that kind of stuff.

    IMHO, you're a troll and/or utterly clueless.

    Do users understand the browser back button?

    Also, fuck you Akismet. Let's see how much blather I have to tack on here before your incompetent heuristics decide this isn't spam.

    Interesting study, but that makes no goddamn difference.
    I'm talking about web applications, not websites or blogs or whatever.
    I'm talking about an application that has much easier ways to handle nav than back or forward.

    The fact that people using the web as it is today, i.e. ever so retarded and still in dire need of back forward nav due to its mainly folder file tree design, require a back button has absolutely no relevance when you design an application.

    Do you have a back button in Outlook ? calc ? notepad ?

    No, there are only back buttons where it makes sense, explorer, winamp and vlc.

    So quit using your failed rethoric on how websites should remain in the dark ages of folder-based html and join us in 2012, it's great here.
    Now I'm even more confused.

    "I'm not talking about Websites, I'm talking about web apps, which is why Websites shouldn't support a back button". So...Websites are old fashioned are they? I notice the likes of google, yahoo and facebook are still banking on them pretty heavily.

    When they start trying to get out of them at a rate of knots, I might start to worry...
    Trolled by a classic troll:

    1) Say something that on the surface sounds cromulent, but with some thought implies crazy
    2) wait
    3) Get angry at any opposition and accuse them of being so last year

    Captcha: appellatio - oh dear....I've never enjoyed fruit so much
  • Zylon 2012-05-16 19:59
    Ladel:
    Trolled by a classic troll:

    1) Say something that on the surface sounds cromulent, but with some thought implies crazy
    2) wait
    3) Get angry at any opposition and accuse them of being so last year

    The problem is Poe's Law, as applied to UX wonks. We may never know whether he's trolling or not. It's impossible to determine from observable data.

    Fortunately, calling him an idiot is applicable either way.
  • iMalc 2012-05-17 04:55
    So if you FAIL at FAILing, have you succeeded?
  • L. 2012-05-17 05:11
    Zylon:
    "Folder-based HTML"?

    Hooooo boy, this thread is really bringing out the moonbats.


    Yes, it's also called an URL.

    Who the fuck wants every screen to have its own URL ????

    The only reason people are attached to that is because in the past it was the only way, using static webpages that were files located in folders, thus the "folder-based" term referring to the directory structure of the old web.
  • L. 2012-05-17 05:14
    Fred:
    L.:
    oheso:
    dogmatic:

    There are many times when a stateful web app cannot be easily restored with a back click.


    It's doable and it should be done. Don't pop up a new window on me because you're a lazy programmer.

    I have to work every day with other peeps' screwy web apps where the back button breaks stuff, and it gives me pleasure every day to think of awful things happening to those developers. Really awful things.


    You may be living in the past.

    My webapps are single page and your back button is both useless and not supported.

    What I mean there, is that there are much better ways to navigate than simply back and forward (that scheme only handles one path by the way), like a recent list adapted to your application for example.

    IMHO, any application DIRECTLY supporting the back button is a WTF in this day and age, there is only bad consequences to that kind of stuff.

    And any application supporting it INDIRECTLY is so missing the point because for the same work, one could simply put a better navigation scheme in place than ol' stupid backforward reload everything except some is cached but some is not ...
    Maybe I just don't get what you're saying (or maybe you a troll), but I would think supporting the back button is important irrespective of the paths you intend to support in your page - if it exists in the browser, user will (try to) use it - if you circumvent their ability to use the back button as they believe it will work then you are merely pissing off potential clients. You don't have to believe the back button is necessarily a good idea, but you have to understand that users expect certain behaviours in browsers where it's present (which I think is all of them at the mo)


    No. You will press the back button if you want to go back, that's true for all users.

    Now what does that mean when there's no "back" ? nothing. And it will not even cross your mind to press mouse4 because you don't want to go "back".

    I am talking about APPLICATIONS, not friggin websites OR random users OR potential clients.
  • L. 2012-05-17 05:15
    Fred:
    L.:
    Zylon:
    L.:
    IMHO, any application DIRECTLY supporting the back button is a WTF in this day and age, there is only bad consequences to that kind of stuff.

    IMHO, you're a troll and/or utterly clueless.

    Do users understand the browser back button?

    Also, fuck you Akismet. Let's see how much blather I have to tack on here before your incompetent heuristics decide this isn't spam.

    Interesting study, but that makes no goddamn difference.
    I'm talking about web applications, not websites or blogs or whatever.
    I'm talking about an application that has much easier ways to handle nav than back or forward.

    The fact that people using the web as it is today, i.e. ever so retarded and still in dire need of back forward nav due to its mainly folder file tree design, require a back button has absolutely no relevance when you design an application.

    Do you have a back button in Outlook ? calc ? notepad ?

    No, there are only back buttons where it makes sense, explorer, winamp and vlc.

    So quit using your failed rethoric on how websites should remain in the dark ages of folder-based html and join us in 2012, it's great here.
    Now I'm even more confused.

    "I'm not talking about Websites, I'm talking about web apps, which is why Websites shouldn't support a back button". So...Websites are old fashioned are they? I notice the likes of google, yahoo and facebook are still banking on them pretty heavily.

    When they start trying to get out of them at a rate of knots, I might start to worry...


    Nobody's talking about websites here.
  • Zylon 2012-05-17 10:59
    L.:
    Nobody's talking about websites here.

    Everyone except you is talking about websites here.

    You're just off in the corner being the spittle-spewing crazy guy.
  • JJ 2012-05-17 16:53
    L.:
    Do you have a back button in Outlook ?

    Yes. It's not there by default, but you can add it to the tool bar. And it'll let you navigate back through the folders you've been clicking on.
  • JJ 2012-05-17 17:11
    Keith H:
    There is actually an argument for the GUID from the production DB server: in SQL newid() returns a sequential ID, so it's much better for indexing than most GUIDs (which are much more random).

    Anon:
    Of course, it is better. If all GUIDs are generated on the DB server, they increase monotonically (depending on type of GUID but I presume this is why it was done) and it is faster to add rows with such GUIDs if any indexes are applied to these columns (like when primary key column is a GUID). TRWTF is the programmer who sent this.


    I question both of these statements. I ran the following SQL script:

    DECLARE @myid uniqueidentifier, @cnt int

    SET @cnt = 0

    WHILE @cnt < 20
    BEGIN
    SET @myid = NEWID()
    PRINT 'Value of @myid is: '+ CONVERT(varchar(255), @myid)
    SET @cnt = @cnt + 1
    END

    And got these results:

    Value of @myid is: 21026332-881C-4B45-B4AB-44B7408FC5FA
    Value of @myid is: 0523D6C4-ABAE-4B48-B607-116CA558895A
    Value of @myid is: CED0DDA9-E7A7-460C-9827-C7B1C554AD20
    Value of @myid is: 8D4D8151-D419-4E3E-AC41-03E308B405D9
    Value of @myid is: 1A0AA5A2-D4AE-465C-B990-3DCA04B34666
    Value of @myid is: 339A9289-EEC0-4ABA-B1F7-D22612FC2226
    Value of @myid is: D312DE2F-FE20-4111-A22F-07B46FA6F5F1
    Value of @myid is: 212C0D21-22E0-428E-A9CA-18C06EDA9FF2
    Value of @myid is: 67FB1BB5-9CE5-4E41-AA3C-893F454979B9
    Value of @myid is: 9B7EA234-4A61-483F-AC6A-3508E57083A6
    Value of @myid is: D9ABDC99-F0E9-4A32-99FF-D91B39DED459
    Value of @myid is: B9F71A1B-C538-44F5-8B99-BB52F4A7ED13
    Value of @myid is: 1EBC1EF9-8920-4252-9784-E1FB20C2EB87
    Value of @myid is: 0BF2BEF7-D1FB-49AC-A2CA-7C7FA2B876D6
    Value of @myid is: 52BAD120-D769-4374-84BF-372FAE59B915
    Value of @myid is: 7B176EB3-E043-48AC-94A1-077F98D83106
    Value of @myid is: F3A73B9A-BB1F-46B0-BCEA-752FE18AD971
    Value of @myid is: 471F65F4-999F-4283-9BD9-74440FC9E6D1
    Value of @myid is: 0DA978A1-2264-439C-ACAB-6795FBA9CA9D
    Value of @myid is: B2F775DD-1DC4-4F50-855F-EB0E3AE28EE7

    Can someone please explain the words "sequential" and "monotonic" as they relate to these results? Because I can't see how they do.
  • Toettoe 2012-05-18 04:32
    Regarding GUIDs see:
    http://blogs.msdn.com/b/ericlippert/archive/2012/04/30/guid-guide-part-two.aspx

    Addition: The shown code as a "WTF" looks like VBScript, which has no built-in GUID-class or GUID-methods, so the function shown as a "WTF" is a good idea.
  • JJ 2012-05-18 10:52
    Toettoe:
    Regarding GUIDs see:
    http://blogs.msdn.com/b/ericlippert/archive/2012/04/30/guid-guide-part-two.aspx

    Addition: The shown code as a "WTF" looks like VBScript, which has no built-in GUID-class or GUID-methods, so the function shown as a "WTF" is a good idea.

    That was my thought while reading the article, but a quick Google search before I posted showed a way to generate GUIDs in VBScript without the need for an external system like a database, so I declined to mention that part in my reply.

    Yes, you still need to instantiate an object that is outside of the base VBScript object model, but the DLL that provides this object is part of Windows. http://blogs.technet.com/b/heyscriptingguy/archive/2005/02/21/how-can-i-create-a-guid-using-a-script.aspx

    Wow. My first brush with Akismet being retarded....
  • Artem Chachanidze 2012-05-21 09:49
    JJ:
    Keith H:
    There is actually an argument for the GUID from the production DB server: in SQL newid() returns a sequential ID, so it's much better for indexing than most GUIDs (which are much more random).

    Anon:
    Of course, it is better. If all GUIDs are generated on the DB server, they increase monotonically (depending on type of GUID but I presume this is why it was done) and it is faster to add rows with such GUIDs if any indexes are applied to these columns (like when primary key column is a GUID). TRWTF is the programmer who sent this.


    I question both of these statements. I ran the following SQL script:

    DECLARE @myid uniqueidentifier, @cnt int

    SET @cnt = 0

    WHILE @cnt < 20
    BEGIN
    SET @myid = NEWID()
    PRINT 'Value of @myid is: '+ CONVERT(varchar(255), @myid)
    SET @cnt = @cnt + 1
    END

    And got these results:

    Value of @myid is: 21026332-881C-4B45-B4AB-44B7408FC5FA
    Value of @myid is: 0523D6C4-ABAE-4B48-B607-116CA558895A
    Value of @myid is: CED0DDA9-E7A7-460C-9827-C7B1C554AD20
    Value of @myid is: 8D4D8151-D419-4E3E-AC41-03E308B405D9
    Value of @myid is: 1A0AA5A2-D4AE-465C-B990-3DCA04B34666
    Value of @myid is: 339A9289-EEC0-4ABA-B1F7-D22612FC2226
    Value of @myid is: D312DE2F-FE20-4111-A22F-07B46FA6F5F1
    Value of @myid is: 212C0D21-22E0-428E-A9CA-18C06EDA9FF2
    Value of @myid is: 67FB1BB5-9CE5-4E41-AA3C-893F454979B9
    Value of @myid is: 9B7EA234-4A61-483F-AC6A-3508E57083A6
    Value of @myid is: D9ABDC99-F0E9-4A32-99FF-D91B39DED459
    Value of @myid is: B9F71A1B-C538-44F5-8B99-BB52F4A7ED13
    Value of @myid is: 1EBC1EF9-8920-4252-9784-E1FB20C2EB87
    Value of @myid is: 0BF2BEF7-D1FB-49AC-A2CA-7C7FA2B876D6
    Value of @myid is: 52BAD120-D769-4374-84BF-372FAE59B915
    Value of @myid is: 7B176EB3-E043-48AC-94A1-077F98D83106
    Value of @myid is: F3A73B9A-BB1F-46B0-BCEA-752FE18AD971
    Value of @myid is: 471F65F4-999F-4283-9BD9-74440FC9E6D1
    Value of @myid is: 0DA978A1-2264-439C-ACAB-6795FBA9CA9D
    Value of @myid is: B2F775DD-1DC4-4F50-855F-EB0E3AE28EE7

    Can someone please explain the words "sequential" and "monotonic" as they relate to these results? Because I can't see how they do.


    It's NEWSEQUENTIALID() that returns sequential GUID, not NEWID().
  • jasmine2501 2012-07-03 15:09
    Mr Anon:
    Sigivald:
    That is true, in its place.

    But what I noted in:


    Public Function Save() As Boolean
    Try
    SaveMeeting()
    Catch ex As Exception
    Throw ex
    End Try
    End Function


    was that the obvious explanation is that the catch block is there to let you <I>place a breakpoint</i> to catch it in the act, rather than being 'real' code intended to do anything useful in and of itself.

    I'd love to believe that, but I doubt it somehow. Our current codebase is full of this thanks to former VB6 developers learning C# who've been lead to believe that including a try-catch counts as "error checking", even if they haven't actually done anything with it.

    And, as others have pointed out, throw ex will mess up the stack trace info so even if you really needed to put a breakpoint there (instead of just breaking on exception) you ought to rethrow the original exception properly.

    I have a whole slew of WTFs from the same developers that I really ought to submit at some point....


    That is exactly how it got there.

    First... this probably made the front page because I used the VS extension, and I will agree it's not a really horrible WTF.

    However, it is a useless function that does nothing but push the stack. It causes a compiler warning (which the vendor says is "ok, it's just a warning, nothing important") because it can never return a value, but it does build. The SaveMeeting() function is the very next block in the code file, and it's not implementing an "ISaveAble" interface or something. All it does is push the stack, eat the exception, and return null. I don't buy the debugging argument, because you can just as easily put your breakpoint in the SaveMeeting function, or its exception handler (which does the same thing as this one... nothing).
  • burberry outlet 2012-08-01 02:45
    Well, the content of the bh, let me see the also want to see a few times more, content directly highlighted a theme, let the subject becomes more bright, and theme and then in line with the be fond of, it is too good, I'll focus on.