Live data from Hacker News

The worst program I ever worked on

jacquesmattheij.com

51–60 of 136 posts

Re: The worst program I ever worked on

#51
post #41

I met the guy who wrote this bit that I had to maintain: for(a=0;a What really pissed me off was that he was such a nice guy. He still works a lot. Makes a lot of money. And his customers love him. (No, I don't think they review his code.)

At least that code is indented properly..

Much of the code that I need to fix seems to be written by people who learned on day one of programming that "whitespace doesn't matter to a computer" and never looked back.

Re: The worst program I ever worked on

#52
post #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.

The typography is off. The body text is written in Arial, which is not a great choice for body text (it's better for display). When in doubt, use Verdana (sans-serif) or Georgia (serif) for body text. Also, the font size is too small.

Here is an example of his blog with better typography. I used 18px Georgia as the body text instead of 12px Arial. I used Droid Sans (a nice display font) for the blog title.

http://i.imgur.com/jhjJA.png

Re: The worst program I ever worked on

#53
post #28

I think the best way to guarantee job security is to solve hard problems for the company you work for, and make it visible (i.e., communicate about it). This will gain respect from your peers and give you a reputation of being useful and very worthy keeping around. Writing some kind of obfuscated code is shooting yourself in the foot - after a while not even you can maintain it. Plus, your peers will notice and proba…

Not a pleasant story, but true...

I used to work at a place where one of the guys wrote a horribly complicated piece of code that about half of the system depended on. He was also quite an unpleasant man who routinely mocked everyone else in the company for not being as clever as he was.

The company ran out of money and needed to halve its workforce - one of my friends overheard him boasting that there was no way that they could get rid of him, as no-one understood what he had written.

I was asked about his code - I said no-one but him could maintain it, but give me three months and I could rewrite it.

I don't like to revel in other's misfortunes but the look on his face as he left the office on the day of the redundancies was a picture.

In the end I kept half of his code (ring-fenced so it was effectively a black box that no-one touched) and rewrote the rest in about a month.

Personally, I work hard, make it visible (as Luyt says), own up to my failures and every now and then go beyond the call of duty. And I try very hard to be nice to people, even when they're acting like idiots.

Re: The worst program I ever worked on

#54

The legacy system that I'm working on now has about 20-30 distinct classes/data types that it needs to manage and persist to the database. The previous developer chose to implement all of these different data structures in one uber-table named 'object' and in the application code with one uber-class named 'Thing'. Relationships between 'Things', regardless of meaning or type, are simply dumped into a 'relationship' t…

One of my favorite accessor method names I've run across is 'maybeGetCube()'.

The idea was that if it was cached, then it would return the cube, otherwise null. Cube was actually relatively aptly named, it was a big matrix of data BTW.

I guess really it wasn't THAT horrible, but the whole idea of 'maybe' doing something in code has always made me chuckle.

Re: The worst program I ever worked on

#55
post #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.

I was thinking the exact same thing

Re: The worst program I ever worked on

#56
One of my former classmates names everything he can get his hands on after various obscure anime references-- database names, variables, servers, you name it. Once in a blue moon, I'd recognize a function name as being a character or item from one of the few animes I'd seen and after a bit of tortured logic based on the background it almost seemed like a reasonable choice.

Needless to say, he does better working on his own.

Re: The worst program I ever worked on

#57
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…

To really bork up the Java, you need a pattern fanatic. Once you stand working with Handler Adapter Handlers you know you should have taken the other colour pill.

That stuff has its place. But it's needed less commonly than it's used.

Re: The worst program I ever worked on

#58
post #34
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…

I work with a guy, long time ago, who would take code already split into functions and refactor it into one big function. I am not joking here, actually happened.

I've seen that too. I don't think it was intentional -- the programmer simply didn't understand what the existing code structure was for, and "defactored" it.

Re: The worst program I ever worked on

#59

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…

Yeah, it didn't save this guy from getting fired and it only made life harder on a another guy who he's never met. The whole "stick it to the man" mentality is childish and its shameful that this strategy is so common in software development.

Re: The worst program I ever worked on

#60
post #41

I met the guy who wrote this bit that I had to maintain: for(a=0;a What really pissed me off was that he was such a nice guy. He still works a lot. Makes a lot of money. And his customers love him. (No, I don't think they review his code.)

Unless there is a lot of creative abuse of operator overloading or macros lurking in there that code really doesn't look too awful compared to some monstrosities I've had to work with.
Post reply on HN