- Feature Articles
- CodeSOD
-
Error'd
- Most Recent Articles
- Stop Poking Me!
- Operation Erred Successfully
- A Dark Turn
- Nothing Doing
- Home By Another Way
- Coast Star
- Forsooth
- Epic
- 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
Admin
A senior is the right choice. You wouldn't want to bestow this mess upon a guy that is still far from retirement.
And no frist for you
Admin
I see that Chris B's predecessor thought that he'd use regular expressions to turn one problem into (at least) 12… With bonus enterpriseyness from all that XML too.
Admin
Obligitory comment about regex and the number of problems rising exponentially because of it.
edit: damn you dkf :p
Admin
And if I disable sending of the user agent string does that make me a secret agent?
Admin
Admin
This solution needs more service oriented architecture to facilitate social discovery.
Admin
Admin
I can see that a UserAgentParser.java is missing... and a bunch of hundreds more classes of course.
Admin
The real WTF is the UnsupportedUserAgentException.
Admin
Wonder what the lynx configuration file looks like
Admin
(Admire the beauty of my string literal parenthization!)
Admin
Admin
UserAgendParsedLetsPostToTwitterAboutIt.class ?
Admin
Someone clearly needs to create a SaaS user-agent detection infrastructure to harness the power of the cloud and synergize the relationship between browsers and content-authoring and delivery systems.
Admin
Admin
Your User Agent is: "Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120403211507 Firefox/12.0".
[image]Admin
I'm not sure if I get it right.
The Firefox XML takes care of parsing and hence the wonder "why have so many classes and interfaces?"
Admin
Admin
Admin
Admin
I feel physically ill after reading this. Seriously.
Admin
The web is about connecting everything to everything, and everyone to everyone.
If you're even looking at the User Agent string you're doing it wrong!
Admin
Hm... could it be that all those Java classes and interfaces are actually a generated XML binding?
That would make it a bit less of a WTF: Someone thought that right way to approach this was to pour all knowledge about user agent strings into XML configuration files (to make it, you known, configurable! Yay for Softcoding!), then defined a schema for that and used a binding generator.
Yeah, it's still a pretty dumb way to do it.
Admin
When all you have is a hammer, everything looks like a nail.
When all you have is an XML-autogenerated-Java lasagna architecture, everything looks like an enterprise!
Admin
Admin
Guys, you are all missing the point. Imagine you are a consultant who wants to squeeze out a couple of extra paid weeks but the project is almost done. You convince the customer that you need of course to figure out the user agent for customized UI rendering. Everybody knows that!!!! You could probably do that in a couple of hours but you need the money so you try to find out how much bloat you could create for simple string parsing. A bit like the "1+1=2 in scientific representation" joke. Either that or Chris B work at IBM.
Admin
I thought a Double agent was the opposite of an Integer agent.
Admin
You need to add something about "utilizing paradigms".
Admin
I needed to do browser discovery for logging purposes only, but I'm not skilled enough to create this masterpiece...
...so I just coded this in Java: http://www.quirksmode.org/js/detect.html
Time consumed: ~1h
Fail?
Admin
The User Agent String is essential to check to determine what content to send.
You wouldn't want to send a full desktop-based website (800+ pixel wide screen) with high resolution images to an Android or iPhone, would you?
It's also useful in serving correct CSS. You don't necessarily have to put hacks in your CSS if you simply send a different stylesheet for msie than for gecko/webkit.
Admin
Admin
It's nice when someone re-implements SDK Collection, Pattern, Properties, String, Boolean. Plus cache, because we need optimization.
Admin
Admin
Admin
Admin
Admin
XML is like violence. If it's not solving all your problems, you're not using enough of it.
Admin
No! Management where I work insist on "1+1>2". They literally told us that in a presentation! So your argument is invalid.
Admin
For large values of 1 it does... 1.4+1.4=2.8 rounded off to integers 1+1=3
Admin
You're using Safari 5 on an unknown OS!
lovely
Admin
And today's lesson is, don't show your code around here with pride, it'll be bashed to ashes.
Admin
This is obviously utterly ridiculous, and its creation was a massive waste of time, with benefits nowhere near justified by its cost.
But were I developing something on top of it, it looks like it'd be pretty handy!
Admin
Pretty dumb in my book, how are you supposed to add new browsers? I would have used regex to parse the user string, send that off to an MSSQL database (must be version 6.32532.32533 because it relies on an obscure bug that only exists in this exact version), and then a series of stored procedures will compare each bit of the user string and compare it to every bit of information in the database. Once it determines if the user is using Internet Explorer (can't use other browsers, takes too long to populate the database by hand) it gets wrapped up in XML and sent back to be regexed again and then a for loop runs through each entry in the database and compares it against the parsed data.
Admin
Admin
Reminds me of "Enterprise FizzBuzz" http://codermike.com/if-something-is-worth-doing
Admin
Name an application that requires pixel-counting.
Admin
Admin
Please stop making websites.
I specifically jailbroke my iOS devices so that I can put in the UAFaker addon to mobilesafari specifically so I can claim to be a desktop browser in order to prevent what you advocate.
I have zooming / panning capabilities in my mobile browser that permit me to efficiently view the normal or desktop versions of websites. I prefer them to the "mobile" stripped down versions of websites.
When in ladscape mode my screen resolution is above 800px wide anyhow and my eyesight is good enough that I can usually read text rendered that small on my phone's screen, and zoom in when necessary anyhow.
Stop dumbing down the internet. Damnum
Admin
My web apps all have a mobile version detected by the server.
The download size to fully display a page in the "desktop" version is 125kb and on the "mobile" version it is <2kb. When you are standing 450Km from the nearest town using my app on your Nokia 6550 you will thank me.
Oh, and don't worry about modding the OS on your phone and install any special app, there is a link at the bottom which says "Show Desktop Site"
And for the record I use a script from here which took 3 minutes to implement. I wish I had billed a client 3 weeks and created the masterpiece above.