- 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
Or something like that.
Addendum 2024-05-29 07:13: I couldn't be bothered to figure out what the format actually is.
Admin
It looks like major objects are serialized as the key, a colon, then curly braced key-value pairs. Each major object is separated by two colons, presumably so they can deserialize by splitting on '::'. Each key-value pair is serialized as key="value" and separated by two semicolons — again, I'd assume, so they can deserialize with a naive split on ';;'.
Addendum 2024-05-29 07:22: Eh. I missed the angle bracket version at the bottom. It looks like tplTable (i.e. "TPL") is serialized as "special" key-value pairs, but *only if there's two or more rows???
Admin
Let's face it, JS is TRWTF anyway.
JS is less a programming language than it is a torture tool.
Admin
I think you're right Remy - we don't need to punish Michael for writing this. However, Michael was assigned a task to write some code in a language that he was unfamiliar with when it was already past the deadline. I'd be very interested to know how that situation came about...
Admin
Michael doesn't need JSON because he invented WTFSON.
Admin
I think it's be:
and if with 2 fields in COMMENT, it'd be:
whereas with 2 COMMENTs instead, it'd be:
And of course, you could have the case of more than 1 comment AND more than 1 field:
Admin
Simple: Michael got into software development.
Admin
Indeed, WTFSON it is.
Admin
At least the data is escaped, which is already a step up over a lot of existing code.
Admin
This code definitely escaped, rather than being released.
Admin
He that is without sin among us, let him first (frist?) cast a stone at Michael...
Admin
The 'null="null"' has potential for submitting more useful information in a serially serialized serial way, like one="one", two="2", three="3.00", four="FILE_NOT_FOUND", five="four lights", true="FALSE" and brillant="paula", and so on...
Admin
A save function with no arguments always announces something good. The _variable _naming _schema is a lovely touch.
Admin
It was short notice, he didn't know the language, yada yada… and the underscores?
Admin
Naming JS variables with an underscore at the start is meant to signify that they are private and should be treated as such. Of course, as with typing, JS works on the honour system, and enforces absolutely nothing.
Admin
How many decades are JSON.stringify and JSON.parse around?
Admin
Regardless; The backstory suggests that Michael was put under a lot of pressure. Never a good thing when you're trying to learn a system you never used before.