Hacker News new | past | comments | ask | show | jobs | submit login

I love the term 'ugly hack'. It's a very short way of saying 'a solution for a problem that assumes too much of the current context in which this component is called, and is guaranteed to break when the context changes'. It also implies 'this is intended to be temporary because I don't feel like doing the proper solution at this moment' which is accompanied with the intent 'we should fix this later' although most people who write it also have the wisdom that that almost never happens.

All of this is expressed in just two words :)




When I write it it usually means I know it sucks, but I'm reasonably happy with it - but if someone catches me out on it it's ok because I already criticised it myself


Excellently put. It's like lampshading[1], for code.

[1]: http://tvtropes.org/pmwiki/pmwiki.php/Main/LampshadeHanging


In my experience “ugly hack” means any technical debt that spans lines of code, as opposed to components of a system.

(Edited for clarity.)


It's actually too general. What I mean with component here can be anything from a line of code to a class hierarchy.

In a sense, using the word 'component' here was an ugly hack. I should have gone for the proper solution and properly define it. You see now that it breaks down when the interpretation changes.


I guess I understand. I objected because I felt you were assuming too much of some context in your definition of “ugly hack” :) I can't imagine using the term “ugly hack” to describe some unfortunate high-level architectural decision.


It's a worthy practice indeed. Bowing to the virtue of taking on some technical debt instead of deluding oneself that all code must be Pristine.


Sometimes, instead of "I don't feel like doing the proper solution," it's "I haven't yet figured out the proper solution," or "A cleaner solution means adding 250 lines of code to address problems we may not have."


'Ugly hack' is an ugly hack of 'kludge'.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: