- 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
Asus Cheap computers...cheaper code.
Admin
Defaults? Defaults? We don't need no defaults!
We don't need no steenking defaults!
Admin
Am I the first to notice that both branches of the if statement do the exact same thing?
Also I stumbled across something similar on a website recently. Its JavaScript was set to "strict mode" which meant more stringent parsing rules and from a developer standpoint, it keeps you from making some common dumb mistakes.
Good, right?
Well, their script didn't pass the strict mode parsing checks and refused to run!
So the only browser that worked properly with the site was the only one that doesn't support strict mode at all and so would not implement the extra checks... Internet Explorer 9 and lower. I wonder if they'll figure it out once IE10 is released, as it has support...
Admin
Who would ever want to surf the web with a non-Windows-and-non-Mac Computer? That is unthinkable.
Admin
This would be hilarious in 2005. In 2013, it's sad. It appears not to work at all on Chrome on Windows (not surprising, based on that Javascript).
Admin
Anyone else wondering how they got 38 lines out of that source?
Admin
I also like how it's all put inside a closure but all entities are still is populating the global object. (And since it doesn't declare any vars, it also throws an error at the if-clause, aside from not providing a default branch.) Just: wow!
Admin
Wow... that's... yikes. I don't even... I think I may need to go lie down.
You could seriously reduce this bosh'tet to a single line. A non-javaScript line, even.
Admin
The real wtf is that lack of line-wrap...
Admin
Working just fine on Chrome/Windows 7 here?
Admin
First rule of browser sniffing: Don't do it.
Second rule of browser sniffing (only for experts): Don't do it.
Last rule of browser sniffing: Use an existing library and provide a sane default.
~Andy
Admin
Proof here, if Aksimet will actually let me post it: http://imgur.com/rbv0b0e
Admin
Well, it is a Win8 gadget. They really intend to keep desktop Linux/BSD users from being their customers, as is apparent here.
Admin
Admin
Q: How many web developers does it take to change a lightbulb
A: jQuery!
Admin
First rule of browser sniffing: Don't do it. Second rule of browser sniffing: Seriously, don't do it. Third rule of browser sniffing: If you do it, I will remove your reproductive organs slowly with a cheese grater.
Admin
Plus, it's not like fixing that particular bug would make Webstorage not be a piece of complete garbage (though I'd consider using it for backups if they gave me at least 50GB free).
Sorry I'm just a bit angry because I have an Asus laptop filled with Asus software and it's all complete shit.
Admin
...ouch. That seemed to wake me up better than coffee.
Admin
First, Second, Third rule of browser sniffing: Don't do it unless you are fixing a browser specific bug, see IE6-10.
Admin
Why would it be a bad idea to sniff out browsers (or rather sniff supported features depending on your definition of browser sniffing) to provide additional features to the User?
Admin
...is the name of their feedback form and there is a field named "Sublect".
Its all perfect engrish.
Admin
Admin
I just died a little inside...
Admin
Admin
LOL! All that and it's just to append the same text into the head of the page! Well done on that one.
Admin
Sniffing features is a good thing. Sniffing browsers is not.
Admin
Admin
Because there are hndreds of other browsers that can run your extra feature, but you didn't heard about. (Some of them because they just don't exist yet, but they'll exist in the future, become very popular, and you won't rewrite your tests.)
You can verify if any browser feature is available with Javascript. No need to identify the browser.
Admin
So much work just to include the same stylesheet
Admin
The point is to make websites that work.
NOT to make them "display the same" on every computer. That is impossible. The sooner you get that through your rat turd infested brain the better. Other people don't have your computer. Their computer will be different, so things will look different. That's how it is. You can't do anything about it. No, you can not. That isn't possible. I don't care how hard you wish. Tough. It isn't your computer, it's theirs. They will control how it looks. You won't. Because you can't. So stop fucking trying already before I have to come over there and break my cluebat over your fingers! I mean it! Stop!!!
Admin
You can indeed, but "available" is not the same thing as "working", except with every browser made by anyone other than Microsoft.
Admin
But the all-powerful Marketing Department insist on it. Impossibility is not an acceptable reason for not doing what they say.
Admin
Admin
Then, we build a separate network for nerds only. It has to be hard to use -- hard to connect, hard to configure, hard to navigate. Hard enough that the marketdroids, bleeding heart nincompoops, politicians and whatnot can never see what's there.
Only then can we have our freedoms back. We can do it. We did it the first time. Our only mistake was inviting the gutter snipes to come play in our kingdom.
Admin
Admin
Heh. That's the thing that really made me want to cry over this one - they're using jQuery, and yet feel the need for browser sniffling.
But even beyond that, the real irony is that even if they did need to sniff the browser, jQuery has a browser sniffer already included. (okay, granted, it's deprecated and was never a good idea from the begining, but all the same, it would have been better than what they've got)
There are so many lovely WTFs here, it's hard to pick my favourite.
I quite like the if() blocks that have no code in them.
And of course the if() block that does the same thing in the else condition.
And the way it uses global variables is too just funny.
But I think my favourite bit is the comments that state the obvious. Always a sign of a really poor developer who thinks he's the bee's knees.
Hehehe. I love it.
Admin
Admin
You say that, but I had to remove SSL 2.0/3.0 support from one of our webservers last week to pass PCI compliance scanning. IE 6/7 break with the worst error page in this case, so if you hit our http redirect we're going to check your browser. (And tell you to get IE8 or something else for crying out loud)
Two wrongs, they make a right!
Admin
Well beyond that stupid bit of code, it's also the slowest website I have ever seen - seriously? I have to load every goddamn time I scroll? No thank you!
Admin
Because let me tell you, here in the actual real world, sometimes you don't just make websites for yourself, but for the people that in the end pay your salary. And those people will want a website that looks as near the same as possible on all major browsers. And if that browser-list is somewhat limited (to, for example, IE8-10, Chrome, Firefox and Safari), that is very much a possibility.
It may be difficult, and you will have to tell your client that that the feature he wants will take a lot of time (and thus: money) to implement exactly the same, but it is always possible; worst case scenario involves the true WTF's, like pre-rendered images, flash, and absolute positioning on everything. Just recall the crazy loops we'd have to jump through, not that long ago, to make stuff like nicely rounded corners and drop-shadows.
Now, in that same real world only some of us apparently inhabit, you also may at times inform your client that, yes, you can add support for the 0.01% of users who do not use one of the covered browsers, but it will cost money. To which those clients tend to reply: "well, bugger them then". In this case, they should of course have added a fall-back, even if it did not work very well, but if you're not part of their target audience, they simply do not care, and most definitely will not pay you for adding support either. So you don't.
As for feature sniffing: that only gets you so far. Again, in magical unicorn land, all browsers that implement a feature do so in exactly the same way and to the same degree. In my harsh cruel reality, there's stuff like a date/time input element which may be supported but not work (thank you, Chrome). There are features like file-access api's that work, right up to the point where they crash (thanks, IE10). And don't even get me started on styling features that are supported in all browsers but simply implemented slightly different, so that your nicely supported feature will yield ever so subtly different results depending on which browser executes it.
Now I do not condone browser / OS sniffing, for obvious reasons; but sometimes it is unavoidable to comply with what you client wants.
Admin
Browser sniffing: it literally is a code smell.
Admin
I try to visualize what happen if a women do browser sniffing.
It look like something that come from Japan.
Admin
There are legitimate use cases for browser sniffing, but this is not one of them.
Admin
I only sniff browser for statistical reasons - to check what people actually are using and to try to test the web pages with the most common alternatives for the moment.
And most of the special handling is actually for IE while other browsers seems to accept standard pretty well.
Admin
So you're angry because you decided to spend your own money on some stuff you didn't want?
I... I don't think anyone else can help you with that problem.
Admin
Yeah and whatever happened to he "interwebs are like roads" motif?
"Our car works everywhere except Montana and Wyoming; we don't like those states."
"You can only drive on toll roads that are owned by General Motors."
"Well, it might drive on California roads; but that's a liberal state and so we can't provide any guarantee."
"That car you bought from us last month? It's no longer supported on your town's roads. Refund? Ha ha ha ha..."
Seriously, it's time for some kickback. Site uses Flash? Tell them to change to HTML 5. Site uses QuickTime? Same thing. Site can't do decent defaults for an unknown browser? Don't visit. Browser doesn't handle a lot of sites? Download another one.
I am seriously tired of "feudal web".
Admin
Admin
"Oh dear! My computer doesn't work on this website! I'm going to have to go out and buy a new computer which does!"
Admin
Is this that old that Chrome wasn't around or.....OH
Admin
Does the Irish Girl return?