• (cs) in reply to MojoMonkeyfish
    MojoMonkeyfish:
    "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.

    I talked to someone recently who was extolling the virtues of server-side java script. Well, ok, not so much talked to him as sat in stunned silence while he talked, but still.

  • Ralph (unregistered) in reply to Zylon
    Zylon:
    Ralph:
    So you're asserting that software written by professional developers employed by reputable vendors, or peer-reviewed by established distribution mechanisms, installed and configured by an administrator after ensuring current backups, has the same threat model as software automatically loaded and run in real time, written by amateur anonymous random asshats half a world away?

    Now let's discuss who's stupid, since you seem to consider that a productive way to frame a debate.

    You are, if you believe that all locally installed software falls in the "reputable" category, and that all web software falls in the "amateur" category.

    You also seem to be assuming a corporate IT environment

    I don't work in a corporate environment, nor do I maintain one at home. Yet my software is still installed using an administrative account, with backups etc. in case something goes wrong.

    Now I suppose it is possible that despite haunting a tech site, you're one of those who reflexively clicks "OK" on any message that pops up asking to approve installing something on your computer. In which case, yes, you're at as much risk from software you install as from software embedded in web pages. But that doesn't make the class of software equally dangerous, it only makes you dangerous.

    Zylon:
    for some gonzo reason.
    Oh dear! Not the dreaded "gonzo" insult! I wither under your contempt, withdraw my objections, and promise to let everyone rape my computer from this day forth! Thanks for freeing my soul.
  • (cs) in reply to Dogbrags
    Dogbrags:
    snoofle:
    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!

    DO a google search for the whitespace language. In whitespace, a space character is a first-class citizen.

    In SNOBOL too, but we're talking languages generally used for web stuff here....

  • Anonymous Coward (unregistered) in reply to vt_mruhlin

    I presume you'd be using a server-side language to accept the request and generate the JSON response, in which case you already know the contents of the json response and would just log that shiznit in whatever format you want, rather than creating json and then massaging that into the log. Example WTF.

  • (cs) in reply to Qŭert
    Qŭert:
    Yay, Esperanto mentioned on thedailywtf!

    As JoMo says, "Lernu Esperanton nun!"

    Captcha: valetudo (everything goes)

    You forgot to say "Unua!"

    (Hmm, I've run into ASN.1 and I'm fluent in Esperanto.)

  • (cs) in reply to Bobby Tables
    Bobby Tables:
    The winter solstice is the 1st day of winter.

    http://en.wikipedia.org/wiki/Winter_solstice

    1. I don't think that page says what you think it says.
    2. See also http://www.straightdope.com/columns/read/161/is-it-true-summer-in-ireland-starts-may-1.

    Akismet, this is neither spam nor troll...

  • (cs)
    Just use JavaScript's built-in eval() method on the string of data

    NO. NEVER DO THIS.

  • Andrew (unregistered)

    Dear reader: What We've Learned So Far

    TRWTFs are:

    • No "Frist"
    • "Just use ... eval()". Applies to all languages.
    • ASN.1 as the best state transfer format no one has heard of
    • XML being the de facto standard for data exchange, JSON not so much
    • javascript
    • server-side javascript

    The Winter Solstice is, indeed, the first day of Winter -- for those in the US ( http://en.wikipedia.org/wiki/Winter#Period "In the USA (and sometimes in Britain) the season is regarded as beginning at the solstice")

    Ralph is one of the paranoid 1% who have javascript disabled. Security trumps UX for him.

  • (cs) in reply to Abso
    Abso:
    I talked to someone recently who was extolling the virtues of server-side java script. Well, ok, not so much talked to him as sat in stunned silence while he talked, but still.

    We have a little server-side JS here. Not a lot. It's the "node.js is good for fast lightweight i/o oriented network services because it makes callbacks easy and blocking operations hard" kind of deal.

    I wouldn't drag it much further than that, though. It's a specialty tool, not a very good hammer.

  • Andrew (unregistered) in reply to Ralph
    Ralph:
    Zylon:
    I'll assume [...] that you don't run ANY software not written by [you].
    So you're asserting that [vetted] software [...], has the same threat model as software automatically loaded and run in real time, written by amateur anonymous random asshats half a world away?

    Are you asserting that all javascript is written by these people? gets out a globe You must live in ... the Indian Ocean?

    Also, are you asserting that javascript apps carry the same amount of risk posed by desktop apps? Ever heard of the "browser sandbox"? I mean, as an example, javascript has to get permission to store data on your computer, and even then it only gets a few MB of space.

  • (cs) in reply to DES
    DES:
    TRWTF is the claim that “no one's really heard of ASN.1”
    I wish I never heard of ASN.1

    It's an academic monstrosity.

  • Ralph (unregistered) in reply to Andrew
    Andrew:
    Ever heard of the "browser sandbox"?
    Good one! You actually made me snicker out loud.

    But I will take comfort in knowing that identity thieves can only grab the money that's in my sandbox, leaving the rest of my assets safe.

    Oh wait. Banks, investment firms... they all seem to be online with scripts enabled. So, yeah, all your $ belong to the sandbox.

  • C|:{ ===< (unregistered) in reply to Martijn Otto
    Martijn Otto:
    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.
    Or they fuzzed the response to exclude stupid clients. Looks like a good idea to me.
  • (cs)

    I'm going to cry foul on this one. Maybe say that "it may as well be Afrikaans" since, if Wikipedia is to be any indicator, Esperanto is used at least 10 times as often.

  • Andrew (unregistered) in reply to Ralph
    Ralph:
    Andrew:
    Ever heard of the "browser sandbox"?
    Good one! You actually made me snicker out loud.

    But I will take comfort in knowing that identity thieves can only grab the money that's in my sandbox, leaving the rest of my assets safe.

    Oh wait. Banks, investment firms... they all seem to be online with scripts enabled. So, yeah, all your $ belong to the sandbox.

    Wait, you mean to say that stealing someone's identity / money is as easy as writing a bit of javascript? Do tell... maybe I needing later O:-)

  • Ralph (unregistered) in reply to Andrew
    Andrew:
    Ralph:
    Andrew:
    Ever heard of the "browser sandbox"?
    Good one! You actually made me snicker out loud.

    But I will take comfort in knowing that identity thieves can only grab the money that's in my sandbox, leaving the rest of my assets safe.

    Oh wait. Banks, investment firms... they all seem to be online with scripts enabled. So, yeah, all your $ belong to the sandbox.

    Wait, you mean to say that stealing someone's identity / money is as easy as writing a bit of javascript? Do tell... maybe I needing later O:-)

    Look man, I don't need to make sense here. I don't want to enable scripting and you can't make me. Freedom of choice! America!

  • Marnen Laibow-Koser (unregistered) in reply to Abso
    Abso:
    I talked to someone recently who was extolling the virtues of server-side java script. Well, ok, not so much talked to him as sat in stunned silence while he talked, but still.

    And the reason for the stunned silence was...? JavaScript is a much-maligned language, but an extremely powerful one, particularly when you put CoffeeScript on top to make the syntax more pleasant. I'd seriously consider server-side JS/CS for my next Web application; among other things, it means you can share code between server and client more easily (which becomes an issue in certain types of Ajax work).

  • (cs) in reply to PedanticCurmudgeon
    PedanticCurmudgeon:
    Matt Westwood:
    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 ...
    TRWTF is that you're posting here on your day off.
    No worries mate, I'm WFH.
  • RandomUser423713 (unregistered) in reply to imgx64
    imgx64:
    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).

    Aggravatingly, it is this same kind of issue that makes HL7 a PitA. Everyone comes to it with the "understanding" that "no one implements it exactly according to spec", so they decide that gives them license to look at one example, and implement it as "whatever I feel like, as long as it's split up by pipes, starts with these same 8 characters, and (sometimes) uses the right section codes".

  • (cs) in reply to Don
    Don:
    Matt Westwood:
    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 ...
    TRWTF is spelling out the letter "G" using a "J".

    Dee oh en - kay ee wye.

  • RandomUser423713 (unregistered) in reply to RandomUser423713

    Sorry, meant "segment codes".

  • (cs) in reply to Jerry
    Jerry:
    Kh3pra:
    Matt Westwood:
    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 ...
    why?
    He thought he saw a female.
    Nope, but I'm pretty damn sure I smelt one. Unless the fishmonger drove past.
  • JH (unregistered)

    Now then, let's guess why JSON is popular and ASN.1 isn't.

    Just maybe, human readability is more useful than the things ASN.1 is good at.

  • Dude.... (unregistered) in reply to RandomUser423713
    RandomUser423713:
    imgx64:
    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).

    Aggravatingly, it is this same kind of issue that makes HL7 a PitA. Everyone comes to it with the "understanding" that "no one implements it exactly according to spec", so they decide that gives them license to look at one example, and implement it as "whatever I feel like, as long as it's split up by pipes, starts with these same 8 characters, and (sometimes) uses the right segment codes".

    You're talking about HL7v2. HL7v3 is much harder to use than HL7v2 and must be much closer in complexity/horribleness of implementations to ASN.1 that HL7v2 is.

  • Tortoise (unregistered) in reply to Matt Westwood

    I would like to point out that this is, in fact, also the case on the 48th parallel. The sun is reflecting off the snow through the window, and I thus am sweaty and have no vision in my right eye.

  • Tortoise (unregistered) in reply to Matt Westwood
    Matt Westwood:
    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 ...

    That was in reply to this, because TRWTF is the "reply" button.

  • RandomUser423713 (unregistered) in reply to Dude....
    Dude....:
    RandomUser423713:
    imgx64:
    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).

    Aggravatingly, it is this same kind of issue that makes HL7 a PitA. Everyone comes to it with the "understanding" that "no one implements it exactly according to spec", so they decide that gives them license to look at one example, and implement it as "whatever I feel like, as long as it's split up by pipes, starts with these same 8 characters, and (sometimes) uses the right segment codes".
    You're talking about HL7v2. HL7v3 is much harder to use than HL7v2 and must be much closer in complexity/horribleness of implementations to ASN.1 that HL7v2 is.
    True enough, but all of the medical groups I have had to interact with insist on v2. Or rather, the pipe-delimited mess they like to claim is "standard" HL7v2.

  • Andrew (unregistered) in reply to Ralph
    Ralph:
    Andrew:
    Ralph:
    Andrew:
    Ever heard of the "browser sandbox"?
    Good one! You actually made me snicker out loud.

    But I will take comfort in knowing that identity thieves can only grab the money that's in my sandbox, leaving the rest of my assets safe.

    Oh wait. Banks, investment firms... they all seem to be online with scripts enabled. So, yeah, all your $ belong to the sandbox.

    Wait, you mean to say that stealing someone's identity / money is as easy as writing a bit of javascript? Do tell... maybe I needing later O:-)

    Look man, I don't need to make sense here. I don't want to enable scripting and you can't make me. Freedom of choice! America!

    Oh, by all means, you are quite allowed to disable scripting, and any other enhancements, on your own computer(s). You just aren't allowed to use BS arguments to back up your decision on a public forum :P

  • Ralph (unregistered) in reply to Andrew
    Andrew:
    Ralph:
    Andrew:
    Ralph:
    Andrew:
    Ever heard of the "browser sandbox"?
    Good one! You actually made me snicker out loud.

    But I will take comfort in knowing that identity thieves can only grab the money that's in my sandbox, leaving the rest of my assets safe.

    Oh wait. Banks, investment firms... they all seem to be online with scripts enabled. So, yeah, all your $ belong to the sandbox.

    Wait, you mean to say that stealing someone's identity / money is as easy as writing a bit of javascript? Do tell... maybe I needing later O:-)

    Look man, I don't need to make sense here. I don't want to enable scripting and you can't make me. Freedom of choice! America!

    Oh, by all means, you are quite allowed to disable scripting, and any other enhancements, on your own computer(s). You just aren't allowed to use BS arguments to back up your decision on a public forum :P

    Oh, but that's where you're wrong. See, I already did that exact thing, and nothing prevented me. Please try to be more logical from now on.

  • Ralph (unregistered) in reply to Andrew
    Andrew:
    Ralph:
    Andrew:
    Ever heard of the "browser sandbox"?
    Good one! You actually made me snicker out loud.

    But I will take comfort in knowing that identity thieves can only grab the money that's in my sandbox, leaving the rest of my assets safe.

    Oh wait. Banks, investment firms... they all seem to be online with scripts enabled. So, yeah, all your $ belong to the sandbox.

    Wait, you mean to say that stealing someone's identity / money is as easy as writing a bit of javascript? Do tell... maybe I needing later O:-)

    Yeah. Perhaps you've never heard of Cross Site Scripting. In which case you should stay far far away from web development. It has only been known for about 12 years now. Last I heard about 2/3 of all web sites were vulnerable -- which is a significant improvement from when it was discovered, at which time at least 96% of sites were vulnerable. So at that rate we should get it down near zero percent by about 2036. Until then, your bank's site may be exposed.

    But how could you be sure? After all you can't perform your own security testing against your bank... unless you live in a country without extradition. You're safer to just shut off scripts (e.g. NoScript) for as many sites as you can. It is really about the only defense you have available to you, short of converting all your accounts to gold and going to live in a cave with a shotgun.

  • Ralph (unregistered)

    P.S. I guess the next step up from troll is when you can get other people posting using your fake name! Thanks for playing along, everyone!

  • Ralph (unregistered)

    You're not the real fake Ralph, I am!

  • (cs) in reply to Marnen Laibow-Koser
    Marnen Laibow-Koser:
    Abso:
    I talked to someone recently who was extolling the virtues of server-side java script. Well, ok, not so much talked to him as sat in stunned silence while he talked, but still.

    And the reason for the stunned silence was...? JavaScript is a much-maligned language, but an extremely powerful one, particularly when you put CoffeeScript on top to make the syntax more pleasant. I'd seriously consider server-side JS/CS for my next Web application; among other things, it means you can share code between server and client more easily (which becomes an issue in certain types of Ajax work).

    I suppose because I'm only familiar with client-side JavaScript, which I don't particularly enjoy, and so it's hard for me to see how someone would react to JavaScript by thinking "where else can I use this language?" I also assumed that it wouldn't have as many tools and libraries as more popular server-side languages.

    But I don't do all that much web programming, and the guy I was talking to did talk a lot about how JavaScript is a well-designed language at heart, so I admit I may be wrong to dismiss it out of hand.

  • Fedaykin (unregistered) in reply to Martijn Otto

    Sorry, this just isn't a WTF. It's merely a poorly constructed regex.

    Using a regex to examine results is a perfectly valid method examining a result string -- certainly leagues better than the insane suggestion of using eval() on arbitrary strings.

  • Fedaykin (unregistered) in reply to Andrew
    Andrew:
    The Winter Solstice is, indeed, the first day of Winter -- for those in the US ( http://en.wikipedia.org/wiki/Winter#Period "In the USA (and sometimes in Britain) the season is regarded as beginning at the solstice")

    Ralph is one of the paranoid 1% who have javascript disabled. Security trumps UX for him.

    Totally off topic, but there are two definitions of winter used in the U.S.: Astronomical winter and meteorological winter.

    Astronomical winter is as you describe, but meteorological winter starts on Dec 1. Likewise for other seasons.

  • Simon (unregistered) in reply to pjt33
    pjt33:
    Anyone want to open a book on how many people will explain the difference between JS and Java?

    Thought about it, but well... it's the last day of the working year, and my motivation to do anything vaguely associated with work is non-existent.

  • Marnen Laibow-Koser (unregistered) in reply to Abso
    Abso:
    I suppose because I'm only familiar with client-side JavaScript, which I don't particularly enjoy, and so it's hard for me to see how someone would react to JavaScript by thinking "where else can I use this language?"

    I'd wager that you don't particularly enjoy it because, like (at a guess) 98% of people who write client-side JavaScript, you never learned to write it correctly. Not your fault, really; the language has traditionally been marketed in a way that leads people to its weaknesses, not its strengths -- that is, it's been too often used as an extension of HTML, or as an inferior version of Java, rather than the decent language in its own right that it actually is, and the syntax makes some of the best features too hard to use (which is why I recommend CoffeeScript). I'd advise reading some of the stuff at http://www.crockford.com , as well as books like JavaScript: The Definitive Guide (Flanagan) and JavaScript: The Good Parts (Flanagan & Crockford), to get a feel for what the language is really about.

    Personally, I was just really dumb lucky to stumble into Crockford's website as I was trying to learn JavaScript...got me started off on the right foot. I claim happy accident here, not personal brilliance.

    I also assumed that it wouldn't have as many tools and libraries as more popular server-side languages.

    Node.js has become extremely popular, and of course, many of the client-side libraries are already useful on the server side, since the core language is the same.

    But I don't do all that much web programming, and the guy I was talking to did talk a lot about how JavaScript is a well-designed language at heart, so I admit I may be wrong to dismiss it out of hand.

    I think you are. I've been pretty happy with Ruby on the server for the last few years (and other languages before that), but JS (or rather, CoffeeScript) is definitely a serious contender.

  • (cs) in reply to Qŭert
    Qŭert:
    Yay, Esperanto mentioned on thedailywtf!

    As JoMo says, "Lernu Esperanton nun!"

    Captcha: valetudo (everything goes)

    Learn Esperanto, the translate this:

    Cu vi povas direkti min al multiproksima medicina efiko? Mia piko estas frapmont de fulmo.

    I think "Frapmont de Fulmo" would be a great assumed name to use, if I ever had to use an assumed name.

  • Bonbon (unregistered)

    This is fine. It could be an embedded system where you cannot assume the availability of a JSON parser. Most embedded systems have regex support, though.

  • Ralph (unregistered) in reply to Ralph

    I'm Spartacus^H^H^H^H^H^H^H^H^HRalph!

    captcha: consequat. If you don't disable javascript, there will be consequats.

  • Worf (unregistered) in reply to Matt Westwood
    Matt Westwood:
    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 ...

    I'd say Global Warming, but it's obvious you're not on Earth.

    Here on Earth, Winter's just started - it starts on the Winter SOlstice (and ends at the Spring Equinox). But from where you are, your solstice marks the middle of winter...

  • (cs) in reply to Andrew
    Andrew:
    You just aren't allowed to use BS arguments to back up your decision on a public forum :P

    Hoot, mon! Would ye outlaw the internet, then?

  • (cs) in reply to Abso
    Abso:
    it's hard for me to see how someone would react to JavaScript by thinking "where else can I use this language?"

    Considering where this sort of thing is being promoted, I assume it's more a case of thinking, "Where else can I use these damn Javascript programmers?"

  • The Ironic Misogynist (unregistered) in reply to Please - no more variables/functions names foo and bar
    Please - no more variables/functions names foo and bar:
    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.

    Ha ha. Girl programmers are dumb.

  • The Capricious Meteorologist (unregistered) in reply to Fedaykin

    [quote user="Fedaykin"][quote user="Andrew"] "In the USA (and sometimes in Britain) the season is regarded as beginning at the solstice")

    Totally off topic, but there are two definitions of winter used in the U.S.: Astronomical winter and meteorological winter.

    Astronomical winter is as you describe, but meteorological winter starts on Dec 1. Likewise for other seasons.[/quote]

    Recalling being a child collecting Halloween treats from the neighbors very often in the first snowstorm of what seemed most definitely the beginning of winter (near the 45th parallel), I'm wondering how the powers-that-be managed to foist either one of these lies upon us.

  • Nagesh (unregistered) in reply to Ralph
    Ralph:
    P.S. I guess the next step up from troll is when you can get other people posting using your fake name!
    You rang?
  • Dave (unregistered) in reply to Gervase Markham
    Gervase Markham:
    TRWTF is the idea that ASN.1 is the perfect data interchange format. Firstly, it's binary, and being textual is important.

    Because you say so? Oh, sorry, because ESR says so, that makes all the difference. There was an attempt to enshrine this some years ago in a protocol called BEEP, a text-mode universal protocol for the entire Internet (RFC 3080/3081). ASN.1 is a global rockstar compared to where BEEP ended up.

    ASN.1 provides an efficient, compact, easy-to-parse format, which can't be said for any text format I've ever seen (JSON is about the closest to ASN.1).

    Gervase Markham:
    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...

    And parsers for anything else don't? Look at the chaos that is XML for an example of a real parsing mess.

    The opposition to ASN.1 seems to have originated from within the IETF, and was based on (1) the fact that ASN.1 was binary and not text, which was clearly an abomination against the Lord, (2) the fact that ASN.1 was an ISO and not IETF design and therefore an abomination against the Lord, and (3) the fact that the 1980s vintage ISODE tools for working with it sucked.

    That was twenty years ago, get over it.

  • Dave (unregistered) in reply to Dude....
    Dude....:
    RandomUser423713:
    imgx64:
    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).

    Aggravatingly, it is this same kind of issue that makes HL7 a PitA. Everyone comes to it with the "understanding" that "no one implements it exactly according to spec", so they decide that gives them license to look at one example, and implement it as "whatever I feel like, as long as it's split up by pipes, starts with these same 8 characters, and (sometimes) uses the right segment codes".

    You're talking about HL7v2. HL7v3 is much harder to use than HL7v2 and must be much closer in complexity/horribleness of implementations to ASN.1 that HL7v2 is.

    Having implemented both, HL7 is much, much nastier than ASN.1. ASN.1 is actually relatively simple, you use a standard library... and there go about 99% of your problems to start with, and then occasionally you have to handle something way off the scale, but in general with a decent library that handles DER and BER you're sorted, because you can't get that odd within the confines of the encoding rules. OTOH with HL7's "stuff anything between a lot of '|'s"... ugh.

  • Dave (unregistered) in reply to JH
    JH:
    Now then, let's guess why JSON is popular and ASN.1 isn't.

    Just maybe, human readability is more useful than the things ASN.1 is good at.

    Yup, because when my mother gets an IJK305I Encoding Error when she clicks "Submit" on her knitting club's web site she immediately fires up Notepad, loads the JSON into it, hand-edits the missing escape character into place, and then uses Firebug to manipulate the data back to the web site. Thank God it's in text mode, because if it was ASN.1 she wouldn't be able to do that.

    Puh-leeze. An encoding format depends on the tools that are used with it. JSON is popular because support for it is built into a large pile of web development tools and systems, not because of its format. You could have it encoded using chimpanzees banging coconuts together and it'd still work because all the developer sees is a JSONWriter or whatever. By that token ASN.1 is also a text format, because no-one would ever use a hex editor on the binary, you use a text-mode ASN.1 browser and editor just as you use a text-mode JSON (or XML, or whatever) browser and editor.

  • (cs)

    "I did it that way because no one would be idiotic enough to add a blank between { and ", right?"

    "They did?"

    "Those idiots!"

Leave a comment on “JavaScript JSON Parsing”

Log In or post as a guest

Replying to comment #:

« Return to Article