Thursday, December 9, 2010

Pet Peeve... Sloppy Text-parsing.

The last half-decade (why can't it just be a pentade, neologically speaking; and is neologically also a neologism?) has seen a quantum leap in dynamic text generation. I will, for the moment, table the discussion about internationalization, rosetta, and the phenomenally good work Google is doing with translation by using list-processing and anecdotal data gathering to make transliterations more comprehensible. The point is that there are all these little phrases that are being generated by back-end scripts explaining, for example, that you upload(s) is(are) complete and you can now edit the description(s) by following this(these) link(s), etc, etc.
Obviously this gets into massive case-statements, which, if they are good, are making good use of indexed and correlated database tables to be able to handle not a dozen, but an essentially infinite number of possibilities for the conditions that determine the correct suffix for a word, or the verb-form that applies to the state of an action, among other things. In a word, object-oriented.
However, every programmer in the breech, particularly when it involves working for large organizations where the time to get something done right can be entirely steam-rolled by the necessities of marketing plans and product management, will be sorely tempted to write 'the prototype' - a hand-coded case that handles all the currently known cases but is not exponentially scalable, because come tomorrow morning's agile scrum, she'll be a lot more comfortable saying: "It's gone to QA. Check!"
So, in deference to the programmers that make these faux-pas, and understanding that it's not their inability to do better, but the pressures of programming as a business, here are a couple of examples of the things I'd rather get right first-time-out on a blown schedule and never have to shore-up in a desperate frenzy just before the dog & pony for funders:

eBay, Inc. - They are one of the anchor-stores of the internet, no doubt. They get the job done exceptionally well, but things do slip through the cracks. Here is a little gem I caught a couple of months back:

Note that on the 5th line, it says "that ending on May yadda yadda". Let's just say that I think I could do better, but not every day. Obviously, there is a time-window for things treated in the immediate future, which say "ending", and those evets that are past, or "ended". Obviously as well, the programmer who put the "that" in did not coordinate very well with the programmer that made the break between "ending" and "ended" - it could have been the same person - it was obviously 2 different tasks, and they don't match up correctly because the code is sprayed with imperfectly duplicate logic. Nonetheless, this is highly visible, and just the sort of thing that makes QA people pull their hair out, because, I'm certain, it does not crop up if you just write a short little test-script that runs through just the use-cases QA was handed, yet it has high enough visibility that it got caught, at least here.

On a similar note, here's a little YouTube cuteness - if you wrote this bit of code, I bet it's a case that slipped through your fingers because you were afraid that spending too much time on the problem might cause you a backlog and redistribution of your queue - sort of like a lawyer worrying about whether their client was guilty or not - just no time to wory about such things if you hope to ever make 'partner':
The 23th? Really?

And for those among you who have the privilege of administering hosted accounts on one of the many hosts that use cPanel as their administrative interface, ever log on? What the hell is this:
...if WHAT does not automatically WHAT? - q.e.d.

No comments:

Post a Comment