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

    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.

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

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

    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 (unregistered) in reply to xorsyst
    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 (unregistered) in reply to QJo
    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 (unregistered) in reply to snoofle
    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.
  • (cs) in reply to $$ERR:get_name_fail
    $$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;
    }
  • (cs)
    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 (unregistered)

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

    "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 (unregistered) in reply to My Name
    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:
    link text

    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.

    link text

    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 (unregistered) in reply to Anon
    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 (unregistered) in reply to poohshoes
    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 (unregistered)
    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 (unregistered)

    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.

  • (cs)

    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 (unregistered) in reply to Ralph
    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:
    link text

    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.

    link text

    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 (unregistered) in reply to oheso
    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 (unregistered) in reply to AN AWESOME CODER
    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 (unregistered) in reply to Harrow
    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 (unregistered)

    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 (unregistered) in reply to Ralph
    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 (unregistered) in reply to Ralph
    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:
    link text

    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.

    link text

    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.

  • _ (unregistered) in reply to You should quit trolling
    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:
    link text

    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.

    link text

    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 (unregistered) in reply to QJo

    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 (unregistered) in reply to _
    _:
    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:
    link text

    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.

    link text

    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.

  • (cs) in reply to _
    _:
    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.

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

  • (cs) in reply to Ralph
    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:
    link text

    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.

    link text

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

    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 (unregistered)
    <X-Backside-Transport>

    [voice=buthead] heh, heh, heh. He said "Backside" [/voice]

  • the beholder (unregistered) in reply to Zylon
    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 (unregistered)

    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 (unregistered) in reply to You should quit trolling
    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 (unregistered) in reply to Spudley
    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 (unregistered) in reply to SilentRunner
    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 :)

  • (cs) in reply to Ralph
    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 (unregistered) in reply to Ralph
    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:
    link text

    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.

    link text

    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.

  • (cs) in reply to Strolskon
    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 (unregistered) in reply to Bednee
    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.

  • (cs) in reply to AN AWESOME CODER
    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.

  • (cs) in reply to AN AWESOME CODER
    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 (unregistered) in reply to dogmatic
    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.
  • (cs) in reply to You should quit trolling
    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.

  • (cs)

    Ralph's position isn't degrading gracefully.

  • (cs) in reply to the beholder
    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.

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

Log In or post as a guest

Replying to comment #:

« Return to Article