Slow Down, You Click Too Fast

« Return to Article
  • ParkinT 2013-01-03 06:46
    // Please don't submit this to the daily WTF
    


    I think I may add this comment to ALL my code from this day forward!!
  • Evo 2013-01-03 08:08
    Obviously, that's anti-ddos protection. You know, if suddenly loads of anonymous members go to the site and open loads of tabs to flood the server with requests!
  • TheCPUWizard 2013-01-03 08:12
    It looks like the code is intended to handle situations where the person has ALREADY ctrl-clicked to open a new tab, is still on the old tab (ie the new tab has not opened and gotten focus)....

    Especially if the site in question is slow to load, this *may* actually be useful (the intent, not necessirly the implementation.
  • Remy Porter 2013-01-03 08:14
    The feature is useful. This is a CodeSOD- it's the implementation that's the WTF.
  • matejcik 2013-01-03 08:16
    This seems to defend against chronic double-clickers. You know, the people who double-click everything because they don't know any better.
    - "i just clicked this link why did it open two tabs?"
    - "Did you double-click?"
    - "what's that?"
  • Ralph 2013-01-03 08:18
    This is the rotten fruit of the "computers are too hard to use!" crowd.

    You remember, they said "Oh the horror! You might have to use a keyboard. Typewriters are only for lowlifes like secretaries." So executives wouldn't touch a computer because it would be beneath them.

    Then Microsoft copied Apple who copied Xerox who after all was a copying company with the bright idea of eliminating the keyboard. "Look! Only one button to push! Ever! What could possibly be easier? You just point at what you want and shoot."

    Well everybody knew this was a lie but we're talking marketing folks here so they got away with it.

    Soon we were blessed with double-click and right-click and click-hold (drag) and triple-click and control-click and... you can probably spot a trend here.

    Anyway this code is for those luzers who think you have to double-click web links because... well, um, I never really thought about it, just because.
  • Hantas 2013-01-03 08:24
    Soon we were blessed with double-click and right-click and click-hold (drag) and triple-click and control-click and... you can probably spot a trend here.


    What about scrollwheel-click?
  • Remy Porter 2013-01-03 08:31
    In my day, that was "middle mouse click". You kids and your fancy scroll-wheels.
  • ZoomST 2013-01-03 08:38
    Remy Porter:
    In my day, that was "middle mouse click". You kids and your fancy scroll-wheels.


    In fact, using the middle mouse button in FireFox over a link, opens it in a new tab. Is it covered by this code? Seems not, AFAIK.
  • OldestYoungster 2013-01-03 08:39
    Remy Porter:
    In my day, that was "middle mouse click". You kids and your fancy scroll-wheels.


    Pah! You kids and your fancy three-button mice.
  • jbabs 2013-01-03 08:40
    If you ever find yourself writing a comment in your code that says "Please don't submit this to the daily WTF", it means two things:

    1) you're doing it wrong.
    2) it's going to end up on dailyWTF.
  • TheDreamer 2013-01-03 08:43
    Wonder if that was taken from an IT security training I took recently? People were complaining that it was failing to show them as completed and giving them their certificate of completion. The answer was they were clicking the final link too quickly, and it hadn't generated the certificate yet. So instead it error'd and no certificate and no completion record entered into employee file.

    And, there was no way to tell if they had reached the end successfully and this had happened, and there were a lot of angry people.... the decision was to see all the people that had started the test, spent at least 5 minutes in the test before failing to complete. And, calling all those people and asking if they had successfully completed or not and granting credit to those that said they did.

    Too bad I waited until they worked out the bugs before taking it....
  • Bring Back Nagesh 2013-01-03 08:44
    So I'm assuming this abstraction for System.Windows.Forms.WebBrowser is written in VB or C# and is meant to work for built-in IE frames inside a parent application?

    If so, TRWTF is forcing someone to use an embedded web browser to do something rather than opening the link in the user's default web browser. A bit like Steam, which as we know, is also a WTF.

    And even if you absolutely MUST force people to use a browser panel inside your app, why does it need to have multiple tabs?
  • daef 2013-01-03 08:45
    Hantas:
    What about scrollwheel-click?

    i tend to use either
    * ONLY my (das)keyboard or
    * ONLY my mouse (a cheap chinese "X7")

    depending on what i'm doing and how comfortable i'm sitting
    (imagine hangin' around in your living room, wanting to advance
    to the next room on chaturbate... nifoc)

    scrollwheel-click is very handy sometimes - ppl who change the middle-button to anything different are retarded as far as i'm concerned...

    ...the most retarded ppl are the ones writing mouse-drivers which remap the middle mouse-button per default (e.g. "proprietary zoom s#!7")

    on the other hand i use approx. -2147483648 different keyboard shortcuts to navigate and edit sourcecode in visual studio - so i might not be the "average use case"...

    captcha: wisi

    tl;dr
    did you know you can use the middle mouse-button to:
    * close tabs in any sane browser (without having to aim for the 'X')
    * open tabs (same thing about browser sanity, don't bother to aim for the '+')
    * the default NESW-scrolling doesn't "lock in" when you keep it pressed instead of middle-clicking 2 times
    * linux -> paste from "second"/"temporary" clipboard (last selection)
    * if you have none: enable 3-button-emulation and middle-click by left+right-clicking simutaneously
    * open a link in a new (backgrounded)-tab
  • Hantas 2013-01-03 08:56
    I use mousewheel-click all the time for browsers, but it's not even just browsers. It also closes tabs in things like notepad++ and some (most?) IDEs.
  • el_slapper 2013-01-03 08:58
    It's me, or beginning by disabling the clicked button just after being clicked would do the trick?
  • justanotheradmin 2013-01-03 09:03
    daef:

    * close tabs in any sane browser (without having to aim for the 'X')


    It's this feature that forced me to download the AHK plugin to middle-click delete mails in Outlook.
  • daef 2013-01-03 09:07
    justanotheradmin:

    It's this feature that forced me to download the AHK plugin to middle-click delete mails in Outlook.

    one does not simply download AHK "plugin"s...
    ...one writes his own AHK-scripts!

    one of the features i've stolen from the AHK-KDE-Mover-Sizer is double-tap "alt" and then middle-click a window to close the creating process (similar to xkill)

    speaking about xkill - does anyone know a "psdoom"-port to windows? :-)

    if you don't know psdoom - check that awesome peace of code out today!
  • A developer 2013-01-03 09:09
    Yeah me too.
    I'm going to put it at the top of every class and method I write.
  • QJo 2013-01-03 09:10
    jbabs:
    If you ever find yourself writing a comment in your code that says "Please don't submit this to the daily WTF", it means two things:

    1) you're doing it wrong.
    2) it's going to end up on dailyWTF.


    "Please don't throw me into that brier-bush over there, Brer Fox!"
  • DLove 2013-01-03 09:25
    The comment should be at the top of the function, the whole thing as a concept is totally flawed.
  • fjf 2013-01-03 10:03
    Ralph:
    Soon we were blessed with double-click and right-click and click-hold (drag) and triple-click and control-click and... you can probably spot a trend here.
    Press control, meta, hyper, super, shift, top, and front, then scroll the wheel while dragging with the right button and shouting into your mic.
  • Ben Jammin 2013-01-03 10:05
    You know this was given to the programmer by some bad-with-computers, double-clicking boss, and despite multiple protests, was forced to be a feature.

    With his head hung low, and outlook on life crushed, the coder hacked this out with a plea to the world to not hold it against him.
  • anon 2013-01-03 10:23
    jbabs:
    If you ever find yourself writing a comment in your code that says "Please don't submit this to the daily WTF", it means two things:

    1) you're doing it wrong.
    2) it's going to end up on dailyWTF.


    But it means you *know* what you're doing is a bad hack and you know you shouldn't, but gets the job done when you need it done.
  • Your Name 2013-01-03 10:26
    matejcik:
    This seems to defend against chronic double-clickers. You know, the people who double-click everything because they don't know any better.
    - "i just clicked this link why did it open two tabs?"
    - "Did you double-click?"
    - "what's that?"


    These are the same people that do not know that "click" means "left click".

    Click on this.
    > Ok.
    Now right click on that.
    > Ok.
    Now click on this other thing.
    > Left or right?

    They also double-click every single time.
  • Brad 2013-01-03 10:29
    I disagree; any code that is commented, "please don't submit this to the Daily WTF" should never be submitted. It means the writer *tried* to come up with a better solution (realizing what he or she is doing sucks), but couldn't.
    I think code submitted herein should be code that is downright negligent or that flagrantly violates logic, reason, etc.
  • Zapp Brannigan 2013-01-03 10:35
    Your Name:

    These are the same people that do not know that "click" means "left click".

    Click on this.
    > Ok.
    Now right click on that.
    > Ok.
    Now click on this other thing.
    > Left or right?

    They also double-click every single time.

    Leftists unite against right-handed fascist overlords!
  • vt_mruhlin 2013-01-03 10:39
    anon :
    jbabs:
    If you ever find yourself writing a comment in your code that says "Please don't submit this to the daily WTF", it means two things:

    1) you're doing it wrong.
    2) it's going to end up on dailyWTF.


    But it means you *know* what you're doing is a bad hack and you know you shouldn't, but gets the job done when you need it done.


    Yeah, that comment looks like it might as well say "PHB is making me do this, but I think it's a terrible idea". I would love to see the jira ticket--or more likely email thread--that spawned this feature.
  • Kaosadvokit 2013-01-03 11:15
    Bring Back Nagesh:
    So I'm assuming this abstraction for System.Windows.Forms.WebBrowser is written in VB or C# and is meant to work for built-in IE frames inside a parent application?

    If so, TRWTF is forcing someone to use an embedded web browser to do something rather than opening the link in the user's default web browser. A bit like Steam, which as we know, is also a WTF.

    And even if you absolutely MUST force people to use a browser panel inside your app, why does it need to have multiple tabs?


    why an integrated browser?

    Because your application has an integrated document viewer and you happen to use HTML-based documents--after all, that minimizes the effort to have the same documents available online.

    Because users (and IT staff) like to install different browser versions and you value a consistent user experience.

    Because you're writing software to run on a semi-embedded system where you want to lock the user into a single application (think kiosk software).

    Why support tabs?

    Because people are used to them. Back when IE6 had 90% market share, tabs were a niche feature that 90% of people didn't use. They use them now; support is expected. If you want angry users, provide a user experience that is inconsistent with their expectations.


    No, TRWTFs are developers who live in a small corner of the development world and don't understand that there are applications where this is a legitimate and proper design decision. TRWTFs are developers that rush to condem actions they don't understand because they don't understand them. Do you know of a better debounce mechanism? I don't; similar mechanisms have served me well across hundreds of projects, because it is simple, easy to implement/maintain, produces the correct result, and fails to produce an incorrect result. Sure, this one is rough around the edges, but it is pretty clear what it does and why.

    Maybe it was the smaller readership years ago, maybe it was the submission quality, I don't know... but TDWTF has really gone downhill over the last several years.
  • Gaza Rullz 2013-01-03 11:35
    "click! click! click! ...clickety ... click! click! click!"

    ... Oh no you don't !
  • Dotan Cohen 2013-01-03 11:35
    Hantas:
    I use mousewheel-click all the time for browsers, but it's not even just browsers. It also closes tabs in things like notepad++ and some (most?) IDEs.


    If you would like browseresque tab handling in Eclipse, comment on this feature request:
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=362176
  • Mr X 2013-01-03 11:39
    Kaosadvokit:

    Because users (and IT staff) like to install different browser versions and you value a consistent user experience.


    I'm with you on most of your reasons, but this one stinks. The whole reason people install different browser versions is because they *want* a different user experience. Who are you to tell the users they are wrong, and lock them into something they don't want?
  • urza9814 2013-01-03 11:44
    Mr X:
    Kaosadvokit:

    Because users (and IT staff) like to install different browser versions and you value a consistent user experience.


    I'm with you on most of your reasons, but this one stinks. The whole reason people install different browser versions is because they *want* a different user experience. Who are you to tell the users they are wrong, and lock them into something they don't want?


    Users also expect a consistent experience throughout the application, and most (outside of the *nix world especially) DON'T expect one application to spawn another for core functionality.

    What if, for (a somewhat poor) example, you're writing something like Outlook? Emails are going to be in HTML; you could write your own parser, but why reinvent the wheel? But you also don't want to launch a full browser every time the user clicks to view a message.
  • xorsyst 2013-01-03 11:48
    urza9814:

    What if, for (a somewhat poor) example, you're writing something like Outlook? Emails are going to be in HTML; you could write your own parser, but why reinvent the wheel? But you also don't want to launch a full browser every time the user clicks to view a message.


    To continue your example, what if there's a url in the message? If I click on it, should it spawn my browser, or render the webpage in my application?

    To use a different example (application help). Lots of applications have their help in html format in one form or another (including windows chm). Many of them launch the windows help viewer or a browser to view the help. Is that wrong?
  • d.k.ALlen 2013-01-03 11:48
    There was a programmer who had a problem with his code.
    He added in the comments, a plea not to post his code to TDWTF.

    Now he has two problems.
  • urza9814 2013-01-03 11:58
    xorsyst:
    urza9814:

    What if, for (a somewhat poor) example, you're writing something like Outlook? Emails are going to be in HTML; you could write your own parser, but why reinvent the wheel? But you also don't want to launch a full browser every time the user clicks to view a message.


    To continue your example, what if there's a url in the message? If I click on it, should it spawn my browser, or render the webpage in my application?

    To use a different example (application help). Lots of applications have their help in html format in one form or another (including windows chm). Many of them launch the windows help viewer or a browser to view the help. Is that wrong?


    Obviously there's no firm line there but my opinion, as I said, is that core functionality shouldn't require an external app. Help isn't core; you can use the browser or windows help to do that. Clicking a link from an email isn't either if your app is an email viewer and not a web browser. Sure, both are HTML documents in a sense, but most users don't know that and they're certainly different conceptually.

    If I'm forced to interact with two separate applications simultaneously to use your software, you're probably doing something wrong. There are certainly valid reasons to do that, but definitely not for something Grandma might be using...unless Grandma is a sysadmin.
  • Kaosadvokit 2013-01-03 12:10
    Is it wrong to use a help viewer application that is an OS standard for its intended prupose? No.

    Is it wrong to spawn a web browser to view a standalone document? No.

    Is it wrong to spawn a second application to interact with components of the first? Usually. When I open a mail message, I need to interact with it. Reply, forward, delete, etc. These are not operations for a web browser to handle, they are for my application. The browser that displays the message content should be embedded. When I click a link, I'm now transitioning to the standalone document interface; it should be a browser window and, at this point, user experience concerns say to use the user's preference because it is a standalone resource, it should conform to their expectations--your application supports the content, not the presentation now. Of course, if the link is a mailto: link, it shouldn'thand it off to the browser, it should create a new message (thats my opinion, feel free to disagree, but implementation details like this aren't the topic here).

    Another example: When you open that help viewer, does it in turn open your browser of choice? No, because it is responsible for presenting the content. The HTML pages are application content, not standalone documents.

    A key part to both of those examples is that the user doesn't necessarily know that emails or help files rely on HTML. Your application black-boxes the implemetnation, so it is your application that has the responsibility to present the content to the user.

    This is all part of the user experience; what tasks does the user expect to be performed by your application, and what parts shouldn't be. The implementation of the tasks your application performs is irrelevant, the expectation is that the application performs the tasks.
  • Jeff 2013-01-03 12:10
    Your Name:
    These are the same people that do not know that "click" means "left click".
    ...who are also the same people that say "H" "T" "T" "P" "colon" "backslash" "backslash"...
  • LoremIpsumDolorSitAmet 2013-01-03 12:17
    Kaosadvokit:
    Bring Back Nagesh:
    So I'm assuming this abstraction for System.Windows.Forms.WebBrowser is written in VB or C# and is meant to work for built-in IE frames inside a parent application?

    If so, TRWTF is forcing someone to use an embedded web browser to do something rather than opening the link in the user's default web browser. A bit like Steam, which as we know, is also a WTF.

    And even if you absolutely MUST force people to use a browser panel inside your app, why does it need to have multiple tabs?


    why an integrated browser?

    Because your application has an integrated document viewer and you happen to use HTML-based documents--after all, that minimizes the effort to have the same documents available online.

    Sure, that makes sense... Although having everything available online has other advantages, like being able to work remotely and without installing software.

    Because users (and IT staff) like to install different browser versions and you value a consistent user experience

    Indeed. And you can give them a consistent experience by making your website adhere to web standards. Let's not do what people used to do and lock people down to IE6 and ActiveX for the sake of consistency.

    Because you're writing software to run on a semi-embedded system where you want to lock the user into a single application (think kiosk software).

    Yuck... Kiosk browsers are a WTF in their own right.

    Why support tabs?

    Because people are used to them. Back when IE6 had 90% market share, tabs were a niche feature that 90% of people didn't use. They use them now; support is expected. If you want angry users, provide a user experience that is inconsistent with their expectations.

    I'm sure people would rather use their browsers instead - as it is the very thing that defines their expectations - rather than trying to reinvent it for them. That's far more likely to make them angry.

    No, TRWTFs are developers who live in a small corner of the development world and don't understand that there are applications where this is a legitimate and proper design decision...

    Sadly we don't know what the application is, so we can't tell whether it's justified, but given the code snippet, I would rather not find out.
  • Terry 2013-01-03 12:17
    urza9814:
    If I'm forced to interact with two separate applications simultaneously to use your software, you're probably doing something wrong
    unless, of course, someone can come up with a way to view and operate two separate applications simultaneously. They could be in separate views, side by side on your screen! These views could be rendered as boxes you look "through" to see the application behind them. Almost as if the boxes were... well... let's just call them windows.
  • NH 2013-01-03 12:20
    It looks like a remedy for those sites that opens a kiloton of windows when you try to close one. Some phishing sites did that a few years back.
  • Roger 2013-01-03 12:29
    NH:
    It looks like a remedy for those sites that opens a kiloton of windows when you try to close one. Some phishing sites did that a few years back.
    Hint: if you've got your computer configured such that you're allowing random asshats all over the internet to open windows on your computer without your permission, you deserve to get phished and worse. And sooner or later, you will.
  • Kaosadvokit 2013-01-03 12:49
    @LoremIpsumDolorSitAmet:

    Adhering to standards is all good and well, however the standards don't state which browser has the correct font-rendering engine. The standards don't mean you will have an ideal implementation with whatever your end-user has installed, and the standards don't get your application 508 certified if significant portions of the operating environemnt cannot be assessed.

    Being dismissive of 99% of development efforts doesn't make your 1% right, it makes your views of the 99% wrong. You don't seem to understand that an embedded web browser isn't about browsing the web, it is abotu displaying application-centric content that happens to be stored as HTML. Kiosks that are powered by browsers strike a nice balance between cost and benefit. Strangely, this appeals to the suits, even if it isn't the most elegant solution from a software standpoint. Complicator's Gloves, anyone? Would you like an arbitrary system to pass condiments? I'm sure somebody can provide links if you don't get the references.

    You're right that we should code to standards, and I won't defend IE6's blatant disregard for so many standards, but lets also thank Microsoft for bringing us the powerful AJAX engines we know and love in violation of the standards. At the same time, we owe the canvas to Apple ignoring standards as well. Standards are great, but while they provide a framework, saying developers must adhere to standards stifles innovation.

    It is pretty obvious you've never developed COTS or embedded software. Thats OK. Sit quietly and learn, don't shoot your mouth off preaching about things you don't know. You won't hear me getting high and mighty when we start talking about analytics and e-commerce, but when working with embedded, standalone/air-gapped, and/or COTS software... yeah, I have opinions, and a lot of experience on which those opinions are based.

    Lastly, jsut because we don't know if it is justified given the limited context, doesn't mean we should start condemning. I know a lot of novice develoeprs that, desperate to avoid looking stupid, take the content here as gospel; it is a disservice to the community to condemn whithout a necessary context.
  • da Doctah 2013-01-03 13:33
    ZoomST:
    In fact, using the middle mouse button in FireFox over a link, opens it in a new tab.
    Cool! You just saved me something like 24 hours over the remainder of my lifetime.
  • instigator 2013-01-03 13:37
    This.
    I don't see why this submission is a WTF. A few more points:

    - Without context, it's hard to say if the GUI call was right or wrong
    - The developer likely didn't make the GUI call
    - I welcome anyone to explain why the implementation is a WTF
  • instigator 2013-01-03 13:47
    LoremIpsumDolorSitAmet:
    Yuck... Kiosk browsers are a WTF in their own right.


    Are you saying we shouldn't have Kiosks? Or that Kiosk's should not have the ability to show documents? Even help documents?
    There are more things on Heaven and Earth than are dreamt of in your philosophy.
  • instigator 2013-01-03 13:50
    Neither is necessarily wrong, it depends on the situation, and possibly personal preference.
  • jay 2013-01-03 14:02
    Mr X:
    Kaosadvokit:

    Because users (and IT staff) like to install different browser versions and you value a consistent user experience.


    I'm with you on most of your reasons, but this one stinks. The whole reason people install different browser versions is because they *want* a different user experience. Who are you to tell the users they are wrong, and lock them into something they don't want?


    Who do you think you are, Microsoft or something?

    Something I've always loved about Microsoft: They design software that is far more complicated than is necessary to do the job. Then they build in all sorts of defaults and obscure preferences to control all the complex behavior. Including lots of cases where the software rejects your input or automatically changes your input to what the designer thought you must really have meant. These are, of course, turned on by default, so the program will ignore or change your input without explanation.

    One simple example: I created an Excel spreadsheet to keep track of some expenses. One of these expenses was my Health Savings Account. So I typed "HSA" into the cell. Excel promptly changed this to "HAS". When I noticed it I thought I'd just mistyped, so I tried again. It displayed as "HAS". I tried several times, carefully pressing the keys one at a time. I tried getting it in with cut-and-paste, backspacing and fixing it, etc. No luck. After a period of frustration, it finally hit me that Excel must have an "autocorrect" feature like Word -- I hadn't known about this before that time -- and they thought I was trying to type the word "has" but was too stupid to spell it right after 20 attempts. So I searched through the preferences screens to find where the option was and how to turn it off.

    If I hadn't wrestled with this same stupid feature in Word for many years, how would I have even known what to look for?

    It's one thing to reject inputs that can't be processed. Like "record not found" -- what else could the program do? But to say, "Your input is valid and we couild store or process it if we wanted to ... but we just don't believe that you know what you're doing so we're just going to change your input to what we think you probably meant." -- that's idiotic.

    </rant>

  • jay 2013-01-03 14:08
    Guarding against a second click when the program has not yet completed processing the first click, and so a second click will result in erroneous or undefined behavior, makes sense. Putting in an arbitrary time delay for a second click does not make sense. You have no assurance that the process will take EXACTLY that arbitrary amount of time. What if you give 1 second but the process takes 2 seconds, and the user clicks again after 1.5 seconds?

    I've had a few web pages where I've disabled the submit button once the user clicks it. If the next thing that happens should be a repaint or a new page, than that's all that's necessary. If after processing the user will still be on this page -- ajax calls or whatever -- then when the button is again valid I re-enable it.
  • Spewin Coffee 2013-01-03 14:16
    jbabs:
    If you ever find yourself writing a comment in your code that says "Please don't submit this to the daily WTF", it means two things:

    1) you're doing it wrong.
    2) it's going to end up on dailyWTF.


    3) ...
    4) Profit!

    It is all part of The Plan!
  • instigator 2013-01-03 14:19
    That's a fair point. But it does assume the proper hooks are in that library. Even still, it may be the lazy approach, but under a deadline, is this really a WTF, or just a kludge?

    To me, I call something a WTF when I can say, "what a dumbass"; not "what a lazy bastard".
  • DrPepper 2013-01-03 15:24
    Your Name:
    They also double-click every single time.

    I -- still -- double-tap the "end call" button on my phone, which reacts fast enough that the first tap ends the call; the 2nd tap calls that person AGAIN.
  • Henry 2013-01-03 15:34
    Looks like an attempt to "debounce" input
  • Barf 4Eva 2013-01-03 16:31
    I figure someone added that line precisely because they wanted to see it get displayed on TheDailyWTF. You know, the ol' "Don't touch the red button!"-but-now-I-cant-help-myself-because-you-said-not-to psychology.
  • Sam 2013-01-03 16:32
    I think after 5 minutes the print job will time out and then you can click again. So it is for those people who double click instead of waiting patiently.

    Please close this ticket.
  • Barf 4Eva 2013-01-03 16:32
    DrPepper:
    Your Name:
    They also double-click every single time.

    I -- still -- double-tap the "end call" button on my phone, which reacts fast enough that the first tap ends the call; the 2nd tap calls that person AGAIN.


    Hahaha, me too! I wonder just how common this dilemma is...
  • Dann of Thursday 2013-01-03 16:43
    DrPepper:
    Your Name:
    They also double-click every single time.

    I -- still -- double-tap the "end call" button on my phone, which reacts fast enough that the first tap ends the call; the 2nd tap calls that person AGAIN.


    What? I'm curious as to what phone configuration/OS initially trained you to do this, I've never heard of it before.
  • ¯\(°_o)/¯ I DUNNO LOL 2013-01-03 16:47
    I write the code for an embedded device with a small QVGA screen and a keypad. It has a simple user interface based on going through various levels of screens. I found out that I (as the programmer, who knows how it works, with it conveniently on my desk and not 5 feet up on a wall), I was screwing stuff up when I pressed the ENTER or ESC key once too many times, due to slow key bounce with the rubber keys. And this was even with flushing the keyboard buffer when changing screens.

    So I added a 200ms delay after changing screens (both forward and back) during which it would ignore either of those two keys. And it did the trick.

    But I actually documented in the comments what it's trying to do and why.
  • Apeiron 2013-01-03 16:49
    daef:

    * if you have none: enable 3-button-emulation and middle-click by left+right-clicking simutaneously


    trwtf is the Synaptics Windows drivers. They don't even have middle-click emulation, which means good luck middle-clicking anything on a laptop unless you figure out a way to get one of their gesture features to spit out middle-click (couldn't find it).

    It does let you remap left/right, but then you lose left/right. Best bet is to either:
    A) Remap the left button to middle and only tap-click with the pad
    B) Switch to Linux, where the Synaptics driver is sane.
  • Darth Paul 2013-01-03 17:28
    Ralph:
    Soon we were blessed with double-click and right-click and click-hold (drag) and triple-click and control-click and... you can probably spot a trend here.


    Anyone seen the table of finger gestures for Windows 8? It is a long list that replaces far fewer combinations of mouse clicks.

    distineo: When one has caught tinea and distemper.
  • Irritating Enlightener 2013-01-03 17:45
    There is an interesting, related bug in Firefox - at least on the Windows version, when some system skin more fancy than Windows Classic is in use.

    Open two or three tabs. Double-click on the rightmost one's close button. Aside from closing the tab as expected, the browser window will (un)maximize.
  • PleegWat 2013-01-03 17:57
    The bit next to the list of tabs counts as a title bar. If you double-click the title bar (both in windows and in linux) it maximizes/unmaximizes.
  • CodeSimian 2013-01-03 18:21
    Apeiron:

    trwtf is the Synaptics Windows drivers. They don't even have middle-click emulation, which means good luck middle-clicking anything on a laptop unless you figure out a way to get one of their gesture features to spit out middle-click (couldn't find it).


    There's a couple of registry keys you can set to enable middle-click emulation by either pressing both buttons or tapping with 2 fingers:
    http://iampaulh.blogspot.ca/2012/06/adding-middle-click-to-synaptics-touch.html

  • george 2013-01-03 19:31
    Kaosadvokit:
    Bring Back Nagesh:
    So I'm assuming this abstraction for System.Windows.Forms.WebBrowser is written in VB or C# and is meant to work for built-in IE frames inside a parent application?

    If so, TRWTF is forcing someone to use an embedded web browser to do something rather than opening the link in the user's default web browser. A bit like Steam, which as we know, is also a WTF.

    And even if you absolutely MUST force people to use a browser panel inside your app, why does it need to have multiple tabs?


    why an integrated browser?

    Because your application has an integrated document viewer and you happen to use HTML-based documents--after all, that minimizes the effort to have the same documents available online.

    Because users (and IT staff) like to install different browser versions and you value a consistent user experience.

    Because you're writing software to run on a semi-embedded system where you want to lock the user into a single application (think kiosk software).

    Why support tabs?

    Because people are used to them. Back when IE6 had 90% market share, tabs were a niche feature that 90% of people didn't use. They use them now; support is expected. If you want angry users, provide a user experience that is inconsistent with their expectations.


    No, TRWTFs are developers who live in a small corner of the development world and don't understand that there are applications where this is a legitimate and proper design decision. TRWTFs are developers that rush to condem actions they don't understand because they don't understand them. Do you know of a better debounce mechanism? I don't; similar mechanisms have served me well across hundreds of projects, because it is simple, easy to implement/maintain, produces the correct result, and fails to produce an incorrect result. Sure, this one is rough around the edges, but it is pretty clear what it does and why.

    Maybe it was the smaller readership years ago, maybe it was the submission quality, I don't know... but TDWTF has really gone downhill over the last several years.
    Last several years? That's how long I been here posting comm.....oh....
  • mick 2013-01-03 19:34
    urza9814:
    xorsyst:
    urza9814:

    What if, for (a somewhat poor) example, you're writing something like Outlook? Emails are going to be in HTML; you could write your own parser, but why reinvent the wheel? But you also don't want to launch a full browser every time the user clicks to view a message.


    To continue your example, what if there's a url in the message? If I click on it, should it spawn my browser, or render the webpage in my application?

    To use a different example (application help). Lots of applications have their help in html format in one form or another (including windows chm). Many of them launch the windows help viewer or a browser to view the help. Is that wrong?


    Obviously there's no firm line there but my opinion, as I said, is that core functionality shouldn't require an external app. Help isn't core; you can use the browser or windows help to do that. Clicking a link from an email isn't either if your app is an email viewer and not a web browser. Sure, both are HTML documents in a sense, but most users don't know that and they're certainly different conceptually.

    If I'm forced to interact with two separate applications simultaneously to use your software, you're probably doing something wrong. There are certainly valid reasons to do that, but definitely not for something Grandma might be using...unless Grandma is a sysadmin.
    webmail, anyone?
  • mick 2013-01-03 19:38
    Kaosadvokit:

    Is it wrong to spawn a second application to interact with components of the first? Usually. When I open a mail message, I need to interact with it. Reply, forward, delete, etc. These are not operations for a web browser to handle, they are for my application. The browser that displays the message content should be embedded. When I click a link, I'm now transitioning to the standalone document interface; it should be a browser window and, at this point, user experience concerns say to use the user's preference because it is a standalone resource, it should conform to their expectations--your application supports the content, not the presentation now. Of course, if the link is a mailto: link, it shouldn'thand it off to the browser, it should create a new message (thats my opinion, feel free to disagree, but implementation details like this aren't the topic here).
    It's an interesting thought, but ultimately their expectation is based (generally) on previous experience....but somewhere along the way someone did something differently.

    Think Apple too. They were successful by forcing people to change their expectations. Isn't it weird that most pizza bars provide an app to order from an iPhone - I been ordering by phone for ages (before I even had a GUI on my phone - or a cell phone, for that matter).
  • XXX 2013-01-03 19:40
    NH:
    It looks like a remedy for those sites that opens a kiloton of windows when you try to close one. Some phishing sites did that a few years back.
    Didn't realise they were phishing, but Farrk they promised some interesting videos....
  • Billy G 2013-01-03 19:54
    Apeiron:
    daef:

    * if you have none: enable 3-button-emulation and middle-click by left+right-clicking simutaneously


    trwtf is the Synaptics Windows drivers. They don't even have middle-click emulation, which means good luck middle-clicking anything on a laptop unless you figure out a way to get one of their gesture features to spit out middle-click (couldn't find it).

    It does let you remap left/right, but then you lose left/right. Best bet is to either:
    A) Remap the left button to middle and only tap-click with the pad
    B) Switch to Linux, where the Synaptics driver is sane.
    Just tap the pad in the middle to simulate a middle-click
  • jf 2013-01-03 21:46
    da Doctah:
    ZoomST:
    In fact, using the middle mouse button in FireFox over a link, opens it in a new tab.
    Cool! You just saved me something like 24 hours over the remainder of my lifetime.

    That will be $2000, or whatever your hourly rate plus compound interest over the corresponding years.
  • CodeSimian 2013-01-03 22:00
    CodeSimian:
    Apeiron:

    trwtf is the Synaptics Windows drivers. They don't even have middle-click emulation, which means good luck middle-clicking anything on a laptop unless you figure out a way to get one of their gesture features to spit out middle-click (couldn't find it).


    There's a couple of registry keys you can set to enable middle-click emulation by either pressing both buttons or tapping with 2 fingers:
    http://iampaulh.blogspot.ca/2012/06/adding-middle-click-to-synaptics-touch.html



    Sorry, I should've mentioned you can also assign middle-click to 3-finger tap using the registry method. Obviously most people will want to keep 2-finger tap assigned to right-click.
  • Scarlet Manuka 2013-01-03 23:00
    DrPepper:
    I -- still -- double-tap the "end call" button on my phone, which reacts fast enough that the first tap ends the call; the 2nd tap calls that person AGAIN.

    I have an almost opposite problem. After writing a message on my phone, I press "Send". But the phone takes just long enough to respond that I often think "oh, it didn't register the tap" and press it again -- just after it's changed into the Cancel button.
  • Chromatix 2013-01-03 23:00
    One of the railway signalling systems in Scandinavia indicates different speeds with different numbers of lights. A single green light means "clear, full speed". Two or three green lights together mean "clear" and successively *lower* speeds. This leads to an obvious wrong-side failure mode where one of the green lights blows, and the signal indicates a higher speed than it should.

    Worse, the immediately neighbouring country has a signalling system that is very similar, was derived from the same older system, yet has some indications which are completely opposite to the indications in the first country. Accordingly it is prohibited for the same driver to operate a train in both countries, even though they speak nearly the same language and the networks are interconnected. The risk of incorrectly interpreting the conflicting indications is too great.
  • Norman Diamond 2013-01-03 23:41
    ¯\(°_o)/¯ I DUNNO LOL:
    I write the code for an embedded device with a small QVGA screen and a keypad. It has a simple user interface based on going through various levels of screens. I found out that I (as the programmer, who knows how it works, with it conveniently on my desk and not 5 feet up on a wall), I was screwing stuff up when I pressed the ENTER or ESC key once too many times, due to slow key bounce with the rubber keys. And this was even with flushing the keyboard buffer when changing screens.

    So I added a 200ms delay after changing screens (both forward and back) during which it would ignore either of those two keys. And it did the trick.

    But I actually documented in the comments what it's trying to do and why.
    You mean you didn't document in the comments "Please don't post this to the Daily WTF"?
  • Dirk 2013-01-04 01:52
    Please don't submit this to the daily WTF
  • QJo 2013-01-04 03:48
    da Doctah:
    ZoomST:
    In fact, using the middle mouse button in FireFox over a link, opens it in a new tab.
    Cool! You just saved me something like 24 hours over the remainder of my lifetime.

    Does it in Google Chrome as well. Haven't tried in IE yet but would expect the same to apply.
  • LoremIpsumDolorSitAmet 2013-01-04 04:59
    instigator:
    LoremIpsumDolorSitAmet:
    Yuck... Kiosk browsers are a WTF in their own right.


    Are you saying we shouldn't have Kiosks? Or that Kiosk's should not have the ability to show documents? Even help documents?
    There are more things on Heaven and Earth than are dreamt of in your philosophy.

    Not saying that we don't need kiosks. I'm just saying that every implementation of a kiosk browser I've interacted with is a steaming pile of WTF.
  • LoremIpsumDolorSitAmet 2013-01-04 05:31
    Kaosadvokit:
    @LoremIpsumDolorSitAmet:

    Adhering to standards is all good and well, however the standards don't state which browser has the correct font-rendering engine. The standards don't mean you will have an ideal implementation with whatever your end-user has installed, and the standards don't get your application 508 certified if significant portions of the operating environemnt cannot be assessed.


    If there was One True font-rendering engine then web designers might be tempted to build extremely inflexible designs, so I thin this is just as well. Besides, if you're catering for multiple languages then you can't make assumptions about word length, line length, or even left-to-rightedness either. Responsive Design is the answer.

    Being dismissive of 99% of development efforts doesn't make your 1% right, it makes your views of the 99% wrong. You don't seem to understand that an embedded web browser isn't about browsing the web, it is abotu displaying application-centric content that happens to be stored as HTML. Kiosks that are powered by browsers strike a nice balance between cost and benefit. Strangely, this appeals to the suits, even if it isn't the most elegant solution from a software standpoint. Complicator's Gloves, anyone? Would you like an arbitrary system to pass condiments? I'm sure somebody can provide links if you don't get the references.


    I know an embedded browser doesn't necessarily mean web pages, but the article hints at CTRL-clicking links and opening new tabs, which sounds a lot like a browser to me. I wouldn't expect to see e.g. Outlook handling HTML emails in this manner. On the subject of kiosks, see my above comment. On the subject of The Complicator's Gloves, I put it to you that a program that's displaying HTML in embedded browser panes and supporting CTRL-clicking is the proposed wonderful new idea, and the traditional web browser is the 'gloves' in this case. And to bridge the gap, there are addons available for some browsers including Firefox that turn it into a kiosk app.

    It is pretty obvious you've never developed COTS or embedded software...


    Given that we don't know the context, it doesn't matter whether I do or don't know. I'm just voicing my opinion.
  • Kasper 2013-01-04 06:24
    Ralph:
    Anyway this code is for those luzers who think you have to double-click web links because... well, um, I never really thought about it, just because.
    A few years back I was testing a feature in a webapplication. I had filled in a form with some invalid data and proceeded with the registration flow to see how it would deal with it.

    As I reached the end of the flow, I stopped and though "hang on, what was I testing again?"

    Then I realized that I had gone all the way through the flow without getting the error message, I had to test.

    It took me a few attempts to reproduce it and figure out what had gone wrong. On one page I had accidentally double clicked on a link to the next page. Or rather clicked a second time because the webserver was responding so slowly, that I somehow thought I hadn't clicked in the first place.

    Those two clicks caused two requests to be sent to the webserver and get handled by two different threads. This triggered a race condition in another developer's code. The two threads would share a status variable, which they should not have been sharing.

    The end result was that the result of the validation of the input data was ignored, and invalid data was written into the database.

    This particular bug got fixed before reaching production.
  • Herr Otto Flick 2013-01-04 07:35
    ZoomST:
    Remy Porter:
    In my day, that was "middle mouse click". You kids and your fancy scroll-wheels.


    In fact, using the middle mouse button in FireFox over a link, opens it in a new tab. Is it covered by this code? Seems not, AFAIK.


    Given that this code is a wrapper around System.Windows.Forms.WebBrowser, a wrapper for including IE into your app, your conclusion that it does not cover Firefox is spot on. Remarkable deduction skills.
  • furiant 2013-01-04 08:28
    It's cute that you people think that comment was in the original code.
  • qbolec 2013-01-04 12:50
    Am I the only one who after reading "System.Windows.Forms.WebBrowser." was expecting something more after the last dot and tried CTRL+A?
  • Nagesh 2013-01-04 14:06
    Chromatix:
    One of the railway signalling systems in Scandinavia indicates different speeds with different numbers of lights. A single green light means "clear, full speed". Two or three green lights together mean "clear" and successively *lower* speeds. This leads to an obvious wrong-side failure mode where one of the green lights blows, and the signal indicates a higher speed than it should.

    Worse, the immediately neighbouring country has a signalling system that is very similar, was derived from the same older system, yet has some indications which are completely opposite to the indications in the first country.

    Right: Sweden has (a) one green for "proceed" (b) two greens for "proceed, speed limited to 40 km/h", (c) three greens for "proceed, 40 km/h, expect stop in short distance", (d) blinking green for "warning, except stop at the next signal". And Denmark has (a) one green for "proceed, expect stop next" and (b) either two greens or blinking green (depending on the type of signal) for "proceed, except proceed next".

    But the two are only "derived from the same older system" in a very general and indirect sense (namely, that for a few decades in the mid-1800s both contries used systems where green was "danger" and white was "clear". They were modified in both cases because a broken green lamp glass would be a wrong-side failure).

    Accordingly it is prohibited for the same driver to operate a train in both countries, even though they speak nearly the same language and the networks are interconnected.

    This is not true. On the contrary, trains routinely run between Copenhagen and Malmö without driver changes underway, despite the signaling system changing in the middle of the Øresund fixed link. There's no place for a train to stop at the point where the signaling system changes.

    On the other hand, all trains on that line are required to be fitted with cab signaling Automatic Train Protection systems which independently prevent signal overruns.

    Norway has a third system, also incompatible with Sweden, where one green is "proceed slow" and two greens is "proceed fast".
  • Roman 2013-01-04 19:30
    Disagree. If you ever find yourself writing such a comment, I think this is clear indication that *THIS CODE NEEDS A REAL COMMENT*. You know, one that explains exactly why the author realised that he wrote a WTF-like thing but left it in.
  • Norman Diamond 2013-01-04 20:57
    Herr Otto Flick:
    ZoomST:
    Remy Porter:
    In my day, that was "middle mouse click". You kids and your fancy scroll-wheels.
    In fact, using the middle mouse button in FireFox over a link, opens it in a new tab. Is it covered by this code? Seems not, AFAIK.
    Given that this code is a wrapper around System.Windows.Forms.WebBrowser, a wrapper for including IE into your app, your conclusion that it does not cover Firefox is spot on. Remarkable deduction skills.
    Given that this code isn't a wrapper around System.Windows.Forms.IE, we have to look in MSDN to find out if WebBrowser means the user's web browser or IE. And if MSDN doesn't say, or even if MSDN does say, we have to experiment to find out the real answer. And the real answer will depend on which version of Windows.
  • Musaran 2013-01-05 07:57
    (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)


    That feels wrong to me.
  • Hatshepsut 2013-01-07 04:56
    da Doctah:
    ZoomST:
    In fact, using the middle mouse button in FireFox over a link, opens it in a new tab.
    Cool! You just saved me something like 24 hours over the remainder of my lifetime.


    Then take the day off tomorrow, otherwise your bonus day will be somewhat ruined by your dying on it...
  • WDL 2013-01-07 06:11
    3) A manager forced you to implement this.... and you write a comment in the code to show other coders who stumble upon it, that you know it's stupid.
  • coyo 2013-01-07 21:03
    Slow down, you click too fast
    You gotta make the e-vent last
    Hackin' down the windows code
    do do do dooo
    feeling wtfooky

    sha na na naaa na na na
    feeling wtfooky
  • Ubiquitous 2013-01-08 07:36
    jbabs:
    If you ever find yourself writing a comment in your code that says "Please don't submit this to the daily WTF", it means two things:

    1) you're doing it wrong.
    2) it's going to end up on dailyWTF.

    c) You want your code to appear on DailyWTF.
  • Neil 2013-01-09 11:28
    xorsyst:
    urza9814:
    What if, for (a somewhat poor) example, you're writing something like Outlook? Emails are going to be in HTML; you could write your own parser, but why reinvent the wheel? But you also don't want to launch a full browser every time the user clicks to view a message.
    To continue your example, what if there's a url in the message? If I click on it, should it spawn my browser, or render the webpage in my application?
    I just use a single application capable of rendering both emails and webpages (but not in the same window, although I know an email app that wants to do that).

    CAPTCHA: sagaciter: Someone who quotes Beowulf.
  • Neil 2013-01-09 12:05
    Oh, and TRWTF is being able to click on Submit before Preview, amirite?

    CAPTCHA: incassum: Click on Preview before Submit just incassum.
  • TortoiseWrath 2013-01-10 21:24
    TheCPUWizard:
    It looks like the code is intended to handle situations where the person has ALREADY ctrl-clicked to open a new tab, is still on the old tab (ie the new tab has not opened and gotten focus)....

    Especially if the site in question is slow to load, this *may* actually be useful (the intent, not necessirly the implementation.


    )
  • Jasper 2013-01-15 11:28
    jbabs:
    If you ever find yourself writing a comment in your code that says "Please don't submit this to the daily WTF", it means two things:

    1) you're doing it wrong.
    2) it's going to end up on dailyWTF.

    It's even worse: you're doing it wrong, you know you are doing it wrong, and you are still doing it! Therefore you deserve to be shamed on TheDailyWTF.