Fog Creek Software
Discussion Board




Hack Hack Hack

Bored while waiting for a long compile, I did a search for the word "hack" in the source code of my company's primary software system.  I found 24 comments that indicated a piece of code was a "hack".  The following are the real, unaaltered comments.

Two of them were "documented hacks" which we apparently can "ask Paul" about.  One was a "Hack-Hack-Hack" (the author had a cough?).  One was an "ugly hack" and another was a "real _ugly_ hack".  One class has "most of the elegance … hacked out for the moment".  Five of the hacks are "temporary" (since 9/28/99).  One class is marked as a hack with the warning "don't use it!".  Finally, there is even a "disgusting hack … to support the wrongful behavior of others".

Of course, these are just the hacks that were actually commented...

anonymous
Monday, May 19, 2003

Isn't there a comment in UNIX (or is that Linux, or both :)) saying something something like "You are not supposed to understand this"

In my Visual C++ programs, I usually just put line 1 of stdafx.h
// everything that includes this file - safe to assume - part of the one big ugly hack
It saves time as compared to commenting (admitting to?) all the hacks individually :-)

S. Tanna
Monday, May 19, 2003

The first initial of "Paul's" last name wouldn't happen to be the letter 'T' would it?

Hack Contributor
Monday, May 19, 2003

I'm slowly removing unnecessary C++ 'goto' statements from a Big Ball of Mud.  Since the original 'programmers' used the same label name everywhere (!), I clarify things by renaming the one I'm currently working on to 'IncompetentHacksConsideredHarmful'.  I guess I'm easily amused...

Spaghetti Rustler
Monday, May 19, 2003

Re: "You're not supposed to understand this":

I seem to remember there being a discussion of this famous comment, along with a defense of well considered 'goto' usage on one of Dennis Ritchie's pages, probably at AT&T.

Something also about certain values of theta giving rise to DOOM or something.

John Aitken
Monday, May 19, 2003

Guilty.

I have several well commented "This is a hack. If you are reading this, you are bored and have the time to fix this" pieces of code buried in substantial systems. It's always been a last minute requirement that comes out of left field and just doesn't fit into the way the objects talk to each other in a pretty way.

Our job is DOING. Doing right is nice and preferable, but it's not always possible when there is lots of DOING to be done. What is it the guy on this site says, "Smart, and GET'S THINGS DONE"...

Matt
Monday, May 19, 2003

http://cm.bell-labs.com/cm/cs/who/dmr/odd.html

sven
Monday, May 19, 2003

From "Tha Jargon File"

You are not expected to understand this: [Unix] cav. The canonical comment describing something magic or too complicated to bother explaining properly. From an infamous comment in the context-switching code of the V6 Unix kernel. Dennis Ritchie has explained this in detail (http://cm.bell-labs.com/cm/cs/who/dmr/odd.html).

BTW, I always comment mine as kluges, not hacks.

old-timer
Tuesday, May 20, 2003

Question to the original poster:  Are these hacks written up in your bug-tracker?  If not, why not?

Brent P. Newhall
Wednesday, May 21, 2003


If the hack works, can you really consider it a bug?

Joe AA
Thursday, May 22, 2003

> Question to the original poster:  Are these hacks written
> up in your bug-tracker?  If not, why not?

No, but I bet your bugs are written up in your hacks.

www.marktaw.com
Friday, May 23, 2003

*  Recent Topics

*  Fog Creek Home