| « Prev | Page 1 | Page 2 | Page 3 | Next » |
|
So their database is an ASCII text file?
Run, Forest, run! |
|
1st?
|
Re: What Could Be Easier Than XML?
2009-06-22 09:06
•
by
blabla
(unregistered)
|
|
ehm, not really :)
|
Re: What Could Be Easier Than XML?
2009-06-22 09:07
•
by
Calm Mint
(unregistered)
|
|
This type of WTF is so common we need a new name for it.
Since "XML" stands for Extensible Markup Language, let us consider what's going on here. First, it is not a Language, because they are parsing column positions as if it were an old-school COBOL record. Second, it is not Markup, because the markup is being completely ignored. And most obviously it is not Extensible. So after we cross out the things it's not, we're left with "---". Kinda like C++, but headed in the opposite direction. Or maybe "XXX", as in, children under 18 should not be allowed to see this stuff lest it permanently traumatize and scar their impressionable minds. |
|
It's an "optimization." Much faster to read by data position than to parse.
|
|
From: JT Klopcic
To: HR It has become necessary to contact the programmer that is responsible for project xyz. Due to the nature of this project it is imperative that I have his home address as opposed to merely a phone number or an email. On a separate note, I'd like to ask whether it would be ok if I borrowed a knife from the kitchen. Thank you |
Re: What Could Be Easier Than XML?
2009-06-22 09:17
•
by
Ouch!
(unregistered)
|
<schadenfreude> And I don't even participate in the frost pist game:D </schadenfreude> |
Re: What Could Be Easier Than XML?
2009-06-22 09:20
•
by
i_am_socket
(unregistered)
|
|
That's some double-plus-wtf?!
|
|
Oh, no - the horror. I got about half way through, then realised what was going on.
The worst thing? I did this once. Then I realised, ripped it up and reimplemented it using XML DOM. |
Re: What Could Be Easier Than XML?
2009-06-22 09:26
•
by
JayC
(unregistered)
|
Nonextensible Markup Language, obviously |
Re: What Could Be Easier Than XML?
2009-06-22 09:27
•
by
y0da
(unregistered)
|
man "root of all evil" ( http://pplab.snu.ac.kr/courses/adv_pl05/papers/p261-knuth.pdf ) |
|
It's not even a WTF. It's an FTW. Fire-That-Wannabe.
|
Re: What Could Be Easier Than XML?
2009-06-22 09:28
•
by
Major Math
(unregistered)
|
And since the cost of the 13 trillion CPU cycles he saved will be eaten up in the first 10 seconds of developer time fixing this, the "optimization" is rated F for classic Fail. |
Re: What Could Be Easier Than XML?
2009-06-22 09:30
•
by
Satanicpuppy
|
Depending on the sort of system that is being used, the data may actually be STORED by data position. Old school databases used to do it that way, where the "record" would have a length of say, 500 characters. And field_1 would be 0->10, field_2 would be 11->16, etc. |
Re: What Could Be Easier Than XML?
2009-06-22 09:30
•
by
JayC
(unregistered)
|
I err...replied to the wrong message, obviously. |
Re: What Could Be Easier Than XML?
2009-06-22 09:38
•
by
Major Math
(unregistered)
|
Maybe you missed the article:
|
Re: What Could Be Easier Than XML?
2009-06-22 09:39
•
by
Kermos
|
Using a non-extensible comment system, obviously. |
|
Re: What Could Be Easier Than XML?
2009-06-22 09:45
•
by
snoofle
|
Let's focus on what's important: bring back the Irish Girl, obviously! |
Re: What Could Be Easier Than XML?
2009-06-22 09:46
•
by
Code Dependent
|
oHeader.FixWTF = Convert.ToDouble(m_Textline.IndexOf("WTF???", 0, 6)); |
Re: What Could Be Easier Than XML?
2009-06-22 09:47
•
by
Code Dependent
|
Nonsensical Markup Language |
Re: What Could Be Easier Than XML?
2009-06-22 09:47
•
by
MRAB
(unregistered)
|
So it's a Non-extensible Non-markup Non-language? That's "NNN". |
Re: What Could Be Easier Than XML?
2009-06-22 09:50
•
by
fw
(unregistered)
|
W*nker more like |
Re: What Could Be Easier Than XML?
2009-06-22 09:56
•
by
Brady Kelly
(unregistered)
|
It's the display of doubt that cost him/her first place. |
|
Hahahaha... I love the name on those methods! fixABC? WTF? Uh! And method function names that start with a caps, great!
|
Re: What Could Be Easier Than XML?
2009-06-22 09:59
•
by
Brady Kelly
(unregistered)
|
Now there's an award worthy observation. |
|
Well, at least it doesn't look like it'd be too hard to replace it with something that uses the XML classes provided by the .NET library.
|
Re: What Could Be Easier Than XML?
2009-06-22 10:02
•
by
Anon
(unregistered)
|
Yes, that's the standard in .NET. This is not Java. |
Re: What Could Be Easier Than XML?
2009-06-22 10:02
•
by
AdT
(unregistered)
|
|
And then their precious database was destroyed by xmllint --format...
What about "ughstensibility"? |
Re: What Could Be Easier Than XML?
2009-06-22 10:16
•
by
Code Dependent
|
...or "ecchstensibility"... |
Re: What Could Be Easier Than XML?
2009-06-22 10:38
•
by
@Deprecated
(unregistered)
|
|
The REAL WTF is that the coder checks to see if line 2 was properly read, but line one is magically assigned to m_Textline somehow.
Yes, that is far worse than reading columns from an XML file... Oh never mind. |
Re: What Could Be Easier Than XML?
2009-06-22 10:54
•
by
SR
(unregistered)
|
:oD Yikes! |
|
I worked with a programmer that did not want to learn how to use a csv library or an xml library, far easier to write code like this. He was the senior programmer in the area.
Oh yes and he wrote code like this: for( int i = 0; array[i] != 0x20 ) { word[i] = array[i]; } |
Re: What Could Be Easier Than XML?
2009-06-22 11:16
•
by
Anon
(unregistered)
|
I noticed that too. Presumably, it's a member variable and is assigned as side effect of: FindHeaderString(_sr); Notice also that the coder doesn't check to see if it's null after FindHeaderString (which would be possible if the file was completely empty), nor do they check the lengths of the strings before trying substring. |
|
This brings back nightmares from my last contract at a large bank. Their inhouse "dsl" was XML based. Sounds good I thought until I got back string out of bounds exceptions etc. Turns out their "parser" was written pretty much like this.
When I asked why they didn't use a proper XML parser, they looked at me like I was from space, their architects has said that this was much faster and more efficient. Why not just use a csv file, guess that wouldn't have been cutting edge enough lol |
Re: What Could Be Easier Than XML?
2009-06-22 11:34
•
by
Zer0
(unregistered)
|
100% WIN. I need to save this as a template, would save me a lot of time. |
Re: What Could Be Easier Than XML?
2009-06-22 11:35
•
by
Anonymous Coward
(unregistered)
|
|
Quite clearly, this method is reading Positions Of Stream, hence POS. Or perhaps POS Of Stream, for a recursive acronym.
|
Re: What Could Be Easier Than XML?
2009-06-22 11:47
•
by
kastein
|
He had something against loop variable incrementing? |
Re: What Could Be Easier Than XML?
2009-06-22 12:00
•
by
OzPeter
|
WTF? who did you think you were going to offend by leaving out the "a"? And given a choice of 5 potential vowels to insert, how stupid do you think people have to be to not find the correct vowel? |
Re: What Could Be Easier Than XML?
2009-06-22 12:00
•
by
AdT
(unregistered)
|
It's overused anyway. ;) I used to write code like this: for (pInput = pInputBuffer, pOutput = pOutputBuffer, szRemainingBytes = szBytesToCopy; until a University tutor pointed out that for loops were invented to make code more readable. |
Re: What Could Be Easier Than XML?
2009-06-22 12:03
•
by
configurator
(unregistered)
|
No, he just likes infinite loops better. |
Re: What Could Be Easier Than XML?
2009-06-22 12:05
•
by
Code Dependent
|
Willy Wanker and the chocol... erm... uh... eewww, nevermind. |
Re: What Could Be Easier Than XML?
2009-06-22 12:06
•
by
AnotherAnonymous
(unregistered)
|
|
I nominate "insensibility".
|
Re: What Could Be Easier Than XML?
2009-06-22 12:08
•
by
Charles Babbage
(unregistered)
|
|
Winker?
|
Re: What Could Be Easier Than XML?
2009-06-22 12:15
•
by
Anon
(unregistered)
|
Um, regex much? A '*' matches the preceding character zero or more times. Maybe something like [aeiou] would match your 5 vowel constraint requirement. |
Re: What Could Be Easier Than XML?
2009-06-22 12:20
•
by
erat
(unregistered)
|
I did those things to my tutors just to see how badly they could fail me sometimes. ;) Most of the time I just got a chuckle and a pat on the shoulder. But one of them almost turned white, and then bright red and I seriously thought he'd pop an eye or something when he saw it. :) then I showed him my serious code. I think he kindof had it in for me from that point. ;) Code was sacred to him. Best teacher I ever had though. |
|
That's not XML data... that's data with an XML overhead! Those "tags" are just comments, lol
|
Re: What Could Be Easier Than XML?
2009-06-22 12:30
•
by
lolwtf
|
|
"<comment>WTF!?</comment>".substr(9, 5)
I'm sure he meant winker. Someone who winks. |
Re: What Could Be Easier Than XML?
2009-06-22 12:46
•
by
RogerC
|
Do you have something against memcpy? |
Re: What Could Be Easier Than XML?
2009-06-22 13:07
•
by
Thief^
|
Especially as memcpy is normally optimized to copy in chunks (e.g. 4 bytes) wherever possible. Though a really good optimiser would be able to replace byte-by-byte copies with a memcpy call. |
| « Prev | Page 1 | Page 2 | Page 3 | Next » |