Bank of Scotland's Keyboard Trap

« Return to Article
  • Russ 2012-09-19 08:03
    Achtung - I Bin Frist Berliner
  • Anketam 2012-09-19 08:05
    Does Java even allow this to compile (I don't normally use Java)? I thought that 'Microsoft Internet Explorer' would throw an exception since ' is reserved for chars not strings.
  • ammoQ 2012-09-19 08:07
    Anketam:
    Does Java even allow this to compile (I don't normally use Java)? I thought that 'Microsoft Internet Explorer' would throw an exception since '' is reserved for chars not strings.


    In JavaScript (which is generally interpreted, not compiled, btw.) both " and ' can be used to delimit strings. In JavaScript, chars are not seperate types, but simply strings with length 1, so there is no reason to distinguish between strings and chars.
  • mahe 2012-09-19 08:07
    It's JavaScript of course, so it doesn't compile anyway.
  • Remy Porter 2012-09-19 08:10
    Most JavaScript runtimes do compile the code, these days. JIT compilation, but still compiled. It's interpreted in the same way that MSIL is interpreted.
  • Philip Newton 2012-09-19 08:18
    The best bit is the condition which starts:

    if (event.keyCode == 18 && event.keyCode == 8


    Or perhaps they’re already ready for quantum computing, where the key code can be 8 and 18 simultaneously?
  • Gyxi 2012-09-19 08:22
    Anketam:
    Does Java even allow this to compile (I don't normally use Java)? I thought that 'Microsoft Internet Explorer' would throw an exception since ' is reserved for chars not strings.


    This comment is TRWTF
  • Nick 2012-09-19 08:22
    Philip Newton:
    The best bit is the condition which starts:

    if (event.keyCode == 18 && event.keyCode == 8


    Or perhaps they’re already ready for quantum computing, where the key code can be 8 and 18 simultaneously?


    LMAO.
    Schrödinger's "event.keyCode"
  • Jasper 2012-09-19 08:24
    So, to fix it, Wladimir installed Firefox or Chrome for his father?
  • Smug Unix User 2012-09-19 08:25
    I wonder what they would have coded for Lynx.
  • Harrison Killer 2012-09-19 08:33
    [quote]The jury's still out as to whether or not this contributes to the overall quality of the site, but rest assured Netscape fans, you are not forgotten.[/b]

    Let's work on our punctuation, shall we?
  • Martin 2012-09-19 08:43
    Wladimir Palant is btw notable for being the developer of the Adblock Plus extension: http://adblockplus.org/en/
  • daef 2012-09-19 08:44
    bigger article 'bout the same bank (GERMAN)
    http://www.infogurke.de/2010/07/erfahrungen-mit-bank-of-scotland/
  • The MAZZTer 2012-09-19 08:50
    Other WTFs to those not familiar with JS:

    event/e object is just data about the event. Setting properties on it has no effect outside of the event handler AFAIK, other event handlers will receive a fresh, new event object without the changed data. Only exception is event object has functions on it which do affect how the event is processed after this handler.

    Other than that... this is actually somewhat standard JS afaik for blocking certain keys from triggering standard browser actions. They could certainly write it better to work on all browsers (sniff based on event object presence and properties, not on app name).

    But they probably are being a little overzealous on the key blocking. 8 is the key code for the TAB key, which switches keyboard input between form fields, and you probably shouldn't block it for keyboard navigation/accessibility.
  • Anketam 2012-09-19 08:51
    Gyxi:
    Anketam:
    Does Java even allow this to compile (I don't normally use Java)? I thought that 'Microsoft Internet Explorer' would throw an exception since ' is reserved for chars not strings.


    This comment is TRWTF
    Your mom is TRWTF.

    - When all else fails, resort to name calling.
  • Brian E 2012-09-19 08:53
    TRWTF is that event is undefined in this function.
    They named the parameter e.

    > function disablekeyboardnavigation(e)

    e is only used in "else if (navigator.appName == 'Netscape')".

    Thank the coder for cut/paste.
  • Pebs 2012-09-19 08:57
    So, to fix it, Wladimir installed Firefox or Chrome for his father?

    Both Firefox and Chrome have "Netscape" in the navigator.appName variable. IFAIK, it's one of those things that's just there for backwards compatibility reasons to support legacy JavaScript code.
  • Ryan E 2012-09-19 09:04
    I really like the function above that one in the js file:


    function returnFalse () {return false;}


    Why just use false, when you can returnFalse()?
  • Meh 2012-09-19 09:05
    The MAZZTer:
    8 is the key code for the TAB key, which switches keyboard input between form fields, and you probably shouldn't block it for keyboard navigation/accessibility.


    Unless IE is more messed up than I think it is, 8 is backspace. 9 is tab.
  • Dave 2012-09-19 09:08
    Brian E:
    TRWTF is that event is undefined in this function.
    They named the parameter e.

    > function disablekeyboardnavigation(e)

    e is only used in "else if (navigator.appName == 'Netscape')".

    Thank the coder for cut/paste.

    That is IE's WTF, only Netscape passes the event object in the parameter, in IE you have to use the global window.event.
  • GoodtimesSnuggler 2012-09-19 09:09
    Brian E:
    TRWTF is that event is undefined in this function.
    They named the parameter e.

    > function disablekeyboardnavigation(e)

    e is only used in "else if (navigator.appName == 'Netscape')".

    Thank the coder for cut/paste.


    Event isn't undefined. All browsers (minus IE) use the first argument as the event object. IE uses window.event, which is the last pushed event.
  • Dave 2012-09-19 09:12
    The MAZZTer:
    Other WTFs to those not familiar with JS:

    event/e object is just data about the event. Setting properties on it has no effect outside of the event handler AFAIK, other event handlers will receive a fresh, new event object without the changed data.

    In IE setting event.keycode=0 stops the event being passed to the control.
  • ¯\(°_o)/¯ I DUNNO LOL 2012-09-19 09:26
    Ryan E:
    I really like the function above that one in the js file:

    function returnFalse () {return false;}

    Why just use false, when you can returnFalse()?

    function returnFileNotFound () {return FileNotFound;}

    TRWTF is the Bank of Scotland using German text? Ach, laddie! This canna be troo!
  • My name is unimportant 2012-09-19 09:30
    Judging by the comments and disagreement so far about how JavaScript behaves or doesn't behave in certain browsers, once again, it must be said - TRWTF is JavaScript. But I guess it still beats flash.
  • Gary 2012-09-19 09:44
    Pebs:
    So, to fix it, Wladimir installed Firefox or Chrome for his father?

    Both Firefox and Chrome have "Netscape" in the navigator.appName variable. IFAIK, it's one of those things that's just there for backwards compatibility reasons to support legacy JavaScript code.


    Of course the code tests for equality not substring. Not that we were running short on WTFs today, but one must save up for potential lean times ahead.

    captcha: augue ... a fever that portends ill
  • El Pollo Diablo 2012-09-19 09:46
    ¯\(°_o)/¯ I DUNNO LOL:
    Ryan E:
    I really like the function above that one in the js file:

    function returnFalse () {return false;}

    Why just use false, when you can returnFalse()?

    function returnFileNotFound () {return FileNotFound;}

    TRWTF is the Bank of Scotland using German text? Ach, laddie! This canna be troo!



    Apparantly they have some German speaking customers, considering the existence of www-dot-bankofscotland-dot-de (Bad akismet *slap*. Enterily relevant stuff, here).
  • @Deprecated 2012-09-19 09:53
    Philip Newton:
    The best bit is the condition which starts:

    if (event.keyCode == 18 && event.keyCode == 8


    Or perhaps they’re already ready for quantum computing, where the key code can be 8 and 18 simultaneously?


    This bit is not bad, either:

    if ((event.altKey) && (event.srcElement.tagName == "INPUT")) {
    }
    if ((event.keyCode == 96) || (event.keyCode == 97) || (event.keyCode == 98)) {
    }
    if ...


    missing some else statements, perhaps?

  • iWantToKeepAnon 2012-09-19 09:59
    Ryan E:
    I really like the function above that one in the js file:


    function returnFalse () {
    /* that's it. */
    return false;
    }


    Why just use false, when you can returnFalse()?


    There, fixed it.
  • F 2012-09-19 10:00
    El Pollo Diablo:
    ¯\(°_o)/¯ I DUNNO LOL:
    Ryan E:
    I really like the function above that one in the js file:

    function returnFalse () {return false;}

    Why just use false, when you can returnFalse()?

    function returnFileNotFound () {return FileNotFound;}

    TRWTF is the Bank of Scotland using German text? Ach, laddie! This canna be troo!



    Apparantly they have some German speaking customers, considering the existence of www-dot-bankofscotland-dot-de (Bad akismet *slap*. Enterily relevant stuff, here).


    However, the ones who choose to use Netscape are expected to cope with an error message in English.
  • Gary 2012-09-19 10:01
    Ryan E:
    I really like the function above that one in the js file:


    function returnFalse () {return false;}


    Why just use false, when you can returnFalse()?


    There is some more work to be done here. I see quite a few return falses in the code. These should all be rewritten: return returnFalse();

    Of course there are also return trues, hence a new function

    function returnTrue() {return true;}

    with usage: return returnTrue();

    Of course, this is horrible practice, because it should be refactored to a single function:


    function returnTrueOrFalseOrSomethingElse(bool) {
    try{
    returnTrueOrFalse( (bool)?bool:false);
    }
    catch(e) {
    return (bool)?bool:false;
    }


    and we can use it like this both as a return value or as an parameter-less event handler.

    return returnTrueOrFalse(true)

    document.onpaste=returnFalse;


    I suppose all that recursion makes the function robust enough that it can be used a general-purpose returner function, so all stupid usages like return returnValue; can be replaced with return returnTrueOrFalseOrSomethingElse(returnvalue);

    C programmers of course would just overload return.
  • Cbuttius 2012-09-19 10:02
    from google translate:

    The selected action can not be executed. Please use the navigation at your online banking division
  • F 2012-09-19 10:03
    My name is unimportant:
    Judging by the comments and disagreement so far about how JavaScript behaves or doesn't behave in certain browsers, once again, it must be said - TRWTF is JavaScript. But I guess it still beats flash.


    That's a little unreasonable. Irrational differences in how browsers invoke Javascript functions are not the fault of Javascript, any more than rendering quirks are the fault of the graphics subsystem.

    And most of the Javascript WTFs result from letting idiots write code. Just like every other language ...
  • Cbuttius 2012-09-19 10:05
    The MAZZTer:
    Other WTFs to those not familiar with JS:

    event/e object is just data about the event. Setting properties on it has no effect outside of the event handler AFAIK, other event handlers will receive a fresh, new event object without the changed data. Only exception is event object has functions on it which do affect how the event is processed after this handler.

    Other than that... this is actually somewhat standard JS afaik for blocking certain keys from triggering standard browser actions. They could certainly write it better to work on all browsers (sniff based on event object presence and properties, not on app name).

    But they probably are being a little overzealous on the key blocking. 8 is the key code for the TAB key, which switches keyboard input between form fields, and you probably shouldn't block it for keyboard navigation/accessibility.


    Have Mozilla yet fixed the Alt-S for submit form rather than history yet?
  • iWantToKeepAnon 2012-09-19 10:07
    My name is unimportant:
    Judging by the comments and disagreement so far about how JavaScript behaves or doesn't behave in certain browsers, once again, it must be said - TRWTF is JavaScript. But I guess it still beats flash.


    Don't blame the language for the sins of the browser wars and piss poor browser/DOM integration. That's not the language's fault, it's Microsoft's fault. And Netscape's too.

    It'd be great if we could get browser vendors to agree on a DOM, event, and parameter passing standard; and to cut all the old spaghetti code and make some rational sense of it all. But that'd break the web and browsers would have to provide backwards compatibility modes and things would only get worse. Better to use a library that abstracts all that away and let's you focus on using JS in all its glory (well it does have *some*) to write your app.
  • ¯\(°_o)/¯ I DUNNO LOL 2012-09-19 10:31
    F:
    And most of the Javascript WTFs result from letting idiots write code. Just like every other language ...
    B...b...but he can't be an idiot! He knew how to make a square root function from bailing wire and a hockey ticket!
  • Robin 2012-09-19 10:48
    Harrison Killer:
    [ quote]The jury's still out as to whether or not this contributes to the overall quality of the site, but rest assured Netscape fans, you are not forgotten.[/b]

    Let's work on our punctuation, shall we?


    Let's work on our tag matching, shall we? (quote != b)

    Muphry's Law strikes again.
  • iToad 2012-09-19 10:52
    Nick:
    Philip Newton:
    The best bit is the condition which starts:

    if (event.keyCode == 18 && event.keyCode == 8


    Or perhaps they’re already ready for quantum computing, where the key code can be 8 and 18 simultaneously?


    LMAO.
    Schrödinger's "event.keyCode"


    It's a property in the Schrödinger.event .NET assembly.
  • TopTension 2012-09-19 10:59
    This site really is horrible. If I hit the Enter key (in Opera) after entering name and password or the answer to the security question, I get the "400 - Bad request" error page. I have to grab the mouse and click the button instead.

    Not surprising after seeing the code...
  • Ralph 2012-09-19 11:15
    document.onkeydown = disablekeyboardnavigation;

    No.

    I don't think so.

    I'm afraid you are very, very confused. It is my computer. Not yours. N-O-T Y-O-U-R C-O-M-P-U-T-E-R. Can you hear me yet?

    There's a reason humans invented language. Not everything can be expressed by pointing and grunting. And even if it could, language is so much more efficient for those who can be bothered to learn it. And despite what the "usability" crapspewers insist, most everyone can learn language.

    You can have my keyboard when you pry it from my cold dead fingers, fuckyouverymuch.

    This is why I do not give permission for random asshats to take control of my browser.

    You forgot to disable my shotgun while you were at it.

    Do the world a favor and die. Please just die already. Yes I really mean it.
  • jugis 2012-09-19 11:27
    Anketam:
    Gyxi:
    Anketam:
    Does Java even allow this to compile (I don't normally use Java)? I thought that 'Microsoft Internet Explorer' would throw an exception since ' is reserved for chars not strings.


    This comment is TRWTF
    Your mom is TRWTF.

    - When all else fails, resort to name calling.


    Seriously, if after about 17 years of Internet a developer - regardless of when they started calling themselves one - hasn't touched HTML (and, with it, JavaScript; and then some), please step away from the fucking computer.
  • C-Derb 2012-09-19 11:31
    @Deprecated:
    Philip Newton:
    The best bit is the condition which starts:

    if (event.keyCode == 18 && event.keyCode == 8


    Or perhaps they’re already ready for quantum computing, where the key code can be 8 and 18 simultaneously?


    This bit is not bad, either:

    if ((event.altKey) && (event.srcElement.tagName == "INPUT")) {
    }
    if ((event.keyCode == 96) || (event.keyCode == 97) || (event.keyCode == 98)) {
    }
    if ...


    missing some else statements, perhaps?



    Personally, I'm partial to this, because, you know, maybe event.keyCode will change when the if statement is evaluated...


    if (event.keyCode == 8)
    {
    if ((event.keyCode == 8) && (event.srcElement.tagName != "INPUT"))
    {
    ...
    }
  • Garrison Fiord 2012-09-19 11:36
    Ralph:
    document.onkeydown = disablekeyboardnavigation;

    No.

    I don't think so.

    I'm afraid you are very, very confused. It is my computer. Not yours. N-O-T Y-O-U-R C-O-M-P-U-T-E-R. Can you hear me yet?

    There's a reason humans invented language. Not everything can be expressed by pointing and grunting. And even if it could, language is so much more efficient for those who can be bothered to learn it. And despite what the "usability" crapspewers insist, most everyone can learn language.

    You can have my keyboard when you pry it from my cold dead fingers, fuckyouverymuch.

    This is why I do not give permission for random asshats to take control of my browser.

    You forgot to disable my shotgun while you were at it.

    Do the world a favor and die. Please just die already. Yes I really mean it.


    There is precedent for not allowing you to have full control of your property when it is visiting the property of others, i.e. you may be stopped and/or removed from your vehicle if you are driving it through the 2nd floor of your local mall.

    You can take your over reactions and your handy-dandy keyboard shortcuts to some other bank.
  • lanmind 2012-09-19 11:41
    Philip Newton:
    The best bit is the condition which starts:

    if (event.keyCode == 18 && event.keyCode == 8


    Or perhaps they’re already ready for quantum computing, where the key code can be 8 and 18 simultaneously?


    I don'y dirty my hands with javascript, but isn't this the sort of code you would need to write to capture shift-tab and the like?

    Of course, trwtf is disabling keyboard navigation.
  • TopTension 2012-09-19 11:57
    jugis:
    Seriously, if after about 17 years of Internet a developer - regardless of when they started calling themselves one - hasn't touched HTML (and, with it, JavaScript; and then some), please step away from the fucking computer.


    You may not be aware of it, but not all is Internet in IT. I've been writing programs for 30 years and still didn't have to touch HTML, believe it or not. Nothing wrong with the internet, but IT is more than websites.
  • Shinobu 2012-09-19 12:00
    Ryan E:
    BoS:
    function returnFalse () {return false;}
    Why just use false, when you can returnFalse()?
    Because they're using it in places where it's getting called later and at that point it must return false. This is perfectly normal, although the things they're doing with it are evil.
    Of course TRWTF is that browsers allow websites to mess keyboard navigation, selection and context menus up in the first place. As a browser developer you should always ask yourself how a feature will be used to abuse the user. And yes that may mean (must mean) that web applications won't be able to do everything a native application can - and there's nothing wrong with that.
  • DavidN 2012-09-19 12:08
    Aaaaagh! That's... appalling, but it isn't even the worst thing about the Bank of Scotland's online system. A while ago, I had to reset my security information, a step which looked like a fairly innocuous "set up security question/answers" page - but I absolutely couldn't convince the form to submit...

    You had to select three security questions from pick lists (what is your mother's maiden name, what was the make and model of your first car, and so on), and then type in an entirely custom question and answer for the fourth one. It was the custom question field that seemed to be the problem - all the other fields appeared to be all right, and I only ever got an unhelpful "Please set: Your own choice of question" error message when I tried to submit the form. So I initially thought that some overengineered security check was marking my question as being too common, or not forming a sentence it could parse, or something of equal silliness.

    But then I tore into the Javascript of the page, and realized that their question field was subject to the same validation check as the rest of the fields - you can have no spaces or special characters in your question (such as, fairly importantly, a question mark), or it won't be accepted. Once I pared my question down to "whatisyourfavouritecolour", I could finally get through.

    I have to wonder if they didn't notice a sharp drop in the number of online accounts being created...
  • F 2012-09-19 12:10
    lanmind:
    Philip Newton:
    The best bit is the condition which starts:

    if (event.keyCode == 18 && event.keyCode == 8


    Or perhaps they’re already ready for quantum computing, where the key code can be 8 and 18 simultaneously?


    I don'y dirty my hands with javascript, but isn't this the sort of code you would need to write to capture shift-tab and the like?

    Of course, trwtf is disabling keyboard navigation.


    In a word, no.

    The only purpose served by code such as this is to use up processor cycles making tests that can never be satisfied.
  • da Doctah 2012-09-19 12:20
    Ryan E:
    I really like the function above that one in the js file:


    function returnFalse () {return false;}


    Why just use false, when you can returnFalse()?

    Information hiding.

    In case the value of false ever changes, you only have to change it in one place.
  • Rick 2012-09-19 12:32
    My name is unimportant:
    Judging by the comments and disagreement so far about how JavaScript behaves or doesn't behave in certain browsers, once again, it must be said - TRWTF is JavaScript. But I guess it still beats flash.
    Anybody look at Dart, Google's JavaScript killer? JavaScript does need to die; a slow and painful death without any palliative care.
  • chubertdev 2012-09-19 12:48
    da Doctah:
    Ryan E:
    I really like the function above that one in the js file:


    function returnFalse () {return false;}


    Why just use false, when you can returnFalse()?

    Information hiding.

    In case the value of false ever changes, you only have to change it in one place.


    var willValueOfFalseEverChange = returnFalse();
  • PiisAWheeL 2012-09-19 12:48
    lanmind:
    Philip Newton:
    The best bit is the condition which starts:

    if (event.keyCode == 18 && event.keyCode == 8


    Or perhaps they’re already ready for quantum computing, where the key code can be 8 and 18 simultaneously?


    I don'y dirty my hands with javascript, but isn't this the sort of code you would need to write to capture shift-tab and the like?

    Of course, trwtf is disabling keyboard navigation.
    No. This code disables alt+backspace.
    Backspace is previous page in ie. Not sure what alt+backspace does but it doesnt do anything on my browser.
  • chubertdev 2012-09-19 12:53
    PiisAWheeL:
    No. This code disables alt+backspace.
    Backspace is previous page in ie. Not sure what alt+backspace does but it doesnt do anything on my browser.


    They may have been thinking of Alt+Left.

    I can just see the developer creating this, testing it by pressing Alt+Backspace, oblivious to the fact that they had the wrong key combination.

    But just like the developer, I won't over-think this.
  • SilentRunner 2012-09-19 12:57
    I hate it when someone puts a big gray blob in front of my face and says, "Hey, look at this!".

    Please, explain what the hell that gray blob is all about.
  • Sebastian Buchannon 2012-09-19 13:07
    This reminds me of the time I had to catch some particularly tricking keystroke combinations originating from client terminals. Interesting story: There were perhaps a dozen keystroke combinations that needed handling, including a variety of modifier doubles and triple chords. Rather than implement the logic chain as a long series of if statements, I opted instead to compile the set of combinations into an internal memory structure with a dictionary lookup. Including sufficient documentation I believe I completed the task in no more than three hours. Still haven't heard of any problems to this day so I must have nailed it.
  • Anketam 2012-09-19 13:15
    jugis:
    Anketam:
    Gyxi:
    Anketam:
    Does Java even allow this to compile (I don't normally use Java)? I thought that 'Microsoft Internet Explorer' would throw an exception since ' is reserved for chars not strings.


    This comment is TRWTF
    Your mom is TRWTF.

    - When all else fails, resort to name calling.


    Seriously, if after about 17 years of Internet a developer - regardless of when they started calling themselves one - hasn't touched HTML (and, with it, JavaScript; and then some), please step away from the fucking computer.
    Believe it or not there is a ton of programming work that does not involve JavaScript. As such I have yet to even work on a program that uses Java or JavaScript, so my knowledge of both is pretty limited hence my question for clarification. It is better that a programmer ask questions then just assume they know everything or else their code will end up on this website.
  • PiisAWheeL 2012-09-19 13:19
    Anketam:
    Believe it or not there is a ton of programming work that does not involve JavaScript. As such I have yet to even work on a program that uses Java or JavaScript, so my knowledge of both is pretty limited hence my question for clarification.
    There is also google. It could tell you that javascript and java are about as similar to each other as boat and car. 2 modes of transportation in completly different contexts. But I'm just trollin'. (Yes that was also a boat pun.)
  • BlackKnight 2012-09-19 13:24
    El Pollo Diablo:
    Apparantly they have some German speaking customers, considering the existence of www-dot-bankofscotland-dot-de (Bad akismet *slap*. Enterily relevant stuff, here).


    Shouldn't that be www-Punkt-bankofscotland-Punkt-de
  • jay 2012-09-19 13:36
    Anketam:
    Believe it or not there is a ton of programming work that does not involve JavaScript. As such I have yet to even work on a program that uses Java or JavaScript, so my knowledge of both is pretty limited hence my question for clarification. It is better that a programmer ask questions then just assume they know everything or else their code will end up on this website.


    But guessing and speculating wildly is so much easier than doing research!
  • jay 2012-09-19 13:38
    PiisAWheeL:
    Anketam:
    Believe it or not there is a ton of programming work that does not involve JavaScript. As such I have yet to even work on a program that uses Java or JavaScript, so my knowledge of both is pretty limited hence my question for clarification.
    There is also google. It could tell you that javascript and java are about as similar to each other as boat and car. 2 modes of transportation in completly different contexts. But I'm just trollin'. (Yes that was also a boat pun.)


    I saw a FAQ on Javascript once that included the question, "What is the relationship between Javascript and Java?". The answer they gave was, "The names begin with the same four letters."
  • jay 2012-09-19 13:57
    jugis:
    Seriously, if after about 17 years of Internet a developer - regardless of when they started calling themselves one - hasn't touched HTML (and, with it, JavaScript; and then some), please step away from the fucking computer.


    What a curious comment. Suppose someone said, "Seriously, if after 60 years of jets an aeronautical engineer -- regardless of when they started calling themselves one -- hasn't touched jet engines, please step away from the drafting board."

    Because after all, now that jets have been invented, why would anyone design, build, and maintain propellor-driven aircraft?

    Now that the automobile has been invented, why would anyone build a boat?

    Now that laser printers have been invented, why would anyone make a pencil?

    Etc etc. Just because a new technology has come along doesn't necessarily make all previously-existing technologies obsolete. And given that there's still a use for the older technologies, it stands to reason that some people will continue to work on the older technology and not have the time or inclination to work on the new technology. We can't all do everything. People specialize.

    PS I spend about 95% of my time developing web apps. But I recognize the value of people who make desktop apps. Like the folks who make MW Word, Eclipse, Photoshop, etc.
  • Captcha:appellatio 2012-09-19 14:03
    Ryan E:
    I really like the function above that one in the js file:


    function returnFalse () {return false;}


    Why just use false, when you can returnFalse()?

    You must be an object-oriented programmer. Why use item.property when you can do item.propertyGetter()?


    And why do y=parse(x), when you can do
    myParser=parselib.parser.getParser()
    
    myInitializer=myParser.initializerGenerator.newDefaultInitializer(parselib.DEFAULT_VALUE)
    myInitializer.initializeInitializer()
    myParser.initialize(myInitializer.run())
    myParser.loadInput(x)
    myParser.run()
    result=myParser.getResult()
    y=result.get()
    ?


    Of course, before you even
    import parselib
    you'll have to read the documentation of parselib_simple, libparse, libdissect (a fork of libparse with some elements from parselib), open_parser_lib (which was the result of the merging of free_parse_reader and parse2000.advanced), and MS_PARSE (free for non-commercial use), to see which one suits best your needs.
  • quibus 2012-09-19 14:05
    TopTension:
    jugis:
    Seriously, if after about 17 years of Internet a developer - regardless of when they started calling themselves one - hasn't touched HTML (and, with it, JavaScript; and then some), please step away from the fucking computer.


    You may not be aware of it, but not all is Internet in IT. I've been writing programs for 30 years and still didn't have to touch HTML, believe it or not. Nothing wrong with the internet, but IT is more than websites.


    Question is: how can you not be even a little curious how to build a web page in the 2nd half of your career? So, even though you've been programming mainframes for 30 years, you're no more advanced user of a browser than my wife (who knows how to facebook and gmail, and that's about it)? You can't be serious... I'm not impressed by your 30 years at all.
  • feugiat 2012-09-19 14:13
    jay:
    jugis:
    Seriously, if after about 17 years of Internet a developer - regardless of when they started calling themselves one - hasn't touched HTML (and, with it, JavaScript; and then some), please step away from the fucking computer.


    What a curious comment. Suppose someone said, "Seriously, if after 60 years of jets an aeronautical engineer -- regardless of when they started calling themselves one -- hasn't touched jet engines, please step away from the drafting board."

    Because after all, now that jets have been invented, why would anyone design, build, and maintain propellor-driven aircraft?

    Now that the automobile has been invented, why would anyone build a boat?

    Now that laser printers have been invented, why would anyone make a pencil?

    Etc etc. Just because a new technology has come along doesn't necessarily make all previously-existing technologies obsolete. And given that there's still a use for the older technologies, it stands to reason that some people will continue to work on the older technology and not have the time or inclination to work on the new technology. We can't all do everything. People specialize.

    PS I spend about 95% of my time developing web apps. But I recognize the value of people who make desktop apps. Like the folks who make MW Word, Eclipse, Photoshop, etc.



    The point is: every one of those desktop or server developers are probably using Internet to research and learn, at least at home (in case their retard employer doesn't allow them to progress). If during last 15 years every one of those never stumbled upon a snippet of HTML and JavaScript, I don't know what to think of them. Even if they haven't stumbled upon those, they should have, by definition of being a developer, at some point, show at least a small amount of interest to just look at it (before they decide to not learn it, for example). E.g. I never wrote a line of Java, but I've seen snippets hundreds of times, and I'd feel confident to dive into it, if I had to. I don't get it...
  • Anketam 2012-09-19 14:43
    In my case I have only been an official software developer for 4 years. I have done stuff in college with php (which lets not even go there), and post-college for random non work things which did involve the Internet I have used aspx and Grails. But none of my professional work has involved JavaScript (nor Java, hence why I accidently mistook the code snippet for Java and was confused). JavaScript, Java (and several of its frameworks), NoSQL, and Ruby are on my todo list of things to learn.
  • Not 2012-09-19 14:54
    quibus:
    TopTension:
    jugis:
    Seriously, if after about 17 years of Internet a developer - regardless of when they started calling themselves one - hasn't touched HTML (and, with it, JavaScript; and then some), please step away from the fucking computer.


    You may not be aware of it, but not all is Internet in IT. I've been writing programs for 30 years and still didn't have to touch HTML, believe it or not. Nothing wrong with the internet, but IT is more than websites.


    Question is: how can you not be even a little curious how to build a web page in the 2nd half of your career? So, even though you've been programming mainframes for 30 years, you're no more advanced user of a browser than my wife (who knows how to facebook and gmail, and that's about it)? You can't be serious... I'm not impressed by your 30 years at all.


    How can you not be curious how to build a desktop app like Word or Excel, which is much more complicated than a web page, and has been around longer?

    Answer is... some people just don't care, just as I completely don't care how my CPU works.
  • Ben Jammin 2012-09-19 15:31
    if (event.keyCode == 18 && event.keyCode == 8  [SNIP]

    Most people are missing the ingeniousness of this code. Instead of using event.altKey, the original programmer has realized that most people don't press alt and backspace together. Instead, users generally lead with the alt key and at a barely noticeable span of time later, follow with the backspace.

    From this realization, we expert readers can see, that when the alt key is pressed, the first condition will register true, and then the backspace key will be pressed in ample time for the second condition to be tested.
  • cg 2012-09-19 15:32
    jugis / quibus; what a fsckhead!

    When is the last time you coded in assembly language? How about even in straight C?

    When is the last time you coded source for a language rather than just used a language?

    Do you know the difference between a spinlock, a semaphore, and a mutex?

    Do you understand the electronics behind an address line change from a 0 to a 1?

    When is the last time you coded at ring 0?

    When is the last time you coded for an embedded processor like keyboard or wifi?

    Do you understand how the speed of light limits the length of transmission lines in very high speed processors?

    Do you understand the reason that silicon must be doped for standard bipolar and FET transistors to work?

    All of these things and uncountable more are performed regularly so that people like you don't have to know about them.

    I have coded in HTML, I have coded scripts that code HTML, but I don't presume that everyone has had the time in their long life to learn and use everything.

    You must be really young to be so foolish. That is the reason they don't allow people so young to high office.

    Sorry (everyone else) for the rant, but a man's got to know his limits.
  • snoofle 2012-09-19 15:38
    jay:
    jugis:
    Seriously, if after about 17 years of Internet a developer - regardless of when they started calling themselves one - hasn't touched HTML (and, with it, JavaScript; and then some), please step away from the fucking computer.


    What a curious comment. Suppose someone said, "Seriously, if after 60 years of jets an aeronautical engineer -- regardless of when they started calling themselves one -- hasn't touched jet engines, please step away from the drafting board." after all, now that jets have been invented, why would anyone design, build, and maintain propellor-driven aircraft?

    Now that the automobile has been invented, why would anyone build a boat?

    Now that laser printers have been invented, why would anyone make a pencil?

    Etc etc. Just because a new technology has come along doesn't necessarily make all previously-existing technologies obsolete. And given that there's still a use for the older technologies, it stands to reason that some people will continue to work on the older technology and not have the time or inclination to work on the new technology. We can't all do everything. People specialize.

    PS I spend about 95% of my time developing web apps. But I recognize the value of people who make desktop apps. Like the folks who make MW Word, Eclipse, Photoshop, etc.

    Agreed! Although I've been working on financial applications for close to 30 years (all of which were supposed to eventually replace the mainframes on which ran the COBOL programs on which the businesses kept their books and records), I have yet to hear of anyone actually decommissioning any COBOL program, let alone shutting down a mainframe.

    Don't get me wrong, I'm sure the odd major COBOL program has been tossed, but it's the exception, not the rule.

    For the record, I've worked professionally in SGML (long before HTML), Basic, Pascal, FORTRAN (assorted), assorted assemblers, SNOBOL, ALGOL, Ada, C, C++ and Java and only a smattering of HTML. I once had the, erm, pleasure of debugging a COBOL program. I have never worked in Perl, Javascript, or anything .NET yet they clearly have their value.
  • Not him 2012-09-19 15:45
    A year ago, today, never, yes, sort of, I don't think I have, never, I can imagine it, yes. Sorry I'm not much of a hardware person.



    And in his defense, the initial WTF is not not having programmed in Javascript, but rather assuming that '' means char.
  • JJ 2012-09-19 16:42
    With the prevalence of the Web over the last 18+ years, if you are a programmer and haven't taken any kind of look into HTML then you are what I consider to be the worst kind of programmer: the uninquisitive kind.

    I'm not talking about javascript. I'm not talking about XML. I'm not talking about CSS. I'm talking about plain old HTML. And I don't care if your job involves writing microcode for some embedded chip that won't get within a mile of a Web browser; the fact that you're on this site mean you're exposed to HTML on a regular basis. I just don't get how anyone could not care.

    (I do, however, get that there are people who don't care. And I form an opinion of them based on that.)
  • avi 2012-09-19 17:45
    I love the logic of switching to German error messages.
  • esse 2012-09-19 18:24
    Not:
    quibus:
    TopTension:
    jugis:
    Seriously, if after about 17 years of Internet a developer - regardless of when they started calling themselves one - hasn't touched HTML (and, with it, JavaScript; and then some), please step away from the fucking computer.


    You may not be aware of it, but not all is Internet in IT. I've been writing programs for 30 years and still didn't have to touch HTML, believe it or not. Nothing wrong with the internet, but IT is more than websites.


    Question is: how can you not be even a little curious how to build a web page in the 2nd half of your career? So, even though you've been programming mainframes for 30 years, you're no more advanced user of a browser than my wife (who knows how to facebook and gmail, and that's about it)? You can't be serious... I'm not impressed by your 30 years at all.


    How can you not be curious how to build a desktop app like Word or Excel, which is much more complicated than a web page, and has been around longer?

    Answer is... some people just don't care, just as I completely don't care how my CPU works.


    I'm willing to bet that at least every Visual Studio user (thus, developer on MS platform) knows basics about desktop programming, even though they may be spending most of their time working on web apps. Yes, they may be a lousy desktop developer, but they certainly know how to read that code. Even if that's not the case with other web developers, the fact is that EVERYONE who calls themselves a developer uses Internet (browser, HTML, JavaScript) and not being curious to view source code and how the hell all that functions is beyond me. But, winning this argument with you is impossible. Enjoy your COBOL.
  • quibus 2012-09-19 18:29
    JJ:
    With the prevalence of the Web over the last 18+ years, if you are a programmer and haven't taken any kind of look into HTML then you are what I consider to be the worst kind of programmer: the uninquisitive kind.

    I'm not talking about javascript. I'm not talking about XML. I'm not talking about CSS. I'm talking about plain old HTML. And I don't care if your job involves writing microcode for some embedded chip that won't get within a mile of a Web browser; the fact that you're on this site mean you're exposed to HTML on a regular basis. I just don't get how anyone could not care.

    (I do, however, get that there are people who don't care. And I form an opinion of them based on that.)


    Thank you, Lord - at least one sane here. Your (and mine) arguments are relatively (more than not) sound. It's almost like being a driver for 30 years and not know how to change a tire (or RECOGNIZE one, which is more accurate comparison here).
  • quibus 2012-09-19 18:36
    cg:
    jugis / quibus; what a fsckhead!

    When is the last time you coded in assembly language? How about even in straight C?

    When is the last time you coded source for a language rather than just used a language?

    Do you know the difference between a spinlock, a semaphore, and a mutex?

    Do you understand the electronics behind an address line change from a 0 to a 1?

    When is the last time you coded at ring 0?

    When is the last time you coded for an embedded processor like keyboard or wifi?

    Do you understand how the speed of light limits the length of transmission lines in very high speed processors?

    Do you understand the reason that silicon must be doped for standard bipolar and FET transistors to work?

    All of these things and uncountable more are performed regularly so that people like you don't have to know about them.

    I have coded in HTML, I have coded scripts that code HTML, but I don't presume that everyone has had the time in their long life to learn and use everything.

    You must be really young to be so foolish. That is the reason they don't allow people so young to high office.

    Sorry (everyone else) for the rant, but a man's got to know his limits.



    I think you're a dumbass. No, I don't know any of those things, but that's so beyond the point, and I'm not going to waste my time explaining that to you.

    In the context of comparing knowing how to change a tire on a car: every mechanic and automotive engineer knows the mechanics of driving, but you cannot expect every driver to know the mechanics of car engine. Yet you can expect most drivers to know mechanics of changing a tire. There will always be drivers who don't want to (women and male-pussies), and there will always be drivers who physically cannot, but not being curious to KNOW how a tire is changed is plain incompetence. I piss on your 30 years of Assembly and COBOL. You probably create crap on daily basis.
  • chubertdev 2012-09-19 18:48

    if (navigator.appName == 'Netscape')
    alert('Du werdest einen krankenschwester brauchen!');
    return returnFalse();
    }


    Cookie if you know what that is from.
  • Maurits 2012-09-19 19:30
    ¯\(°_o)/¯ I DUNNO LOL:
    F:
    And most of the Javascript WTFs result from letting idiots write code. Just like every other language ...
    B...b...but he can't be an idiot! He knew how to make a square root function from bailing wire and a hockey ticket!


    It's baling wire; for tying things up into bales, not for getting water out of a boat.
  • Coyne 2012-09-19 21:04
    Nick:
    Philip Newton:
    The best bit is the condition which starts:

    if (event.keyCode == 18 && event.keyCode == 8


    Or perhaps they’re already ready for quantum computing, where the key code can be 8 and 18 simultaneously?


    LMAO.
    Schrödinger's "event.keyCode"


    if (event.keyCode==8 && event.keyCode==18) ... true...
    
    ---snip---
    event.openBox();


    Darn! When will I ever learn to open the box first!
  • erx23 2012-09-19 21:11
    quibus:

    I think you're a dumbass. No, I don't know any of those things, but that's so beyond the point, and I'm not going to waste my time explaining that to you.

    That point being that you are retarded?
  • Dirk 2012-09-20 00:18
    I can so ausgeführt werden!!
  • Moonraquel 2012-09-20 01:46
    jugis:

    Seriously, if after about 17 years of Internet a developer - regardless of when they started calling themselves one - hasn't touched HTML (and, with it, JavaScript; and then some), please step away from the fucking computer.


    Seriously, fuck you. There are plenty of people who develop pretty darn important software without ever having to touch anything web-related. What you said is just the polar opposite of "If after about 17 years of Internet a developer - yada yada - hasn't touched Cobol , please step away from the fucking computer." and just about as smart a thing to say.
  • F 2012-09-20 03:56
    DavidN:
    Aaaaagh! That's... appalling, but it isn't even the worst thing about the Bank of Scotland's online system. A while ago, I had to reset my security information, a step which looked like a fairly innocuous "set up security question/answers" page - but I absolutely couldn't convince the form to submit...

    You had to select three security questions from pick lists (what is your mother's maiden name, what was the make and model of your first car, and so on), and then type in an entirely custom question and answer for the fourth one. It was the custom question field that seemed to be the problem - all the other fields appeared to be all right, and I only ever got an unhelpful "Please set: Your own choice of question" error message when I tried to submit the form. So I initially thought that some overengineered security check was marking my question as being too common, or not forming a sentence it could parse, or something of equal silliness.

    But then I tore into the Javascript of the page, and realized that their question field was subject to the same validation check as the rest of the fields - you can have no spaces or special characters in your question (such as, fairly importantly, a question mark), or it won't be accepted. Once I pared my question down to "whatisyourfavouritecolour", I could finally get through.

    I have to wonder if they didn't notice a sharp drop in the number of online accounts being created...


    Why would you expect the programmers to care?
  • F 2012-09-20 03:59
    Sebastian Buchannon:
    This reminds me of the time I had to catch some particularly tricking keystroke combinations originating from client terminals. Interesting story: There were perhaps a dozen keystroke combinations that needed handling, including a variety of modifier doubles and triple chords. Rather than implement the logic chain as a long series of if statements, I opted instead to compile the set of combinations into an internal memory structure with a dictionary lookup. Including sufficient documentation I believe I completed the task in no more than three hours. Still haven't heard of any problems to this day so I must have nailed it.


    Either that, or the first person to try to fix it threw it away and started afresh.
  • F 2012-09-20 04:01
    BlackKnight:
    El Pollo Diablo:
    Apparantly they have some German speaking customers, considering the existence of www-dot-bankofscotland-dot-de (Bad akismet *slap*. Enterily relevant stuff, here).


    Shouldn't that be www-Punkt-bankofscotland-Punkt-de


    Only if you're not worried about people asking "what's this Puntk?"
  • F 2012-09-20 04:04
    Ben Jammin:
    if (event.keyCode == 18 && event.keyCode == 8  [SNIP]

    Most people are missing the ingeniousness of this code. Instead of using event.altKey, the original programmer has realized that most people don't press alt and backspace together. Instead, users generally lead with the alt key and at a barely noticeable span of time later, follow with the backspace.

    From this realization, we expert readers can see, that when the alt key is pressed, the first condition will register true, and then the backspace key will be pressed in ample time for the second condition to be tested.


    ... in a different invocation of the event handler, where it will also fail to satisfy the test.
  • F 2012-09-20 04:08
    Maurits:
    ¯\(°_o)/¯ I DUNNO LOL:
    F:
    And most of the Javascript WTFs result from letting idiots write code. Just like every other language ...
    B...b...but he can't be an idiot! He knew how to make a square root function from bailing wire and a hockey ticket!


    It's baling wire; for tying things up into bales, not for getting water out of a boat.


    Ah. That might explain my problem ...
  • AJ 2012-09-20 04:20
    Though, many, if not most, web developers cannot seriously be considered developers.
  • Swedish tard 2012-09-20 05:28
    quibus:
    cg:
    jugis / quibus; what a fsckhead!

    When is the last time you coded in assembly language? How about even in straight C?

    When is the last time you coded source for a language rather than just used a language?

    Do you know the difference between a spinlock, a semaphore, and a mutex?

    Do you understand the electronics behind an address line change from a 0 to a 1?

    When is the last time you coded at ring 0?

    When is the last time you coded for an embedded processor like keyboard or wifi?

    Do you understand how the speed of light limits the length of transmission lines in very high speed processors?

    Do you understand the reason that silicon must be doped for standard bipolar and FET transistors to work?

    All of these things and uncountable more are performed regularly so that people like you don't have to know about them.

    I have coded in HTML, I have coded scripts that code HTML, but I don't presume that everyone has had the time in their long life to learn and use everything.

    You must be really young to be so foolish. That is the reason they don't allow people so young to high office.

    Sorry (everyone else) for the rant, but a man's got to know his limits.



    I think you're a dumbass. No, I don't know any of those things, but that's so beyond the point, and I'm not going to waste my time explaining that to you.

    In the context of comparing knowing how to change a tire on a car: every mechanic and automotive engineer knows the mechanics of driving, but you cannot expect every driver to know the mechanics of car engine. Yet you can expect most drivers to know mechanics of changing a tire. There will always be drivers who don't want to (women and male-pussies), and there will always be drivers who physically cannot, but not being curious to KNOW how a tire is changed is plain incompetence. I piss on your 30 years of Assembly and COBOL. You probably create crap on daily basis.


    There is a great deal of both men and women that have no fucking clue how to change tires. Even a fair amount of the ones that believe they do have no idea. I've worked in a tire shop, and I've seen enough fuckwits screw the basics of changing tires...

    As far as programming and HTML goes, I could easily learn to do web development when the need arises, since I have the basics of development nailed. Much like random joe blow mechanic can easily change tires on a car if need be even if he never did it before in his life.
    That does not mean I have any interrest in HTML and it's ilk at the present time. There are lots of other shit that I spend my time learning.
    Not very different to how I expect my sodding car to work without me needing to change engine parts, tires and what not all the time, I expect the web to work without me needing to know exactly how it works. If it breaks, I notify the people that can fix it. Its their fucking job. Just as it is my fucking job to make operators capable of charging for your cell phone usage.
    you have no idea about any of the protocols, systems or principles that guide telecom, but Im pretty damn sure that you still use cell phones all the fucking time.

    There, did I get enough curse words in the post for this framing forum?
  • David 2012-09-20 05:30
    Maurits:
    It's baling wire; for tying things up into bales, not for getting water out of a boat.


    Any idiot can tie things up in bales with baling wire. Only a true MacGyver can bail out a boat with it.

    So I say youre wrong.
  • H 2012-09-20 07:43
    Gary:
    Pebs:
    So, to fix it, Wladimir installed Firefox or Chrome for his father?

    Both Firefox and Chrome have "Netscape" in the navigator.appName variable. IFAIK, it's one of those things that's just there for backwards compatibility reasons to support legacy JavaScript code.


    Of course the code tests for equality not substring.


    Not a WTF.

    https://developer.mozilla.org/en-US/docs/DOM/window.navigator.appName:
    Note: Do not rely on this property to return the correct browser name. In Gecko-based browsers (like Firefox) and WebKit-based browsers (like Chrome and Safari) the returned string is "Netscape".

  • QJo 2012-09-20 08:04
    Anketam:
    In my case I have only been an official software developer for 4 years. I have done stuff in college with php (which lets not even go there), and post-college for random non work things which did involve the Internet I have used aspx and Grails. But none of my professional work has involved JavaScript (nor Java, hence why I accidently mistook the code snippet for Java and was confused). JavaScript, Java (and several of its frameworks), NoSQL, and Ruby are on my todo list of things to learn.

    This highlights the difference between two mindsets. The one mindset is curious about everything they encounter, and finds stuff out. The other waits to be given a training course.
  • QJo 2012-09-20 08:07
    cg:
    jugis / quibus; what a fsckhead!

    When is the last time you coded in assembly language? How about even in straight C?

    When is the last time you coded source for a language rather than just used a language?

    Do you know the difference between a spinlock, a semaphore, and a mutex?

    Do you understand the electronics behind an address line change from a 0 to a 1?

    When is the last time you coded at ring 0?

    When is the last time you coded for an embedded processor like keyboard or wifi?

    Do you understand how the speed of light limits the length of transmission lines in very high speed processors?

    Do you understand the reason that silicon must be doped for standard bipolar and FET transistors to work?

    All of these things and uncountable more are performed regularly so that people like you don't have to know about them.

    I have coded in HTML, I have coded scripts that code HTML, but I don't presume that everyone has had the time in their long life to learn and use everything.

    You must be really young to be so foolish. That is the reason they don't allow people so young to high office.

    Sorry (everyone else) for the rant, but a man's got to know his limits.

    What, don't you know these things? Aren't you the remotest bit curious? Admittedly a man needs to know his limits, but yours are embarrassingly low.
  • Steve The Cynic 2012-09-20 08:35
    Swedish tard:
    There is a great deal of both men and women that have no fucking clue how to change tires. Even a fair amount of the ones that believe they do have no idea. I've worked in a tire shop, and I've seen enough fuckwits screw the basics of changing tires...

    Personally, when I have a flat on the road somewhere, I change the *wheel* and let the tyre shop take care of changing the *tyre* because they have the tools and know-how to get the old tyre off the rim and the new one on.

    And no, changing a wheel by the side of the road isn't hard, but that doesn't mean I want to do it in the pouring rain, a howling gale, or (memorably, once) driving snow.
  • Steve The Cynic 2012-09-20 08:59
    cg:
    jugis / quibus; what a fsckhead!

    When is the last time you coded in assembly language? How about even in straight C?

    Assembly? some time back, sadly.
    C? Doing that in my current job.

    cg:
    When is the last time you coded source for a language rather than just used a language?


    Are you saying "The last time I built an interpreter or compiler"? That was back in the mid-90s. It was a noddy microlanguage designed to exercise a signalling stack and related environment.

    cg:
    Do you know the difference between a spinlock, a semaphore, and a mutex?


    A semaphore is a bucket with tokens in it. A consumer takes tokens from the bucket, and a producer puts them in. If there are no tokens in the bucket, the consumer waits. If there are consumers waiting on an empty bucket, one of them will be released for each token put into the bucket by a producer.

    A mutex is like a semaphore where the number of tokens in a non-empty bucket is limited to 1. This means only one consumer can have a token, and he is generally also a producer, in that when he is finished, he puts the token back in the bucket.

    A spinlock is like a mutex, but instead of sleeping while waiting to be released, the consumer busy-waits. It produces a quicker response, but also makes priority inversion harder to avoid.

    cg:
    Do you understand the electronics behind an address line change from a 0 to a 1?


    At the electronic level, it doesn't change from 0 to 1. It changes from low to high, or in some logic systems from high to low.

    cg:
    When is the last time you coded at ring 0?


    Current job, assuming you're talking about x86. Other architectures may number their rings differently, in particular by having 0 be the lowest-privileged ring, which I think shows I know more about this than you do.

    cg:
    When is the last time you coded for an embedded processor like keyboard or wifi?


    A long while ago, and the most embeddedy of them was a TI Sensor Signal Processor with just 576 bits of memory.

    cg:
    Do you understand how the speed of light limits the length of transmission lines in very high speed processors?


    Fuss, fuss, it's the rate of signal propagation rather than the speed of light as such. And that rate is usually substantially slower than the speed of light in a vacuum, and can be affected in electronic circuits by capacitive and inductive effects (which increase the time before the signal is "ready" at the new level).

    cg:
    Do you understand the reason that silicon must be doped for standard bipolar and FET transistors to work?


    I could blither all day about band gaps, Dirac holes, N- and P-doping, and the like. Most of it would be more or less subtly wrong, I'm sure, because it's been a long time since I learned about it, but it would be in the general neighbourhood of right. And the Redundancy Department of Redundancy wants their abbreviation back. The T in FET stands for transistor.
  • Abico 2012-09-20 09:37
    Ralph:
    document.onkeydown = disablekeyboardnavigation;

    No.

    I don't think so.

    I'm afraid you are very, very confused. It is my computer. Not yours. N-O-T Y-O-U-R C-O-M-P-U-T-E-R. Can you hear me yet?

    There's a reason humans invented language. Not everything can be expressed by pointing and grunting. And even if it could, language is so much more efficient for those who can be bothered to learn it. And despite what the "usability" crapspewers insist, most everyone can learn language.

    You can have my keyboard when you pry it from my cold dead fingers, fuckyouverymuch.

    This is why I do not give permission for random asshats to take control of my browser.

    You forgot to disable my shotgun while you were at it.

    Do the world a favor and die. Please just die already. Yes I really mean it.

    The amusing thing about this rant is it belies a lack of comprehension of what a computer program is at its most basic level.
  • Abico 2012-09-20 10:00
    QJo:
    Anketam:
    In my case I have only been an official software developer for 4 years. I have done stuff in college with php (which lets not even go there), and post-college for random non work things which did involve the Internet I have used aspx and Grails. But none of my professional work has involved JavaScript (nor Java, hence why I accidently mistook the code snippet for Java and was confused). JavaScript, Java (and several of its frameworks), NoSQL, and Ruby are on my todo list of things to learn.

    This highlights the difference between two mindsets. The one mindset is curious about everything they encounter, and finds stuff out. The other waits to be given a training course.

    I'd argue the two mindsets are "Thinks web pages are cool and wants to know how to make one" and "Could give a rat's ass about web pages". I like my programming close to the metal. I hate all things GUI. I've looked at just enough JavaScript to know what an abomination it is, but not enough to know off the top of my head that it makes no distinction between ' and " (actually, if pressed, I probably could have told you that).
  • wheel is invented 2012-09-20 10:16
    iWantToKeepAnon:


    Don't blame the language for the sins of the browser wars and piss poor browser/DOM integration. That's not the language's fault, it's Microsoft's fault. And Netscape's too.

    It'd be great if we could get browser vendors to agree on a DOM, event, and parameter passing standard; and to cut all the old spaghetti code and make some rational sense of it all. But that'd break the web and browsers would have to provide backwards compatibility modes and things would only get worse. Better to use a library that abstracts all that away and let's you focus on using JS in all its glory (well it does have *some*) to write your app.


    Or even use a development framework that quietly generates any JS you need and lets you develop in an IDE with content-assist, refactoring tools and a debugger.
  • urza9814 2012-09-20 10:29
    TRWTF is that only using e in the Netscape section is actually correct -- Netscape (& Gecko) browsers will pass the event as a parameter to the function; IE and Webkit browsers will use a global window.event variable.
  • incassum 2012-09-20 10:40
    Abico:
    I've looked at just enough JavaScript to know what an abomination it is, but not enough to know off the top of my head that it makes no distinction between ' and " (actually, if pressed, I probably could have told you that).

    Which of course means that you've barely looked at any Python, PHP, Perl, Bash, Lua, PHP... and many more languages, since they all allow strings in single quotes (with some differences to double quotes, in some cases, but still).

    Some day you'll get out of the low-level layer and discover a whole new world!
  • Abico 2012-09-20 11:00
    JJ:
    With the prevalence of the Web over the last 18+ years, if you are a programmer and haven't taken any kind of look into HTML then you are what I consider to be the worst kind of programmer: the uninquisitive kind.

    I'm not talking about javascript. I'm not talking about XML. I'm not talking about CSS. I'm talking about plain old HTML. And I don't care if your job involves writing microcode for some embedded chip that won't get within a mile of a Web browser; the fact that you're on this site mean you're exposed to HTML on a regular basis. I just don't get how anyone could not care.

    (I do, however, get that there are people who don't care. And I form an opinion of them based on that.)

    And yet, your browser use is a small subset of your graphics card microcode use and operating system use. If you're not looking into those, there must be something wrong with you as well.

    Browsers are toys built on top of real programming. There's nothing wrong with an automotive engineer who isn't interested in how a wind-up toy car works.

    I don't think anyone has said they haven't looked at HTML, but you talk about learning HTML like it's some grand undertaking. The Day I Learned HTML (I would make that <flash> if BBCode had the tag for it. Tell a programmer it's a markup language, give them a 3x5 card with the tags, done. That's why people don't care; they know there's very little to it and could learn it in half a day if they had to. HTML5, yeah, a little more complex, but that's not what you said.

    And for the record, I was writing dynamic HTML pages before there were specific technologies for it, using Visual Basic 3 and an Access database. You were probably still in diapers while I was inventing ways to do things that there wasn't an easy way to do yet.
  • Abico 2012-09-20 11:02
    incassum:
    Abico:
    I've looked at just enough JavaScript to know what an abomination it is, but not enough to know off the top of my head that it makes no distinction between ' and " (actually, if pressed, I probably could have told you that).

    Which of course means that you've barely looked at any Python, PHP, Perl, Bash, Lua, PHP... and many more languages, since they all allow strings in single quotes (with some differences to double quotes, in some cases, but still).

    Some day you'll get out of the low-level layer and discover a whole new world!

    Python is my favorite language. I hate the others (haven't looked much at Lua, though I've heard good things).

    How do you come to the conclusion that not knowing intuitively one detail of JavaScript means I don't know Python?
  • Hmmmm 2012-09-20 11:03
    Abico:
    I've looked at just enough JavaScript written by people who have very little understanding of the language, or indeed, programming in general, to totally misinfer what an abomination it is


    FTFY

    I, on the other hand, have looked at enough Javascript written by decent programmers with a good understanding of the underlying principles of the language to know that the vast majority of the perceived issues with the language are actually caused by the environments the language runs in (i.e. the browsers) rather than the language itself. There were a few dodgy design decisions made in the early versions that it is now mostly stuck with but no more (and no more serious) than in most other languages.
  • Abico 2012-09-20 11:13
    Hmmmm:
    Abico:
    I've looked at just enough JavaScript written by people who have very little understanding of the language, or indeed, programming in general, to totally misinfer what an abomination it is


    FTFY

    I, on the other hand, have looked at enough Javascript written by decent programmers with a good understanding of the underlying principles of the language to know that the vast majority of the perceived issues with the language are actually caused by the environments the language runs in (i.e. the browsers) rather than the language itself. There were a few dodgy design decisions made in the early versions that it is now mostly stuck with but no more (and no more serious) than in most other languages.

    Maybe so.

    It probably doesn't help my prejudice that my current assignment is replacing a particular JS script with a standalone program because running the script in the client program is way too slow and requires multiple instances of the client. That's the client's fault. But it demonstrates why I have little use for something like JS.
  • Yazeran 2012-09-20 11:34
    cg:
    jugis / quibus; what a fsckhead!

    When is the last time you coded in assembly language? How about even in straight C?

    When is the last time you coded source for a language rather than just used a language?

    Do you know the difference between a spinlock, a semaphore, and a mutex?

    Do you understand the electronics behind an address line change from a 0 to a 1?

    When is the last time you coded at ring 0?

    When is the last time you coded for an embedded processor like keyboard or wifi?

    Do you understand how the speed of light limits the length of transmission lines in very high speed processors?

    Do you understand the reason that silicon must be doped for standard bipolar and FET transistors to work?

    All of these things and uncountable more are performed regularly so that people like you don't have to know about them.

    I have coded in HTML, I have coded scripts that code HTML, but I don't presume that everyone has had the time in their long life to learn and use everything.

    You must be really young to be so foolish. That is the reason they don't allow people so young to high office.

    Sorry (everyone else) for the rant, but a man's got to know his limits.



    Is it bad that I can actually answer yes to about half of those.... ;-)

    Yours Yazeran

    Plan: To go to Mars one day with a hammer.
  • mozzis 2012-09-20 13:34
    I thought 8 was backspace, and 9 was TAB.
  • jay 2012-09-20 14:21
    JJ:
    With the prevalence of the Web over the last 18+ years, if you are a programmer and haven't taken any kind of look into HTML then you are what I consider to be the worst kind of programmer: the uninquisitive kind.

    I'm not talking about javascript. I'm not talking about XML. I'm not talking about CSS. I'm talking about plain old HTML. And I don't care if your job involves writing microcode for some embedded chip that won't get within a mile of a Web browser; the fact that you're on this site mean you're exposed to HTML on a regular basis. I just don't get how anyone could not care.

    (I do, however, get that there are people who don't care. And I form an opinion of them based on that.)


    With the prevalence of anti-lock brakes over the last 30+ years, if you are a mechanical engineer and haven't taken any kind of look into anti-lock brakes then you are what I consider to be the worst kind of engineer: the uninquisitive kind.

    I'm not talking about traction control systems. I'm not talking about gyroscopic sensors. I'm talking about plain old anti-lock brakes. And I don't care if your job involves designing speedboat enginges that won't get within a mile of an anti-lock brake; the fact that you drive a car mean you're exposed to anti-lock brakes on a regular basis. I just don't get how anyone could not care.

    Exercises for the reader:

    1. Do you think that there might be mechanical engineers in the world who have never studied the design of anti-lock brakes, even though they themselves almost surely drive cars that have anti-lock brakes on them?

    2. Do you think that there might be programmers in the world who have never studied the design of websites, even though they themselves use the Internet?

    3. Is everyone in the world who does not have the same interests and work in the same specialty that you do necessarily and obviously a moron? Or is it possible that there are other explanations for this bizarre behavior?

    4. Can you think of any reason why any sane human being would have tastes and preferences different from yours? Is it because they're not smart enough to do what you do, or just because they are ignorant of how much better your tastes are?
  • no laughing matter 2012-09-20 16:13
    daef:
    bigger article 'bout the same bank (GERMAN)
    http://www.infogurke.de/2010/07/erfahrungen-mit-bank-of-scotland/

    The author also took a deeper look at the Javascript of the site:


    /*—————————————————————————–
    This source is part of the FLEXCUBE@ Java App Server Software System and is
    copyrighted by i-flex Solutions Limited.

    [...]

    i-flex Solutions Limited.
    10-11, SDF I, SEEPZ, Andheri (East),
    Mumbai – 400 096.
    India

    Copyright 2004 i-flex Solutions Limited.

    Modification History

    Date Version Author Description
    __________ ___________ _______________ ________________________________________
    10/11/2006 1 Rupesh N Initial Version
    09/03/2009 2 SaurabhV Added the code to disable text selection in mozilla
    10/03/2009 3 Priti D Disabled Shift+F6 key(address bar visible)
    ——————————————————————————*/


    Let the Nageshes commence!
  • amet 2012-09-20 17:07
    Abico:
    Hmmmm:
    Abico:
    I've looked at just enough JavaScript written by people who have very little understanding of the language, or indeed, programming in general, to totally misinfer what an abomination it is


    FTFY

    I, on the other hand, have looked at enough Javascript written by decent programmers with a good understanding of the underlying principles of the language to know that the vast majority of the perceived issues with the language are actually caused by the environments the language runs in (i.e. the browsers) rather than the language itself. There were a few dodgy design decisions made in the early versions that it is now mostly stuck with but no more (and no more serious) than in most other languages.

    Maybe so.

    It probably doesn't help my prejudice that my current assignment is replacing a particular JS script with a standalone program because running the script in the client program is way too slow and requires multiple instances of the client. That's the client's fault. But it demonstrates why I have little use for something like JS.


    JavaScript is relatively good as it is. It's the environment (browser, or your custom client) that sucks in interpreting and executing it. Perfect proof: Safari and Chrome execute SAME script noticeably faster than IE. Firefox is in between.
  • abbas 2012-09-20 17:08
    Yazeran:
    cg:
    jugis / quibus; what a fsckhead!

    When is the last time you coded in assembly language? How about even in straight C?

    When is the last time you coded source for a language rather than just used a language?

    Do you know the difference between a spinlock, a semaphore, and a mutex?

    Do you understand the electronics behind an address line change from a 0 to a 1?

    When is the last time you coded at ring 0?

    When is the last time you coded for an embedded processor like keyboard or wifi?

    Do you understand how the speed of light limits the length of transmission lines in very high speed processors?

    Do you understand the reason that silicon must be doped for standard bipolar and FET transistors to work?

    All of these things and uncountable more are performed regularly so that people like you don't have to know about them.

    I have coded in HTML, I have coded scripts that code HTML, but I don't presume that everyone has had the time in their long life to learn and use everything.

    You must be really young to be so foolish. That is the reason they don't allow people so young to high office.

    Sorry (everyone else) for the rant, but a man's got to know his limits.



    Is it bad that I can actually answer yes to about half of those.... ;-)

    Yours Yazeran

    Plan: To go to Mars one day with a hammer.



    Oooo - doctor Yazeran, of course
  • tation 2012-09-20 17:10
    jay:
    JJ:
    With the prevalence of the Web over the last 18+ years, if you are a programmer and haven't taken any kind of look into HTML then you are what I consider to be the worst kind of programmer: the uninquisitive kind.

    I'm not talking about javascript. I'm not talking about XML. I'm not talking about CSS. I'm talking about plain old HTML. And I don't care if your job involves writing microcode for some embedded chip that won't get within a mile of a Web browser; the fact that you're on this site mean you're exposed to HTML on a regular basis. I just don't get how anyone could not care.

    (I do, however, get that there are people who don't care. And I form an opinion of them based on that.)


    With the prevalence of anti-lock brakes over the last 30+ years, if you are a mechanical engineer and haven't taken any kind of look into anti-lock brakes then you are what I consider to be the worst kind of engineer: the uninquisitive kind.

    I'm not talking about traction control systems. I'm not talking about gyroscopic sensors. I'm talking about plain old anti-lock brakes. And I don't care if your job involves designing speedboat enginges that won't get within a mile of an anti-lock brake; the fact that you drive a car mean you're exposed to anti-lock brakes on a regular basis. I just don't get how anyone could not care.

    Exercises for the reader:

    1. Do you think that there might be mechanical engineers in the world who have never studied the design of anti-lock brakes, even though they themselves almost surely drive cars that have anti-lock brakes on them?

    2. Do you think that there might be programmers in the world who have never studied the design of websites, even though they themselves use the Internet?

    3. Is everyone in the world who does not have the same interests and work in the same specialty that you do necessarily and obviously a moron? Or is it possible that there are other explanations for this bizarre behavior?

    4. Can you think of any reason why any sane human being would have tastes and preferences different from yours? Is it because they're not smart enough to do what you do, or just because they are ignorant of how much better your tastes are?



    Dude, we're discussing tools here, not product of tools. We're discussing laziness of a general programmer to notice a tool (language, markup) that they see a product of every single day - every single day.
  • Abico 2012-09-20 17:39
    tation:
    jay:
    JJ:
    With the prevalence of the Web over the last 18+ years, if you are a programmer and haven't taken any kind of look into HTML then you are what I consider to be the worst kind of programmer: the uninquisitive kind.

    I'm not talking about javascript. I'm not talking about XML. I'm not talking about CSS. I'm talking about plain old HTML. And I don't care if your job involves writing microcode for some embedded chip that won't get within a mile of a Web browser; the fact that you're on this site mean you're exposed to HTML on a regular basis. I just don't get how anyone could not care.

    (I do, however, get that there are people who don't care. And I form an opinion of them based on that.)


    With the prevalence of anti-lock brakes over the last 30+ years, if you are a mechanical engineer and haven't taken any kind of look into anti-lock brakes then you are what I consider to be the worst kind of engineer: the uninquisitive kind.

    I'm not talking about traction control systems. I'm not talking about gyroscopic sensors. I'm talking about plain old anti-lock brakes. And I don't care if your job involves designing speedboat enginges that won't get within a mile of an anti-lock brake; the fact that you drive a car mean you're exposed to anti-lock brakes on a regular basis. I just don't get how anyone could not care.

    Exercises for the reader:

    1. Do you think that there might be mechanical engineers in the world who have never studied the design of anti-lock brakes, even though they themselves almost surely drive cars that have anti-lock brakes on them?

    2. Do you think that there might be programmers in the world who have never studied the design of websites, even though they themselves use the Internet?

    3. Is everyone in the world who does not have the same interests and work in the same specialty that you do necessarily and obviously a moron? Or is it possible that there are other explanations for this bizarre behavior?

    4. Can you think of any reason why any sane human being would have tastes and preferences different from yours? Is it because they're not smart enough to do what you do, or just because they are ignorant of how much better your tastes are?



    Dude, we're discussing tools here, not product of tools. We're discussing laziness of a general programmer to notice a tool (language, markup) that they see a product of every single day - every single day.

    And again I argue: by your logic, any developer who has never looked at OS code or their processor's instruction set is lazy.
  • erat 2012-09-20 17:59
    Abico:
    tation:
    jay:
    JJ:
    With the prevalence of the Web over the last 18+ years, if you are a programmer and haven't taken any kind of look into HTML then you are what I consider to be the worst kind of programmer: the uninquisitive kind.

    I'm not talking about javascript. I'm not talking about XML. I'm not talking about CSS. I'm talking about plain old HTML. And I don't care if your job involves writing microcode for some embedded chip that won't get within a mile of a Web browser; the fact that you're on this site mean you're exposed to HTML on a regular basis. I just don't get how anyone could not care.

    (I do, however, get that there are people who don't care. And I form an opinion of them based on that.)


    With the prevalence of anti-lock brakes over the last 30+ years, if you are a mechanical engineer and haven't taken any kind of look into anti-lock brakes then you are what I consider to be the worst kind of engineer: the uninquisitive kind.

    I'm not talking about traction control systems. I'm not talking about gyroscopic sensors. I'm talking about plain old anti-lock brakes. And I don't care if your job involves designing speedboat enginges that won't get within a mile of an anti-lock brake; the fact that you drive a car mean you're exposed to anti-lock brakes on a regular basis. I just don't get how anyone could not care.

    Exercises for the reader:

    1. Do you think that there might be mechanical engineers in the world who have never studied the design of anti-lock brakes, even though they themselves almost surely drive cars that have anti-lock brakes on them?

    2. Do you think that there might be programmers in the world who have never studied the design of websites, even though they themselves use the Internet?

    3. Is everyone in the world who does not have the same interests and work in the same specialty that you do necessarily and obviously a moron? Or is it possible that there are other explanations for this bizarre behavior?

    4. Can you think of any reason why any sane human being would have tastes and preferences different from yours? Is it because they're not smart enough to do what you do, or just because they are ignorant of how much better your tastes are?



    Dude, we're discussing tools here, not product of tools. We're discussing laziness of a general programmer to notice a tool (language, markup) that they see a product of every single day - every single day.

    And again I argue: by your logic, any developer who has never looked at OS code or their processor's instruction set is lazy.


    Yes - every developer is lazy.
  • Maurits 2012-09-20 20:01
    erat:
    Yes - every developer is lazy.


    At least, laziness is one of the three great virtus of a programmer.

    Larry Wall:
    We will encourage you to develop the three great virtues of a programmer: laziness, impatience, and hubris.
  • Jeremy 2012-09-21 01:42
    Looks like you are advertising a phishing scam.

    This is NOT the Bank of Scotlands website: banking dot bankofscotland dot de
  • Kwetal 2012-09-21 04:38
    The variable
    event
    is even undefined! The parameter's name in the function header is
    e
    , not
    event
    .
  • Giat 2012-09-21 08:39
    So, can someone explain why https: banking.bankofscotland<.>de embeds a doubleclick.net iframe and www.bankofscotland<.>de an iframe of marketing company quisma plus javascript tracking code from webtrekk.net ?

    Maybe they want to make sure their customer funds get robbed if the server at any of those companies is compromised?

    I can understand that they contract a third party for their analytics, but rinning their javascript? Sending their data to their servers?

    If bankofscotland01.webtrekk.net was a local install of BOS in their domain, it would still be a WTF, but but it resolves to the same server as www.webtrekk.com, so it's the third party server.
    Maybe they also track the money you have in your account? You know, just for analytics.
  • Abico 2012-09-21 08:44
    erat:
    Yes - every developer is lazy.

    Well....okay, fair enough.
  • David 2012-09-21 14:53
    jay:
    With the prevalence of anti-lock brakes over the last 30+ years, if you are a mechanical engineer and haven't taken any kind of look into anti-lock brakes then you are what I consider to be the worst kind of engineer: the uninquisitive kind.


    Seems reasonable enough. I would think that any remotely competent mechanical engineer even tangentially connected to the motor industry would have some idea of how an ABS works.

    jay:
    1. Do you think that there might be mechanical engineers in the world who have never studied the design of anti-lock brakes, even though they themselves almost surely drive cars that have anti-lock brakes on them?


    Thats a shit analogy.

    "Do I think that there might be mechanical engineers *in the motor industry* who have never studied the use of *modern car manufacturing techniques*?" would be a much better analogy.

    (And the answer would be "yes - just look at Renaults". But I digress.)

    jay:
    3. Is everyone in the world who does not have the same interests and work in the same specialty that you do necessarily and obviously a moron? Or is it possible that there are other explanations for this bizarre behavior?


    What, you mean like not having the basic ability to spot fallacious reasoning, faulty assumptions and loaded questions?

    Yes, I think those people are all morons.
  • Shark8 2012-09-22 11:55
    amet:

    JavaScript is relatively good as it is. It's the environment (browser, or your custom client) that sucks in interpreting and executing it. Perfect proof: Safari and Chrome execute SAME script noticeably faster than IE. Firefox is in between.

    Actually, it seems that IE is a little bit better at JS than FF/Safari (I'm, not sure about Chrome) because it picks up [real] errors that the aforementioned do not. {This assumes that you're one of the "errors should be reported" mind, rather than [as exemplified by PHP] "I don't care about errors, JUST GO!" mind.}

    I wish I could remember the exact details of the case I found this out, but as I recall it had to do with some syntax ambiguity.
  • JC 2012-09-22 21:36
    Wladimir Palant saved my life. And the Internet.
  • Marvin the Martian 2012-09-23 10:21
    I don't expect worse from RBS. They have vertically integrated the WTF in their operation.

    For example, as a student in Scotland I opened an account with them, left the UK, and am once again residing here but in the South this time, and I'm still proud owner of a student account. RBS which is smaller than NatWest has anyway in the meantime bought that bank, and their infrastructure (backoffice, website up to fonts but not colours, Xiring encryption for homebanking, ..) is exactly the same. However, RBS will not merge the two banks --- instead RBS has last year sold its English and Welsh shops to the Santander bank.

    Effect? My nearest local bank is about 8h by train Northward, and my savings account is inexplicably at Santander. Once in a blue moon I can reach my savings from the RBS online login, but normally it points me to Santander to set up an account.
  • Notchulance 2012-09-26 18:09
    Hmmmm:
    Abico:
    I've looked at just enough JavaScript written by people who have very little understanding of the language, or indeed, programming in general, to totally misinfer what an abomination it is


    FTFY

    I, on the other hand, have looked at enough Javascript written by decent programmers with a good understanding of the underlying principles of the language to know that the vast majority of the perceived issues with the language are actually caused by the environments the language runs in (i.e. the browsers) rather than the language itself. There were a few dodgy design decisions made in the early versions that it is now mostly stuck with but no more (and no more serious) than in most other languages.


    Yeah the multiple versions of browsers and specs, building on a stateless protocol, the security problems, the really lame early Javascript all made web programming seem undesirable, a mess. We all wanted to stay the hell away.
    Javascript performance and support in browsers has come a long way baby. It feels awfully "sporty" for server-side use, when you could go with strongly-typed Java or something, but it's neat to use the same language on server and client side for once.
    There are some nice libs too, like the node.js stuff or jQuery. Good mobile support. Joe Bob says check it out.
  • Buddy 2012-09-27 03:24
    Ryan E:
    I really like the function above that one in the js file:


    function returnFalse () {return false;}


    Why just use false, when you can returnFalse()?


    Don't ask "why" questions, they only cause more trouble.
  • Richard 2012-10-15 12:30
    This actually looks a lot like generated code, instead of human written code.
  • Freyaday 2013-11-05 19:33
    The same ABP that takes money from Google to allow their ads through.