- 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
Finally, after so many "endorsements" for csv, somebody mentions what bothers me about it. I am only an amateur coder, therefore, usually, I hesitate to comment on the WTFs in order to avoid exposing my ignorance. However, this is an issue to me as a user rather than a hobby coder.
There are a couple of problems:
Nowadays, file names sometimes do contain commas or semicolons under Windows, and guess what? The software still does not escape them, so the entire line is shifted by one column in this case (and I have seen erroneous translation quotes caused by this problem, it does happen and it does cost money). Of course, this would be picked up by a sanity check in the importing application (if it does not blindly trust the numbers provided), sometimes it isn't. Using (meaningful) XML, ideally along with a strict DTD, it's just much harder to produce this kind of WTFs.
Admin
Admin
Whitespace may be code too, but I typically wouldn't think of this post as "words interspersed with code."
Admin
It'd be much nicer if we could just use YAML.
Easy to write by hand with a text editor, unambiguous representations of lists, tables, hashes, attributes, and nested versions thereof.
Lots of bindings for lots of language, even a fledging one for .NET:
http://yaml-net-parser.sourceforge.net/
Admin
So they used XML as a message wrapper. Whoopee.
I know XML is a bit of a whipping boy around here, but this is barely a "hrmmm", much less a "WTF".
Admin
sed "s/XML/ASCII/;s/markup/text/;s/OpenLazlo/C/;s/XSLT/Java/"
"ASCII is text, not code."
"What exactly would you call C or Java then? ASCII may be code."
Sure, XML may be code, but XML is not code. The XML in this WTF is not code.
Admin
American Standard Code for Information Interchange
QED
Admin
Oh... it was outsourced to some developers on Beta Antares IV. Excuse me while I go explain to my science officer why knows of no such projects being developed in that sector.
Admin
Any particular reason why the code appears as "[email protected]" (yes, that's the full text) in my mobile phone's RSS reader?
The one I'm using is this. http://pda.jasnapaka.com/prssr/
Admin
I'm a self employed contractor... and I'll fire any client that gets that stupid. :)
BTW, the Nice WTF is the fact tha the forum software translates "slash me" or /me into the poster... which made it appear that Chris Travers raised his hand too. And now, dgm...
Admin
This is the most reasonable comment I have read on this page.
Admin
Admin
No no no! Saying "XML is code" is the same as saying "HTML is code".
Even though it may be a method of encoding data, it's not code the way we usually think of the term.
Admin
Why DOM ? there are systems working on infinite XML file (example: XMPP). They just use SAX-like parsers,
DOM is only good when You need to do a number of random changes to XML and then save it, smth like MS XML Notepad. DOM however is bad for just reading the XML !
Admin
How so? Depends on what you mean by large. If you insist on using DOM, sure, things slow down real quick. But SAX-based parsing isn't that slow. I wrote quite a bit of those on Python, which isn't exactly assembly language, speed-wise, and my progs worked fine on 5-10 Mb files.
IMHO XML is the way to go for not-totally-trivial data, though you should always try to keep it as simple as possible. And, CSV files with commas in the data start looking quite ugly if you are parsing it by hand.
Admin
XML is a freeform format -- there is no right or wrong indentation.
Admin
...and why doesn't the quoting mechanism work properly in this forum?
Admin
You know, with the addition of a 'position' attribute in the field tags, this would be pretty decent. <field name="name" position=1 type="char" mapsto="person.data"/> Parse the options section to generate your data mapping, followed by processing the CSV file. For large datasets, it should be both faster to run & smaller to transmit than the equivalent document done in fully expressed XLM. In addition, it would be much more flexible than a straight CSV file, because you can add or remove fields as needed, change the order to suit your whim, or alter date styles with a single tweak of the output format. So, overall, it's actually a good first use of the technology; 1 tweak & it's a technical improvement over both CSV & XML for this implimentation.
Admin
prefectly stated, ford.
Admin
I thought you were proving the point ad absurdum :)
mp
“It’s not enough that we do our best; sometimes we have to do what’s required.” ~ Sir Winston Churchill ~