- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
I think I may add this comment to ALL my code from this day forward!!
Admin
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!
Admin
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.
Admin
The feature is useful. This is a CodeSOD- it's the implementation that's the WTF.
Admin
This seems to defend against chronic double-clickers. You know, the people who double-click everything because they don't know any better.
Admin
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.
Admin
What about scrollwheel-click?
Admin
In my day, that was "middle mouse click". You kids and your fancy scroll-wheels.
Admin
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.
Admin
Pah! You kids and your fancy three-button mice.
Admin
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:
Admin
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....
Admin
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?
Admin
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:
Admin
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.
Admin
It's me, or beginning by disabling the clicked button just after being clicked would do the trick?
Admin
It's this feature that forced me to download the AHK plugin to middle-click delete mails in Outlook.
Admin
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!
Admin
Yeah me too. I'm going to put it at the top of every class and method I write.
Admin
"Please don't throw me into that brier-bush over there, Brer Fox!"
Admin
The comment should be at the top of the function, the whole thing as a concept is totally flawed.
Admin
Admin
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.
Admin
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.
Admin
These are the same people that do not know that "click" means "left click".
Click on this.
They also double-click every single time.
Admin
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.
Admin
Admin
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.
Admin
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.
Admin
"click! click! click! ...clickety ... click! click! click!"
... Oh no you don't !
Admin
If you would like browseresque tab handling in Eclipse, comment on this feature request: https://bugs.eclipse.org/bugs/show_bug.cgi?id=362176
Admin
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?
Admin
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.
Admin
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?
Admin
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.
Admin
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.
Admin
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.
Admin
Admin
Admin
Admin
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.
Admin
Admin
@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.
Admin
Admin
This. I don't see why this submission is a WTF. A few more points:
Admin
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.
Admin
Neither is necessarily wrong, it depends on the situation, and possibly personal preference.
Admin
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>Admin
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.
Admin
...
Profit!
It is all part of The Plan!