- 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
Wow. Just Wow
Admin
Clearly they need to encode the XML itself in XML so they can add the numbers:
See, that's much more customisable, and easier to process. It even allows a character other than underscore to be used...
Admin
On a project I worked on, the XML looked like this:
In the end I couldn't read the XML because the word REFACTOR kept bouncing around my head.
Admin
Looks like someone just converted one of our ini files to xml. We have lots of files that look like this:
Admin
I've always wondered why people name things the blindingly obvious.
e.g. <rootNode> or public class BasePage : System.Web.Page (note not abstract)
The name does not describe the purpose and fixes it to a specified location in a hierarchy, invariably as time goes on RootNode, gets moved down the hierarchy and is no longer the ‘rootnode’
Admin
An XML Schema is perfectly possible. :)
Admin
I should also add that the code to read in this would open and close the file 111 times ... and was accessed by multiple processes with no locking for interprocess communication.
Admin
Smarty-pants!
Admin
Admin
Admin
The real WTF is that the list starts at 1...
Admin
please make the bad man go away
Admin
Than man is more than just shining, he's is fuckin' Paula Bean! Reminds me to last month's "These-Go-To-Fourteen"-CodeSOD.
Admin
So... in what way is this better than a csv file?
Actually, scratch that...
In what way is this better than writing all of the addresses on postit notes, and sticking them to the inside of a filing cabinet in an office abroad?
Admin
I think that needs flipping around. 'In How many ways is a CSV better than this'
Admin
The real WTF is that he thinks a schema would be definable if the tags weren't enumerated. Try handcoding one without help of an altova-tool, and you're doomed...
Admin
Sweet, I understand XML now. It's just like an array.
Admin
Freaking unreal. This "designer" obviously missed the point of XML entirely.
Admin
Admin
Oh no, that's far too specific. What they really need is a schema meta-language, for defining acceptable XSD schemas. We could call it XSDSD (XSD Schema Definition)...
Then you could define all the XSD instances in one go! Think of the expressive power...
Admin
This WTF has made me twitchy and angry...
Admin
Reminds me of a computer game I play called Space Empires 5... the game is highly moddable, but the data files are rather strict about what you can do (and the scripts are written in an abomination of a language that appears to be based mainly on Pascal and a bit on BASIC!)
Here is a typical data file section:
Number of Requirements := 2 Requirement 1 Description := Requires level 1 or higher in Anti-Proton Weaponry. Requirement 1 Evaluation Function := Get_Empire_Tech_Level("Anti-Proton Weaponry") >= [%Level%] Requirement 2 Description := The empire must have the Tentacle Monsters Of Death racial trait. Requirement 2 Evaluation Function := Empire_Has_Race_Trait("Tentacle Monsters Of Death") Requirement 3 Description := This requirement is impossible. Requiremetn 3 Evaluation Function := 2+2 = 5
In this data file section, the third requirement will be ignored because the "Number of Requirements" is set to only 2, but if it were not ignored, it would cause an error because there is no space between the plus sign and its operands!
Any other SE5 players around here? ;)
Admin
Admin
Admin
Admin
I hope people who do this get either fired have to rewrite all these XML files in their spare-time, without pay, of course.
Admin
Well, yes!. e.g. Web.Page->MyCompanyPage->SecurePage->DataViewPage->CustomerDetails
Informs usus as to what each 'base' page does. What would you suggest? BasePage, BaseBasePage, BaseBaseBasePage???
Admin
Make it abstract then ;)
Admin
Admin
I can understand stupidity. Sure... However WHY WHY WHY would someone just make their own lives 10x harder? I mean I can understand a quick hack that looks like crap, performs like crap, but took 5 minutes to write, but this probably took longer to implement than a normal xml.
Admin
That's getting off way too easy. Anything that accesses this XML would have to be re-written also.
Admin
System.Web.UI.Page->CompanyBase->SecureBase->DataViewBase->CustomerDetails
Admin
Well, he does not need an XSD. He's had enough LSD.
Admin
Ok I'll meet you 1/2 way and go along with that.
Though only if the class is marked as Abstract, then yes you could say that it is base e.g. Otherwise, it all depends in how it is being used.
I'm just not keen on labelling a class 'base', I would prefer it to have a name that hints at its responsibility.
Admin
At least it's a data file and not a web service request. I've had to send requests to a service that only defines <shipment>, <shipment2>, and <shipment3> as part of the schema.
The real WTF is that they also offer a parameter string version, which allows 6 different shipments to be sent at once. Never mind that "shipments" are actually the kind of things shipping, and not the shipment itself.
Admin
TRWFT is that he didn't use JSON.
Seriously- who uses XML anymore?
Admin
OK, so I'm a bit XML-stupid... talk to me like I was 5-year-old, or a 1st-year CS student (same mental acuity, no?). Would the right way to do this would be more like this?
I mean, obviously you can't write a schema when every tag is different, right? So if you do what I did above, how do you get a count out of it? I took an XML course a few years back, but not a lot sunk in =-)
Admin
Admin
It seems that one of my prior co-workers actually invented that. Plagiarist!
Admin
Where I work, we'd be efficient and reduce all that needless complexity to just a single line of XML!
Admin
No, it's more like when there's a double yellow line...
Admin
Oh, that brings back memories... I remember trying to write a XSLT to transform AutoREALM (a mapping tool for pen & paper roleplaying games) into SVG, just for fun. Luckily, I saw, AutoREALM had been extended from a binary format (pascal data-types, ugh) to include a native XML representation. I tried starting by writing a DTD to get a feel for things. Or so I thought...
CAPTCHA: ingenium
Admin
Admin
Admin
What's wrong with this? Now if only there were a way to add something like C++ templates to XML ...
[ducks large objects thrown at me]
Admin
Any extra time is not a problem, since usually most of the time is spent thinking about the schema / data, and I don't see how a tool will speed up, except for distracting me from my real job. If speed is an issue for something, I would just make an app which can spit out the XML I need.
This is even true for small / repeatable changes: using copy and paste in a text editor is much faster than starting up the beast of an XML editor, waiting until it is finally done creating its fancy diagrams, and wrestling your way through its GUI (gooey).
Admin
Personally, I'd just write a small perl script to do it ...
Admin
The "X" in XML stands for eXtensible, so you can do it yourself. I would be very interested in a monstrous^H^H^H^H^H^H^H^H^Henterprisey hybrid of XSLT and XML Schema. Sounds very fascinating ;)
p.s. the real WTF is that BBCode doesn't support [s]strikethrough[/s]
Admin
What if you delete, say, address 2? How will you know not to look for it? And how do you know when you've reached the end of an address?
Admin
The REAL WTF is that he started counting with 1, instead of zero. Everyone knows arrays are indexed starting with zero.