Comment On What Could Be Easier Than XML?

JT Klopcic could not believe his eyes. It was supposed to be a simple assignment. The length of some data field was changing, so he needed to walk through the import process and make sure that all the associated data sizes would accommodate the new length. [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: What Could Be Easier Than XML?

2009-06-22 09:06 • by Ouch! (unregistered)
So their database is an ASCII text file?
Run, Forest, run!

Re: What Could Be Easier Than XML?

2009-06-22 09:06 • by blabla (unregistered)
1st?

Re: What Could Be Easier Than XML?

2009-06-22 09:06 • by blabla (unregistered)
270599 in reply to 270598
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.

Re: What Could Be Easier Than XML?

2009-06-22 09:09 • by Bri (unregistered)
It's an "optimization." Much faster to read by data position than to parse.

Re: What Could Be Easier Than XML?

2009-06-22 09:16 • by DOA
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)
270604 in reply to 270598
blabla:
1st?

<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?!

Re: What Could Be Easier Than XML?

2009-06-22 09:25 • by Cas (unregistered)
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)
270607 in reply to 270602
DOA:
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


Nonextensible Markup Language, obviously

Re: What Could Be Easier Than XML?

2009-06-22 09:27 • by y0da (unregistered)
270608 in reply to 270601
Bri:
It's an "optimization." Much faster to read by data position than to parse.


man "root of all evil" ( http://pplab.snu.ac.kr/courses/adv_pl05/papers/p261-knuth.pdf )

Re: What Could Be Easier Than XML?

2009-06-22 09:27 • by Dan (unregistered)
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)
270610 in reply to 270601
Bri:
It's an "optimization." Much faster to read by data position than to parse.

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
270611 in reply to 270601
Bri:
It's an "optimization." Much faster to read by data position than to parse.


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)
270612 in reply to 270607
JayC:
DOA:
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


Nonextensible Markup Language, obviously


I err...replied to the wrong message, obviously.

Re: What Could Be Easier Than XML?

2009-06-22 09:38 • by Major Math (unregistered)
270614 in reply to 270611
Satanicpuppy:
Bri:
It's an "optimization." Much faster to read by data position than to parse.


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.

Maybe you missed the article:
he took a look at the import file. Thankfully, it was all well-formed XML,

Re: What Could Be Easier Than XML?

2009-06-22 09:39 • by Kermos
270615 in reply to 270612
JayC:
JayC:
DOA:
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


Nonextensible Markup Language, obviously


I err...replied to the wrong message, obviously.


Using a non-extensible comment system, obviously.

Re: What Could Be Easier Than XML?

2009-06-22 09:44 • by snoofle

M E M O

Subject: The XML Parser
To: Development Staff
From: The Developer of the Parser
Effective: Forevermore

I have implemented a highly optimzed XML parser to read in
our XML-formatted data. Because of the optimizations, it is
absolutely imperative that you do not EVER run a formatter
on the data files!

Thank you for your cooperation.

Re: What Could Be Easier Than XML?

2009-06-22 09:45 • by snoofle
270617 in reply to 270615
Kermos:
JayC:
JayC:
DOA:
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

Let's focus on what's important: I miss the Irish Girl!


Nonextensible Markup Language, obviously


I err...replied to the wrong message, obviously.


Using a non-extensible comment system, obviously.

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
270619 in reply to 270605
i_am_socket:
That's some double-plus-wtf?!
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
270620 in reply to 270607
JayC:
Nonextensible Markup Language, obviously
Nonsensical Markup Language

Re: What Could Be Easier Than XML?

2009-06-22 09:47 • by MRAB (unregistered)
270621 in reply to 270600
Calm Mint:
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.


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)
270622 in reply to 270609
Dan:
It's not even a WTF. It's an FTW. Fire-That-Wannabe.


W*nker more like

Re: What Could Be Easier Than XML?

2009-06-22 09:56 • by Brady Kelly (unregistered)
270623 in reply to 270604
Ouch!:
blabla:
1st?

<schadenfreude>
And I don't even participate in the frost pist game:D
</schadenfreude>

It's the display of doubt that cost him/her first place.

Re: What Could Be Easier Than XML?

2009-06-22 09:57 • by ubersoldat
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)
270625 in reply to 270611
Satanicpuppy:
Bri:
It's an "optimization." Much faster to read by data position than to parse.


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.


Now there's an award worthy observation.

Re: What Could Be Easier Than XML?

2009-06-22 10:00 • by Anon (unregistered)
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)
270627 in reply to 270624
ubersoldat:
And method function names that start with a caps, great!


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)
270628 in reply to 270600
And then their precious database was destroyed by xmllint --format...

Calm Mint:
This type of WTF is so common we need a new name for it.


What about "ughstensibility"?

Re: What Could Be Easier Than XML?

