- 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
Oh lovely.. the worst of both worlds..
Admin
A colleague of mine worked on an EDI project where the 3rd-party wanted to talk xml, but couldn't grasp that adding angled brackets was not enough; so every ampersand in a description, less-than, etc, screwed it all up.
The funny thing is that when we pointed this out, we were told that we were the first (of several) to complain, so it must be us. Obviously every company to go before us had only been to the buzzword-seminar too.
Admin
At least they used CDATA :) There's a schema use by the AU energy market (aseXML) which looks identical but they csv data is dumped between <CSVData></CSVData> tags - column headers and all!
Admin
Uhm, stupid question time...but the snippet looks like someone saw an XML file, didn't understand it really but tried to mimic it, and then they decided to embed CSV data at the end to give it some sort of function or purpose. My question, how the *$%# does someone convince themselves that their customer's nerds are going to be stupid enough to fall for this? I mean isn't blaggarant lying and iggnorance against some sort of law regarding contracts?
Admin
I've been looking for a while now, but for the life of me cannot find the "person.dateofbith" field in our database??
And what's a personel and why does it have an ID?
Date of bitch: November 21, 2006
Admin
No buzz compliance is complete until adding some dotnet
Admin
In one of my first jobs as a junior developer, I was called to a meeting with a huge customer - a bank who had templates for legal documents and they wanted to automate data entry into the templates from a mainframe, and then send it to the printer. My boss was a very good BA, and took me as the new guy who knows real programming (I went to a VB6 course) to the meeting as an advisor. They kept talking about xml this and xml that, and both me and my boss were nodding and smiling and saying "sure!". When we got out of there he told me "quick - find out what this 'xml' thingy is before the design meeting tomorrow!".
since I had many other projects (oh, to be young again...oh, wait - I still have too many projects at the same time...damn!) I couldnt spend much time on research, but I found out the general details and came the next day to the meeting, breifing my boss "oh, its just text files with tags. like all the csv configuration files we write".
We went inside and when the IT grilled us about how we are going to implement we displayed a great design how to parse the text out of the xml based on the tags. One of the bank IT people was surprisingly savvy and asked the obvious (well, obvious to me now) question - "why not use xpath?"
Even though I had no idea what he was talking about, I made the response that made me the consultant that I am today. I didnt even blink.
"well, we could use xpath, but we would lose a lot on preformance!"
Untill today its my favorite personal WTF. Like my captcha says - perfection!
Admin
Judging by the above sentence, this WTF is made by lazy programmers who want to fulfill boss's request with much code alternation.
Admin
Judging by the above sentence, this WTF is made by lazy programmers who want to fulfill boss's request without much code alternation.
Admin
This reminds me a lot of one of the lot of wtf's at the place where I did my master's thesis. We had a mass spectrometer that produced its data files in a XML/CSV format a lot like this. The difference was that those files were typically several megabytes. It took about a minute to feed one of those to DOM parser. The fun part was that you could not just throw XML parts away and use the CSV because the order of the fields could actually change.
Admin
You know, as a web designer who knows enough about coding to be dangerous, many of these CodeSODs go over my head. I mean, after reading the examples and the threads I normally understand what the mistakes are, but I often feel like I am missing out on something. Being somewhat more conversant in XML, I now know what it is I was missing out on: a feeling visceral revulsion.
Admin
I love you guy.
THAT is most brilliant answer to all those **** questions i ever heard. :) Declare a patent on this answer. ;)
Regards
Admin
oh s***, it's just like the system I've been maintaining at work.
I wish someone would respond to my resumes already.
Admin
The fact that it's published on WTF helps to feel that way though. For some of the example, hardly anybody but the sheerest code fundamentalists would ever think "WTF" if they saw it in "real life". Which doesn't mean they're good, that just mean they're widespread. Come on guys, who are the lucky ones who do not work in an environment filled with potential WTF around them?
This is a classic example of "if people say it's bad then I'm inclined to think it's bad". Otherwise called the sheep mentality. So basically, you just realised that you lack this sheep mentality. Pretty good for you I would think.
Admin
The real WTF is that it seems someone wanted to replace a perfectly working CSV based system with XML and the programmer figured out the quickest way to do it. I've done these unneeded "upgrades" myself, each and everyone being unnecessary.
Admin
This is not funny. This is just very very sad.
takes a deep swig
Admin
To be entirely honest, as revolting as it might seem, an XML header on a CSV stream would be welcome under some dirty-data situations. CSV is really good and one and only one thing: Dumping lots of data fast. XML is really really bad at that, and good at most of what CSV is bad at. I wouldn't combine them this way myself - I'd use some sort of signaling to separate the XML from the data so it doesn't take an age to parse - but combining them isn't a terrible idea if you're already set up for CSV data dumps and want a bit more flexibility.
Getting your clients, that can't give you good data in the first place, to actually sign on to this scheme might be more than a little tricky though. =p
Thankfully I never really need much XML or CSV anymore, aside from occasional metric outputs for generating charts from.
Admin
I absolutely agree! Why spoil a nice CSV in the first place? I think the new XML fetish is far too widespread. From a programmers point of view, I think that XML is hard to read, hard to maintain and a pain in the a** to parse, especially with the Java parsers that are overly complicated and slow, trying to connect to the net and fetching the DTD an other obscure things that are hard to supress. XPath simplify things, but the complexity of XML just makes you want to send an SQL dump instead. And XML is not even a real standard, there are thousands of ways of putting an XML document together. I mean, come on! Saying that XML is a document standard is like saying that speech is a communication standard. Just put a Greek person next to a Chinese one and see what happens :)
Admin
The WTF here is that real data has been posted.
Admin
That's another WTF right there...
Admin
Admin
This reminds me of Apple's XML representation of Property Lists. You see, OpenStep had a simple serialization format for simple data, roughly similar to JSON:
Admin
This is almost like a system a fellow dev and I had to come up with. My app was Perl over flat files, his app was Java over MySQL, and we had a third dev with PHP/MySQL. All three products did the same thing, just in different ways, and we needed a better way to migrate customers between them.
The only things they spoke in common were CSV and... no, not XML. The Perl app had to run without any binary modules installed, including an XML parser, so we settled on YAML. You'd dump your data as a CSV file, then we'd whip up these field map files in YAML. The beautiful thing was that we could also import from a whole bunch of our competitors using the same system. It was a beautiful, ugly hack, especially my half. It's real fun working with tabular data when your code can't think that way.
Of course, for every thing that we had in common in terms of sharable data, there were three things that couldn't be ground up into commonality. This is where our ideals split - I wanted to define a more rigid common file format and write custom export code, while the other dev wanted to let the import code handle most of the heavy lifting. Eh. I guess I'll never find out, I left the job a year ago.
Admin
That's anonymisation, that is ;-)
Admin
Why did Lisa got her office when she was 7 while Andrew had to wait until his eleven birthday? Nepotism again?
Admin
And they've since changed - again - to using a binary format by default, because XML "looses the preformance". Of course, they'll soon observe that the binary format is not readily human-readable and go to a serialised format...
Admin
No, it's made by a smart programmer who has just been handed a "specification" that said something like: "The file format must be XML", where that was the only "specification" of the file format, and asking for further clarification just got blank stares. The correct response to this non-specification is to take your current file format and wrap it in a CDATA block - getting the requirement satisfied with a minimum of effort is what the job is all about.
Next time, they might learn to write a proper specification. The programmer can do nothing to correct the fact that management has already ruined the current specification by not leaving the problem to the people who knew how to handle it.
If more people did this, we might finally be able to disabuse people of this notion that XML is some kind of "universal adaptor", magically making different things work together (it doesn't). The way I like to explain it to people is like this: XML is like a language. Saying "do it in XML" is just like saying "do it in Sanskrit" - it doesn't tell you anything about how to do it, and furthermore it's choosing a language that is understood by none of the current components of our system. Now can we turn this into a real requirement, or is it just a checkbox that nobody cares about?
If it's a checkbox, that is what CDATA is for. This sort of nonsense happens a lot in government contracts and similar organisations - the spec sheet says "must use X", but X isn't actually needed and was just added by some bureaucrat who wanted to justify their own existence, so the right thing to do is to pay lip service to the item and get on with something useful.
Admin
Sigh.
I remember once having read something about "Professional Ethics" and "High Standards" in the SoftDev industry. Must have been written before 1970.
Captcha: null. How appropriate.
Admin
Brought to you by Department of Redundancy Dept.
Admin
It's actually not that bad (it is legal XML, after all).
The real WTF would be if, when they say "this is the exact and only format that will be accepted" they mean that you can't change the format of the CSV data section, i.e. you can't change the metadata in the fields element.
If the target system is able to handle different formats (e.g. alternative date formats, additional columns) then it's a big improvement over a fixed CSV import format. However, I suspect this is not the case and the whole of the <options> and <fields> sections are redundant.
Admin
Admin
Admin
It often seems like this kind of problem is caused by a form of premature optimization - A business requirement is stated (e.g., "must be portable"), and one of the people involved vaguely remembers an article in <IT management magazine> where technology X is shown as the silver bullet for a whole class of problems, seemingly overlapping with the problem at hand. Fast forward a few weeks, and you've got a spec that focuses on the technology, not the solution.
Admin
The real WTF is that there's no code in the "Code Snippet of the Day."
Admin
Ah, I love it. Wrap a piece of shit up in a pretty box, and claim that it's a valuable gift. Open it up and it's still just a pile of shit.
Admin
Damn - that's a nice way to have a 1:100 compression ratio on XML grin
Admin
<geez/>
People just don't get it do they?! It's kinda like EDI everyone has their own "special" version of an EDI document that they use to insure their edi system is "theirs".
<idiots are everywhere they keep following me around/>
Admin
Admin
It should have looked like this...
Admin
You are my new hero.
Admin
Oh please. As software developers, our job is to give our customers what s/he wants, which is usually very different from what s/he asks for.
Our customers don't have the knowledge/abilities to write a perfect spec. A big part of our jobs is to elucidate what they want - this is the toughest part of software development, but it is critical. In this case, they wanted data to be interchanged using XML, probably because other components of the system were also using XML. This is simply a lazy solution, and is clearly not what the customer wanted.
Admin
I have to add that I see a lot of people thinking that XML is great for all data transfers. This is true if you are doing small amounts of transactional data transfers. But as soon as you try and send large amounts of data then it really is better to use csv or fixed width because of the speed to import the data.
Admin
Yeah, but CSV is not a data standard either. At least in the minds of many people I've worked with. I just worked with a guy who converted all of his CSV files to TSV (tab separated not tilde), because of the "quote problem". The guy didn't realize that the "quote problem" had been solved decades ago. Of course he probably wouldn't have had the problem in the first place if he hadn't decided to roll his own CSV parser.
Admin
I agree that we need to help our customers, but I have seen many cases where the product managers don't listen or ask for advice from the developers before they allocate time to a project. This could of been one of those issues.
This is exactly the kind of trash that I would provide if I had other more important things to work on and they didn't consult with me.
There are also many situations where we are forced to give half measures just to meet deadlines knowing full well that it will come back to us. It is all smoke and mirrors sometimes. There is no such thing as the perfect dev house anyway (most places are not even dev houses to begin with.
This xml document is very simple to work with in .net. You can just use the split function just like you would any other csv file. It is a quick and dirty workaround that doesn't cause many issues anyway.
Admin
That 3rd-party isn't (or didn't get gobbled up by) a company that ends with an IS, starts with an I, and has a big NOV in the middle, is it? ;-)
captcha equals "whiskey" - as in, 'whis-key will get me outta this crazy house?'
Admin
It's deja vu all over again. I developed an online banking application a few years ago where the backend output that had to be dealt with was XML that wrapped space-delimited screen files from a legacy COBOL-based system in CDATA tags. The XML portion was not only laughable, the vendor had a nasty habit of changing some of the specs every few months for no apparent reason other than to generate "upgrade" revenue.
Admin
I like Apple Solaris myself. Mmmm, apples.
Admin
I'm still laughing at your comment... glad I could help.
Admin
Shhhhh!
Admin
The data was sanitized before posting.