What is a hack?

0 votes
asked Aug 19, 2010 by kevin-won

I use the term all the time... but I was just sort of thinking that I don't really have a solid denotational sense behind the term (or at least the term in the sense I want to discuss here). I'm interested in the sense of the word related to code, not the anthropomorphic idea. I'm also not interested here in the sense of the word related to intentional malicious computing (i.e. a hack to unlock secret powers in a game). What I want to explore is what it means to 'hack' in terms of writing software to solve a problem

wikipedia's def of 'hack' to me is a bit vague, but a decent starting point. It considers a hack

  • can refer to a solution or method which functions correctly but which is "ugly" in its concepion
  • works outside the accepted structures and norms of the environment
  • is not easily extendable or maintainable
  • can be slang for "copy", "imitation" or "rip-off."

These traits of a hack conform to my usage of the word--when applied to code it is always a term of derision. To my mind, a hack

  • Is likely to be difficult to maintain & hard to understand in the context of the rest of the code.
  • Is likely to cause failure of the app.
  • tends to indicate a poor understanding by the coder either of the problem space, usage of the language or both
  • tends to be the byproduct of aggressive schedules
  • suggests potential changes in requirements that have not been fully incorporated into the architecture of the solution (requiring an 'inorganic' workaround).
  • smells

all bad, bad, bad. To me, a hack in this sense is always negative, indicating either lack of time, incompetence, or sloth on the part of the developer, though a decent percentage of hacks must be written to compensate for ill-conceived designs or systems that have gained requirements which their original design cannot handle 'organically'.

I don't think I've really captured it totally though--it's like pornography a bit: I can't really define it, but I know it when I see it. So I ask you: what does it mean to 'hack' when you are trying to solve a problem in software?

7 Answers

0 votes
answered Aug 19, 2010 by brian-willis

I've always preferred Paul Graham's definition:

To add to the confusion, the noun "hack" also has two senses. It can be either a compliment or an insult. It's called a hack when you do something in an ugly way. But when you do something so clever that you somehow beat the system, that's also called a hack. The word is used more often in the former than the latter sense, probably because ugly solutions are more common than brilliant ones.

0 votes
answered Aug 19, 2010 by brian

When I think of "hack", I think of it as being a non-expected workaround to solve a problem, not necessarily a bad thing. Creative, innovative, and well-placed. "Hack" can apply to more than just computers, though I seldom hear it used that way.

0 votes
answered Aug 19, 2010 by martin-ongtangco

This topic will turn into something like a question about Love. Everyone's gonna have their own definition. The best way to know the proper (default) definition is in the dictionary

0 votes
answered Aug 20, 2010 by jon-hanna

It's when you've stepped out of the idiomatic, natural, sensible and (sometimes) supported ways of doing something in a given language/framework/etc.

Sometimes that's a stroke of genius, usually it's an act of idiocy, occasionally it's one disguised as the other, and on rare occasions it's both.

(Incidentally, the judge who coined that statement about pornography you quote later retracted in making another ruling).

0 votes
answered Aug 20, 2010 by polygenelubricants

From the Jargon File, the glossary of hacker slang:

The Meaning of ‘Hack’

“The word hack doesn't really have 69 different meanings”, according to MIT hacker Phil Agre. “In fact, hack has only one meaning, an extremely subtle and profound one which defies articulation. Which connotation is implied by a given use of the word depends in similarly profound ways on the context. Similar remarks apply to a couple of other hacker words, most notably random.”

Hacking might be characterized as ‘an appropriate application of ingenuity’. Whether the result is a quick-and-dirty patchwork job or a carefully crafted work of art, you have to admire the cleverness that went into it.

An important secondary meaning of hack is ‘a creative practical joke’. This kind of hack is easier to explain to non-hackers than the programming kind.

0 votes
answered Aug 20, 2010 by david-hoerster

When I use the term 'hack' it usually refers to a solution to a problem that was done usually in response to a pressing issue, and so not a lot of thought went into it in regards to the overall design of the application. Sometimes it works out, sometimes not so much, and sometimes it turns out to be a work of genius. But mainly, it's an admitted temporary solution that (hopefully) gets refactored and refined when possible.

0 votes
answered Aug 31, 2010 by robusto

Too often "hack" simply means: "Not the way I would do it."

Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter

...