- 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
The biggest WTF is of course that a space was added after the {. This means the JSON was created manually, instead of using one of the myriad available functions to do exactly that.
Admin
By all natural laws of computing, a weakly typed language like javascript should have been extinct the minute it came out of the door.
Admin
Yeah, because in other languages you can't manually parse a (non)standard response string. And this is what strong/weak types are all about, isn't, mr Logic ?
Admin
This code smells worse that a Lemnian Woman.
Admin
Yeah, because using eval() is widely recommended... cough
Admin
The real WTF is that it's the shortest day of the year, north of the 50th parallel, right in the middle of winter, and I'm sitting here with the window wide open, sweating like a Pee Eye Jee ...
Admin
TRWTF is using "/{2}" in a RegExp to find "//".
W{1}T{1}F{1}
Admin
why?
Admin
I pity the poor, maligned space character. It is generally treated as insignificant in a world of otherwise significant characters.
I salute you, little friend!
Admin
Yay, Esperanto mentioned on thedailywtf!
As JoMo says, "Lernu Esperanton nun!"
Captcha: valetudo (everything goes)
Admin
I'm not sure you can jump to that conclusion. Suppose you want to dump the JSON string into a log file in a readable format before responding. You'd want to encode the original JSON blob in pretty format, with newlines and indentation. But when it comes time to go over the wire, you want to minify it, and maybe your minifier isn't perfect.
Admin
In JSON parsing, it's okay, however almost all modern browsers (Chrome 7?+ Safari 5+ FF 4+ Opera 10.50+ IE9+) all expose a global JSON object that has "stringify" and "parse" methods.
You're supposed to do a couple of quick/dirty regex's to verify integrity but those are for old browsers only. It's okay to use eval in this context or to just use the function constructor with return (i.e. (new Function("return "+JSONDATA)() )
Admin
Admin
Be grateful... you could be North of the 50th parallel on the vernal equinox (1st day of spring), with the window frozen shut and afraid that if you go out side an important part of your body might freeze and snap off.
Admin
TRWTF is the claim that “no one's really heard of ASN.1”
Admin
No, it might as well mean that they decided to use a different library, the lib was updated, or a config parameter was changed.
Admin
The real WTF is no "Frist". What's with you guys?
Admin
Come on people: the real WTF is Javascript.
Admin
TRWTF is of course:
"No data interchange format is perfect. ASN.1 (Abstract Syntax Notation One) is probably the closest (it's by far the most flexible and comprehensive)"
ASN.1 close to perfect?
Admin
TRWTF is the idea that ASN.1 is the perfect data interchange format. Firstly, it's binary, and being textual is important. But secondly, ASN.1 parsers have a history of nasty buffer overflows. Perhaps this was partly down to the implementation languages, but it doesn't suggest that it's an easy-to-parse format...
Admin
I live smack dab on the 60th, and neither the winter solstice nor the vernal equinox bother me much.
Admin
TRWTF is praising ASN.1. ASN.1 is the most needlessly convoluted "standard" data exchange format ever created.
You know how the SQL "standard" is so big that there are absolutely zero fully conforming implementations? ASN.1 is the same thing. Besides its complexity, it also dictates worthless small details but leaves big issues unresolved.
The only possible way someone could implement ASN.1 without losing his sanity is implementing only enough to interact with whatever legacy system that uses it then stop immediately when it starts to "barely work" (that's the best you can achieve with ASN.1 anyway).
Admin
It depends if this really is a WTF, or simply a small bug in a regex. If this were the only line of JSON that my entire application would ever encounter, I'd might be tempted to avoid adding a dependency to a JSON parser and just use a regex to parse it as well. If the application has to deal with JSON all over the place, however, use a JSON library instead.
Admin
"JSON (JavaScript Object Notation) has been gaining favor"
That's the understatement of the day. From my experience, at least.
XML has a huge overhead, on documents large and small, and is less readable than JSON (not that human readability was actually a design consideration).
Also, "TRWTF is Javascript?" What language were you planning on using for your client side browser scripting again? I mean, it's not my field. I work on server-side, and I don't particularly like Java, but it's hardly a WTF to work with it, especially in this context.
Admin
I haven't heard of it... not really
Admin
Doesn't that depend on the encoding rules used?
Admin
I haven't heard of it... not really.
Admin
CoffeeScript? Dash? Java/GWT?
Sure, they all compile to JavaScript behind the scenes, but by that reasoning, all programming languages are the same as assembly.
Admin
Admin
Yeah, curry does that to me too!
Admin
Admin
Cross Quarter, Solstice and Equinox dates & times (cearth's position relative to seasonal cusps)
http://www.archaeoastronomy.com/myclock.shtml
Admin
Admin
DO a google search for the whitespace language. In whitespace, a space character is a first-class citizen.
Admin
Admin
If not trolling, then I'll assume by your statement that you don't run ANY software not written by anyone other than yourself.
Admin
Mozilla Firefox has the Greasemonkey Plug-In
Both allow you to write Javascript that will be run on pages you specify. Between this an No Script, you can assert 100% control over every bit of client side browser scripting that runs on your computer.
And you don't even need to reload.
Admin
Admin
Others have said this, but it bears repeating. The part of this that had me smacking my head in disbelief is the claim that ASN.1 is anywere near perfect.
Admin
Admin
The real "The real WTF" is the redirect url: "http://initrode-global.com/auth/login.do?cmd=auth-success"
What does it matter if the javascript breaks some day? You can just type in that url yourself.
Admin
http://en.wikipedia.org/wiki/Winter_solstice
Admin
Now let's discuss who's stupid, since you seem to consider that a productive way to frame a debate.
Admin
Admin
Admin
You also seem to be assuming a corporate IT environment, for some gonzo reason.
Admin
Except he didn't say "all locally installed software is reputable" or that "all web software is amateur", those are conclusions you extrapolated on your own, and are in no way even alluded to in what he said. So no, it's still you.
Admin
Admin
You have heard of ASN.1..... therefore you are really no one!
<grin>[A healyth and happy holiday season to all!]
Admin
To quote a book by O'Reilly or regular expressions...
A programmer is trying to solve a problem. She says, "I know, I will use regular expressions.". Now she has two problems.