- 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
'###FIRST-start###'."\n".'###FIRST-end###'
Admin
Been there, done that --- On top of the "Strategic issues", that code [implementation is a nightmare.... Did someone forget the third leg of TDD????
Admin
He could have written regular xml and replace <>s with ###s in the resulting xml string. No one would have noticed.
Admin
After the first rejection, the only appropriate response is "Okay, do you have a spec, or at the very least a document detailing the format you want the email to be in? No? Okay, I'm not writing anything until I have one."
Easy.
Admin
Simple then. Generate XML using standard libraries and then do a string replace at the end
Admin
You would wait for the first rejection to say that?
Admin
Herbie should be happy that atleast they changed their mind so quickly. Typically various drastic changes and additional requirements appear long after the code has been written, tested and put into production...
Admin
That's just what I was coming here to say :D
Admin
I wonder whether this is deep legacy code which invented a txfer format way before xml was the merest twinkle in its parents' eyes.
Admin
"You would wait for the first rejection to say that?" - Yes, because the first time it was asked they just wanted an order confirmation. While you can have some sort of "marketing and communication" department supplying the text for that, lots of (mostly smaller) companies don't.
Admin
PHP on one side, VB on the other... what could possibly go wrong?
Admin
After I write the code to generate the human-readable format and get told that is was wrong, my reply would be, "Why did you not tell me that in the first place? I just did 3 hours of billable work for nothing. What is the file format we should generate then? If you don't know, put me in touch with the "Me" over there so we can work out all the details."
Admin
Yes, because if you let it go wrong first due to a bad request you can cite it as evidence that they're idiots and in the long term gain more authority to tell them no.
Admin
Also, sometimes the only way to get someone to tell you what is actually is that they want is to give them something they don't want first.
Admin
Extra layer of security by obfuscating xml.
Admin
PHP to the left of me, VB to the right, here I am stuck in the middle with MUMPS
Admin
"You just KNOW they were parsing this with nothing but regexes"
You just made me throw up in mouth a little bit.
Admin
IIRC standards like EDI (and its siblings X12, ODETTE, EDİFACT etc) existed before XML came along
Admin
I think you're right about that. I seem to remember XML was the fix-all for those things. Still waiting for the "fix" part ;)
Admin
"It was bad enough to generate it, but Herbie was glad he wasn’t responsible for parsing it."
So he never wrote any tests and has no idea if his code actually works?
Admin
Normally they try to shove XML onto things that shouldn't have it, rather than refusing it where it should in fact be used.
Admin
There's a slight chance that they were given some test cases. Otherwise you can usually check this sort of thing by hand quite easily.
Admin
There's a slight chance that they were given some test cases. Otherwise you can usually check this sort of thing by hand quite easily.
Admin
While tests of some kind are helpful, Herbie's not really in a position to write tests that will verify acceptance by a parser he has no access to, which processes a language that doesn't seem to be documented anywhere and was discovered by trial and error.
At the same time, Herbie's code exhibits the kind of brute-force string-banging that is the bane of my existence. Factor that noise.
Admin
Honestly, this post makes Herbie sound like a noob. When the boss says "send a notification to our automatic system", it goes without saying that the notification has to be in the system's own input format, not some random made-up XML schema. There generally isn't a mirror-Herbie waiting around to write the translation code.
Admin
That is actually double ended python, not XML and it's actually easier to write a parser for that. It's also more human readable too. More human and machine readable than XML (lack of escaping aside). It isn't particular portable but I would parse anything over XML.
Admin
My bad, I thought it was adding a hash on nesting. Still better than XML though. Anything is better than XML.
Admin
Nope, SGML, MIME and ASN.1 are all worse. ASN.1 and all the DER, CER, CRT shit spawned from it are particularly horrific, those are the binary formats used in certs. Generally, the whole x.500 standard is a nightmare of biblical proportions.
Admin
In a case like this can you just say 'ok well we don't support this custom format so we'll send it to you via XML and you can modify it to fit your custom format's requirements. I'm sure a dev team that writes a good custom format also can import industry standard formats such as XML and JSON, correct'?
Admin
The real WTF here is that "Herbie" wrote two iterations of the solution before bothering to find out what the requirements were. Frankly, the poor folks on the receiving end of his code have a better WTF to tell than "Herbie" does.
Admin
What, you have a 1.7.4.23.47.11.0815 with ASN.1?
Admin
My attitude would be "here's the data you want, in XML format". If you don't want XML, write an adaptor to turn it into whatever format you need.
Admin
I'm quite sure that he tested his work, but I do not think he had any access to the acutal parser (and he likely didn't want access, in order to preserver sanity).
Who knows what quirks the parser has?
For all we know there may be a special case buried somewhere where only the 2 outermost # characters are used for delimiters and the inner most pair is included in the actual data:
###mangled_tag### Data ###mangled_tag### results in the value '# Data #' being used in the application.... (and as already noted, they are likely using regexes for parsing, neatly discarding the 'extra' # characters on the outside....
Admin
I completely understand the first misunderstanding, because the RTWF is using e-mail for app-to-app communication. Don’t.
Admin
The worst part of ASN.1 (leaving aside the question of BER versus PER) is that it also infected SNMP, ILMI (which is essentially SNMP over AAL5 ATM frames), H.323, and many other things.
But PER is the worst. BER is just a binary TLV format - all the information to at least be able to extract the data values is in the encoded stream, even if you don't know what that "7" there means. PER deletes as much of that extra information as it can, on the assumption that anyone trying to read a particular piece of encoded data will know which data definition schematic thing to use.
Admin
Cute.
Yes, we have a spec. Here it is. Hands over sample CSV file.
Next month:
Here is our new data. Hands over CSV file in slightly different format.
Yes, this happened to me.
No, TPTB didn't allow me to tell them to bog off.
Admin
No need for that. Find and substring works fine.
Admin
See folks, this right here is your bad role model. The kind of punk who always assumes that his job is someone's job other than his.
Admin
Well it could be that, but I quite often find I've got a middle layer of (mis) management or three and semi-competent business analysts between me and the client/end-user. In my current humiliating whore-ing out of my skills, I don't even know who or what is consuming my data, so I'm reliant on being drip-fed the wrong requirements and "correcting" stuff when I'm told it didn't work (usually without any meaningful indication as to why).
They've usually written some misleading bullshit functional spec to get the thing signed off by the project board, so you get given that second, the first iteration being based on the misleading summary of it given by your line manager. Then you get some business analyst giving you their incorrect assessment of what's really needed. If you are lucky by the sixth or seventh iteration you get to talk to somebody at the other end of the chain who actually knows what they are doing and has some notion of what is needed.
Of course at the end of all this, you'll get something working which might or might not make enough people happy along this chain that they all reappear to claim the credit for "another one of my projects has successfully deployed ... who are you? so what was your input on this? Hmm, right, is that a plate of doughnuts over there?"
Admin
The only problem I can see here is not using stringbuilder.
Admin
Anyway, I sure hope Bobby Tables' little brother "###contact-person-end######mass-end######order-end###" isn't a customer of theirs.
Admin
so dope
Addendum 2024-05-21 01:37: Discovering an article featuring an extensive list of services dedicated to academic tasks and essay writing has been a game-changer for me. The curated compilation covers a wide array of tools and platforms https://www.clevescene.com/sponsored/the-best-essay-writing-service-2022-independent-review-39279903 that address various aspects of academic challenges. Whether one needs help with research, structuring an essay, or refining writing skills, the article offers a plethora of resources to explore
Addendum 2024-05-21 01:38: Discovering an article featuring an extensive list of services dedicated to academic tasks and essay writing has been a game-changer for me. The curated compilation covers a wide array of tools and platforms https://www.clevescene.com/sponsored/the-best-essay-writing-service-2022-independent-review-39279903 that address various aspects of academic challenges. Whether one needs help with research, structuring an essay, or refining writing skills, the article offers a plethora of resources to explore