- 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
trying to embed an image right next to deeply nested XML... :rolleyes:
Admin
Meh, once you've had to live with being forced to write huge test cases (and a framework) on top of STAX (xml tests), todays WTF looks like just another day.
Admin
TRWTF is an 11.3 MB picture in the article.
Admin
Thank god for fiber, eh? Reminds me of back when browsers would fail to download images, so you could right-click and do "Show Picture" (or configure the browser to not auto-load the image).
Admin
TRWTF ... is letting Huawei get a(hua)way with that format. (Or whoever masquerades as them ...)
Admin
Never stopped XSLT…
Admin
Providing arithmetic operators in an XML file is just begging for this sort of code to be written...
Admin
If it was C++ templates rather than XML, I'm sure there would be people who would see it as a reasonable thing to do.
Admin
For those saying Logic in XML is WTF....please provide a runtime configurable alternative. No matter the format, you are going to end up with deeply nested structures.
Admin
Lua.
Admin
This is exactly what JavaScript was designed to do.
Admin
Obviously they should have embedded it inside the XML.
Admin
Admin
Admin
Yes it was. So was Lua. Both languages were written for the same purpose. So was VBA.
Admin
Admin
I like Lua, so don't get me wrong....but using any of the proposed "languages" rather than a pure datastructure (independent of it being XML) puts constraints on the execution environment - which was my point.
For example, it would be easier to implement an interpreter for the posted XML on an arbitrary machine in an arbitrary language than it would be to create a JavaScript interpreter that could be run inside of a Cobol program on a Mainframe from the last century.
So, in this case going with a "data structure" rather than a "language" might be a WTF, but there are many potential unknowns.
Admin
Umm....sorry, Glenn, that ship already sailed....
This type of stuff, in XML, is a perfect example of a "hammer for every nail" syndrome; the same syndrome that leads people to write Conway's Life in SQL.
Admin
You didn't have to go that far...
Admin
Yes it was, and this conversation is quickly getting boring.
If it was designed to manipulate DOM elements, why is it so goddamned awful at that? Why doesn't any (either!) of JavaScript's built-in libraries contain any helper functions useful for that purpose?
What you're describing is what JavaScript was first used to do, not what it was designed to do. There's a difference.
Of course. That's what it's designed to do.
Just like JavaScript was.
I actually don't think that's true. If you need to interpret this inside a COBOL program on a mainframe from the last century, you're in a world of hurt no matter what format it's in.
Admin
Admin
Correct. How does that change anything I've said in this thread?
We're not talking about who made it, or what it was first used for, but what it was designed to do.
Concur; but if JavaScript was designed specifically to deal with DOM, you'd think it'd have DOM somewhere in its libraries.
Admin
Admin
Admin
No that would be a way to check if some technology was designed well for something
Admin
Admin
Admin
No, TRWTF is using u_int32 for temperature.
Unless the temperature is being stored in Kelvin and the design specs are more than a couple months old...
Admin
There's no unsigned temperatures anywhere in the article.
Admin
FTFY<sigh>
Admin
This may all be true, but XML is still a terrible choice. An S-expression-like syntax might be a good choice.
still isn't exactly readable but it's a lot less terrible.
Admin
Sooo... JS was designed to manipulate data like XML?
Admin
If you want to use u_ints, find a high value not likely to be encountered in real life, and pick it as a special value to say "Numbers above this are actually sub-zero."
temperature in Fahrenheit = x when x < 1000 temperature in Fahrenheit = 1000 - x when x >= 1000
I know, I know, Evil Ideas Thread is elsewhere.
Admin
Even a simple C would solve that problem, with union. Fill as int32_t, read as float, done. At worst, union of array of unsigned char and float, if the byte order still need to be reversed.
Admin
Oh, so there isn't... I missed that on the next line they manually start converting the u_int32 to float.
Admin
Ah, but DOM was “designed” to be fucking awful in all possible programming languages.
Admin
:wtf:
Admin
You could choose a number somewhere in the middle of the possible range, say 2147483647. You could then call this convention a "signed integer"
Admin
Many do not. In other cases where they exist, they are not allowed for Line of Business code [typically mandated to be COBOL].
Admin
:wtf: And retargetable C compilers have been around for how long now?
A script interpreter isn't Line of Business code...(Anyone who thinks otherwise needs to be hit with a Dragon-book-sized cluebat, because interpreter innards are a classical CS topic i.e. not something COBOL-only ex-accountants should ever meddle with!)
Admin
LOB code is ANY code that if is magically disappeared in an instant would have any effect on business operations.
Admin
Does that, by transitive extension, include the OS, runtime libraries, bootloader, and hardware drivers? Because those certainly aren't written in COBOL!
Admin
You'd think the people who contribute to a site dedicated to mocking WTFs would exercise some care in not committing WTFs themselves, but noooooooooooo...
Admin
COBOL-only ex-accountants should definitely meddle in the affairs of dragons.
Filed under: [spoiler]crunchy, taste good, ketchup[/spoiler]
Admin
LOL. I just remembered I'd seen it somewhere. I tried to search on Google, but didn't find the TD :wtf: so I went with the GitHub one. Here, he was just asking; there, it's published as a public project.
Truly amazing. I swear, some of these zealots would use a sledgehammer to fix a contact lens.
Admin
Admin
Admin
I was wondering WTF it was taking so long to load what is essentially supposed to be a text article... And this time I couldn't blame it on the company blocking yandex.st!
Admin
Not trying to be pendantic but:
[image] [image]Admin
Lisp, anyone? (I mildly refactored it to remove redundancies).