2009-06-22 10:16 • by Code Dependent
270631 in reply to 270628
AdT:
And then their precious database was destroyed by xmllint --format...

Calm Mint:
This type of WTF is so common we need a new name for it.


What about "ughstensibility"?
...or "ecchstensibility"...

Re: What Could Be Easier Than XML?

2009-06-22 10:38 • by @Deprecated (unregistered)
270632 in reply to 270597
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)
270634 in reply to 270616
snoofle:

M E M O

Subject: The XML Parser
To: Development Staff
From: The Developer of the Parser
Effective: Forevermore

I have implemented a highly optimzed XML parser to read in
our XML-formatted data. Because of the optimizations, it is
absolutely imperative that you do not EVER run a formatter
on the data files!

Thank you for your cooperation.


:oD

Yikes!

Re: What Could Be Easier Than XML?

2009-06-22 11:05 • by Waratah (unregistered)
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)
270636 in reply to 270632
@Deprecated:
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.


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.

Re: What Could Be Easier Than XML?

2009-06-22 11:32 • by N (unregistered)
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)
270639 in reply to 270602
DOA:
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


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)
270640 in reply to 270621
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
270642 in reply to 270635
Waratah:
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];
}
He had something against loop variable incrementing?

Re: What Could Be Easier Than XML?

2009-06-22 12:00 • by OzPeter
270644 in reply to 270622
fw:
Dan:
It's not even a WTF. It's an FTW. Fire-That-Wannabe.


W*nker more like


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)
270645 in reply to 270642
kastein:
He had something against loop variable incrementing?


It's overused anyway. ;)

I used to write code like this:

for (pInput = pInputBuffer, pOutput = pOutputBuffer, szRemainingBytes = szBytesToCopy;

szRemainingBytes; *pOutput++ = *pInput++, --szRemainingBytes);


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)
270646 in reply to 270642
kastein:
Waratah:
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];
}
He had something against loop variable incrementing?

No, he just likes infinite loops better.

Re: What Could Be Easier Than XML?

2009-06-22 12:05 • by Code Dependent
270648 in reply to 270644
OzPeter:
fw:
Dan:
It's not even a WTF. It's an FTW. Fire-That-Wannabe.
W*nker more like
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?
Willy Wanker and the chocol... erm... uh... eewww, nevermind.

Re: What Could Be Easier Than XML?

2009-06-22 12:06 • by AnotherAnonymous (unregistered)
270649 in reply to 270631
I nominate "insensibility".

Re: What Could Be Easier Than XML?

2009-06-22 12:08 • by Charles Babbage (unregistered)
270651 in reply to 270644
Winker?

Re: What Could Be Easier Than XML?

2009-06-22 12:15 • by Anon (unregistered)
270658 in reply to 270644
OzPeter:
fw:
Dan:
It's not even a WTF. It's an FTW. Fire-That-Wannabe.


W*nker more like


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?


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)
270661 in reply to 270645
AdT:
kastein:
He had something against loop variable incrementing?


It's overused anyway. ;)

I used to write code like this:

for (pInput = pInputBuffer, pOutput = pOutputBuffer, szRemainingBytes = szBytesToCopy;

szRemainingBytes; *pOutput++ = *pInput++, --szRemainingBytes);


until a University tutor pointed out that for loops were invented to make code more readable.


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.

Re: What Could Be Easier Than XML?

2009-06-22 12:22 • by el_chavo (unregistered)
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
270665 in reply to 270644
"<comment>WTF!?</comment>".substr(9, 5)

OzPeter:
fw:
Dan:
It's not even a WTF. It's an FTW. Fire-That-Wannabe.


W*nker more like


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?
I'm sure he meant winker. Someone who winks.

Re: What Could Be Easier Than XML?

2009-06-22 12:46 • by RogerC
270669 in reply to 270645
AdT:
kastein:
He had something against loop variable incrementing?


It's overused anyway. ;)

I used to write code like this:

for (pInput = pInputBuffer, pOutput = pOutputBuffer, szRemainingBytes = szBytesToCopy;

szRemainingBytes; *pOutput++ = *pInput++, --szRemainingBytes);


until a University tutor pointed out that for loops were invented to make code more readable.

Do you have something against memcpy?

Re: What Could Be Easier Than XML?

2009-06-22 13:07 • by Thief^
270672 in reply to 270669
RogerC:
AdT:
kastein:
He had something against loop variable incrementing?


It's overused anyway. ;)

I used to write code like this:

for (pInput = pInputBuffer, pOutput = pOutputBuffer, szRemainingBytes = szBytesToCopy;

szRemainingBytes; *pOutput++ = *pInput++, --szRemainingBytes);


until a University tutor pointed out that for loops were invented to make code more readable.

Do you have something against memcpy?


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.
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment