Live data from Hacker News

The worst program I ever worked on

jacquesmattheij.com

11–20 of 136 posts

Re: The worst program I ever worked on

#11
I worked with a guy (I won't name the company) who wrote Java code in one, huge, static class as much as possible. In fact, everything was largely in one function too.

He decided to name his fields alphabetically.

static int a

static int b

static String c

static float d

static int e...

What, I wondered, would happen when he ran out of letters? Scrolling down further I saw this:

static int aa

static float ab

static String ac

static int ad...

Re: The worst program I ever worked on

#13
post #11

I worked with a guy (I won't name the company) who wrote Java code in one, huge, static class as much as possible. In fact, everything was largely in one function too. He decided to name his fields alphabetically. static int a static int b static String c static float d static int e... What, I wondered, would happen when he ran out of letters? Scrolling down further I saw this: static int aa static float ab static St…

Sounds like he got his start programming spreadsheets.

Re: The worst program I ever worked on

#14

A project I worked at during an internship had an unmanaged C++ portion for rendering complex typography, which was written when every letter in a variable cost $10 (or so it seems). The result was that "pointer to a metadata character" became the variable "pmc", and that was just the beginning of it. I never quite did understand what the variable lpmnoics meant, and debugging the C++ was quite the drag and the task…

lpmoics

a long pointer to a meta object in cthulhu studies...

... see also Hungarian notation as implemented by Miskatonic University

Re: The worst program I ever worked on

#15

Call me Captain Obvious, but I feel like quite often the time spent in obfuscating code in many cases might be a major component of why programmers that do this sort of thing get fired in the first place. What goes on in someone's mind that says: "Maybe if I spend some time making my source code hard to understand I can better preserve my job." ? In reality all it does is slow them down, waste their time and lead to…

While this is true, there's a lot of space in between a model developer and a purposely-obfuscating twit. There's definitely a line that lazy developers can walk where they contribute just enough to make firing them more of a pain than putting up with them. I suppose the lesson for businesses is: be very careful about who you hire in the first place, because you may end up stuck with the person whether you like it or not.

Re: The worst program I ever worked on

#16
post #10

One semester I was TA'ing a certain course all electrical and computer engineering students are required to take. One student named all his variables in phonetic chinese (using the utf8 character set of course). Another student named all his variables after superheros.

For the Chinese guy, I wonder if the code would have been way easy to maintain for the average Chinese developer. That would be an interesting analysis.

Re: The worst program I ever worked on

#17

I've watched enough "programmers at play" and read enough code to happily believe that this guy was just letting his sense of humor have its day. I'm not at all convinced that things like this are deliberate obfuscation. Of course, I'm not the one who had to disentangle it all. We've all read bad code with bad names that nonetheless "works" (except perhaps for the occasional minor glitch). This is perhaps just one th…

I agree. Tomato and Pizza aren't any less silly than Foo, Baz and Bar, and certainly much less offensive than Fubar...

... It's not just programmers that do this either, also network admins name their computers R2D2 and C3PO, Shodan, Skynet etc.

Re: The worst program I ever worked on

#19

Back in the day, I was an RPG programmer (on an AS/400), and I had a co-worker who insisted upon using geographical labels for all of his GOTO targets: GOTO BARCELONA, GOTO TOKYO, etc. Needless to say, maintaining his code took some getting used to.

That sounds kind of funny. Where do you go on error?

One time I had to debug this incredibly obfuscated Word Basic subroutine. It was such a mess of gotos (deliberately so) that the company that wrote it for us thought they had us over a barrel and could charge us like a wounded bull.

That is, until I showed my cow-orkers the superior technology of "paper, scissors and sticky tape".

Re: The worst program I ever worked on

#20
This is off topic but I find it difficult to read the blog-articles from jaquesmattheij.com . Zooming doesn't help because the text doesn't wrap correctly. Just a suggestion for the author to change the layout of the page.
Post reply on HN