Live data from Hacker News

The worst program I ever worked on

jacquesmattheij.com

131–136 of 136 posts

Re: The worst program I ever worked on

#131
post #86

You really don't know bad programming until you have spent some time in a 50000 line cobol program. I'd post some crap I work on every day but I don't want to make anyone cry. Nevermind. Here's some random code I'm working on. MOVE SPACES TO LISTBAT-NAME. STRING WORK-FILES "LIST.BAT" DELIMITED BY " " INTO LISTBAT-NAME. OPEN OUTPUT LISTBAT. MOVE SPACES TO SCR-S. STRING "DIR /B " DATA-PREFIX " > " WORK-FILES "TMPLIST"…

Note to self: do not learn COBOL.

You know, I once had that rule for myself. And I would state it loudly.

My first consulting gig involved writing some moderately large royalty accounting programs in RPG-III for a System 34. One day, the engineer from the vendor stopped by and plopped cobol onto the system.

Suddenly, COBOL didn't seem all that bad, and i broke my rule.

Yes, there are some things worse than COBOL, and I hope you never have to deal with them.

Re: The worst program I ever worked on

#132

The only place where the names made any immediate sense was 'main' and any C stdlib calls. Any job worth doing is worth doing right. Contrariwise, any job worth fucking up is worth fucking up stupendously. He didn't go all the way. #define monkeymeat printf #define turtlescrotum malloc #define wolfnipplechips gets #define chipotlaway exit ...

  #define wolfnipplechips gets
If you wanted to fuck it up proper, you should leave out this line. You don't want to dampen the horror people will have when they see you actually using gets.

Re: The worst program I ever worked on

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

I find your sample harder to read. Reading the current line I easily get distracted by the next, either because it's too close or too bold.

Thing is it's mostly subjective, so YMMV.

Re: The worst program I ever worked on

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

Yes. I've even heard people justify their haphazard, random formatting by parroting the old "the compiler doesn't care about formatting" line they heard from the instructor at the technical college on the first day of their language course.

If the compiler was the only other entity with which you're collaborating on a project, fine. But in the real world other humans have to read your garbage.

Re: The worst program I ever worked on

#136
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 ...

Those guys are too smart. When you start to write programs that are too big to understand as one lump, you start to learn to decompose your code and organize it in ways that help you understand it a little bit at a time. They never do that; they just keep the whole program in their head at one time. Tell them that a function should do one "simple" thing that makes sense as a unit, and they have no problem putting the whole program in that function.

Actually, I shouldn't say they are too smart, because they will continue to program like that even when it causes them problems....

Post reply on HN