Live data from Hacker News

The worst program I ever worked on

jacquesmattheij.com

111–120 of 136 posts

Re: The worst program I ever worked on

#111
post #39

I worked on a piece of code that literally drove the guy who wrote it round the bend. He had a mental breakdown, ran away, and eventually ended up in a different state ~3000 miles away. It wasn't so bad. Now debugging code written by Chemistry Students ... that's some scary stuff right there. Which is not to go all elitist and put Comp Sci degrees up on a pedestal, one of the better coders I've had the pleasure of wo…

You should try working with code written by hardware engineers. Those guys are extremely smart when it comes to digital and analog electronics, but never ever let them write a device driver ...

I did. Same job that drove the guy nuts.

Turns out most of the obscure errors were on the driver end. Go figure.

Arguably, at the exorbitant rate the company was paying these bozos to fix the problems with their own code (approx $200 per hour) there wasn't really much of an incentive for them to get it right the first time...

Re: The worst program I ever worked on

#112

Earlier quoted context omitted.

Honest question - how does code review work among "peers" with no seniority. Hypothetically speaking snicker say one peer likes to churn out reams of nonsense code and the other peer is looking forward to a sense of maintainability. Yes, I already know your first answer: "Switch jobs".

If he's simply green or ignorant then experience is the cure; a few good code reviews (yours and his) should transfer enough experience to make work less painful. If he's simply lazy or doesn't care... Well, all you can do is go through the pockets and look for loose change. No amount of "process" can make a bad employee into a good one.

Thank you - I appreciate the answer. I'm not sure I will be able to apply it however as my scenario is not quite as clear cut (although it's a little more of #2 than #1).

Re: The worst program I ever worked on

#113
post #61

code from a 150 line long method which is part of a 6000 line class. Obviously I can't post the actual code on here (but what it is doing isn't important in this context). private XXXXXXXXXXX XXXXXXXXXXX(final XXXXXXXXXXX[] XXXXXXXXXXX, final int XXXXXXXXXXX, final Long XXXXXXXXXXX, final Long XXXXXXXXXXX, final int XXXXXXXXXXX, final Long XXXXXXXXXXX, final XXXXXXXXXXX XXXXXXXXXXX, final int XXXXXXXXXXX, final int X…

For a second I thought you meant that all variable names were a varying number of X's, and I almost crapped myself.

I thought the same - if it weren't for your comment, I would still be laughing. Brilliant!

Re: The worst program I ever worked on

#114

Earlier quoted context omitted.

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.i…

I was under the impression that serif fonts were best left to headlines that are supposed to catch your attention, and that body text should always be a serif font - and that Arial is one of the better serif fonts if you use set the size to at least 14px and line-height to 150%.

You've got a lot of latitude when choosing a font for headlines. Both serif and sans serif work and you can get away with a fonts that have more "personality" than readability.

Body text, however, should be optimized for readability so your choices are more constrained. I don't think there is a huge difference in readability for serif vs. sans serif fonts for body copy. Ask a couple of designers and you'll get a couple of different opinions. Some will say that serif fonts are better because the serifs "lead the eye along". I'm not sure I buy that, but I do prefer serif fonts for body copy. But if you use a serif font, make sure it is big enough. At small sizes the serifs don't render well and get in the way of readability.

I've heard that Arial works better as a display font instead of a font for extended reading, which I tend to believe since it looks so much like Helvetica. If I choose a sans serif font for body copy, I choose Verdana which was specifically designed for the screen. But really, I don't think Arial is necessarily a bad font for body copy. I don't have any objective reason to say why you shouldn't use Arial.

Also, the header font and the body font should contrast, so if you have a serif header font it's usually good to have a sans serif body font and vice versa.

Re: The worst program I ever worked on

#115
I had an assignment for a security class where I did just this. We each had to write code to print the contents of a file with 600 permissions upon entry of the correct password. The source code, password file, and any logs were all readable by everyone; the next project was to obtain the contents of other students' secret files (using John the Ripper, exploiting race conditions, etc.). So I replaced all my identifiers with the most distracting words I could think of - superman, flashbang, lassie, sparkles, etc. If I recall correctly, only one person in the class even tried looking for vulnerabilities in my code.

Re: The worst program I ever worked on

#116

Earlier quoted context omitted.

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.i…

I was under the impression that serif fonts were best left to headlines that are supposed to catch your attention, and that body text should always be a serif font - and that Arial is one of the better serif fonts if you use set the size to at least 14px and line-height to 150%.

You are missing the word "sans" from that comment.

The general opinion used to be that serif was better for bodytext, and sans for title, and Arial is sans serif, but not one of the better ones.

Re: The worst program I ever worked on

#118
post #22

Earlier quoted context omitted.

You should try readability.com

But the fact that readability is suggested, suggests that the site isn't readable. That's a hint to the author that it needs to be looked at, which is what the grandparent comment says.

The author publicly stated he no longer comes to HN, so he won't see any comment here.

Re: The worst program I ever worked on

#119
post #25
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…

There was one networks class I took where the assignment was to implement a simple network protocol to do file transfers over a serial port. Computers in the lab were paired up and had their serial ports connected to one another. People were assigned to computers and given either the receiver or transmitter to implement. I was about done implementing the first draft of my side and asked the other side how it was goin…

That exact same thing happened to me, except that I was using a smaller error rate, and a Hamming(7,4) code for error correction.

After the ordeal was over, I looked at the code that the other guys had been writing. They hadn't started on the error detection and correction -- I'd heard much wailing and gnashing of teeth earlier about how mathematical it was -- and their code (all in one big main function, with no indentation) wouldn't compile. I watched as they spent about an hour randomly permuting it, to no avail.

I'm not sneering at these guys. I'm baffled by them.

Re: The worst program I ever worked on

#120
post #106
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.)

Is this equivalent? for(a=1; a Or do I need a nap?

In most languages, it is not guaranteed to do the same thing; the multiplication may overflow.
Post reply on HN