logoalt Hacker News

Arainach06/16/20254 repliesview on HN

Cursing adds nothing to the code. "// Stupid fucking hack" is worse than "stupid hack" (more characters while conveying no extra information) and much worse than "work around Lotus 123 leap year calculation bug"


Replies

bryanrasmussen06/16/2025

//hack = I have found a way around the problem that was probably necessary to use and could even be arguably clever under the circumstances where a hack is required Example: When I suggested using data uri as source of iframe to get around domain security restrictions in FF and still allow you to click on links and scroll in iframe which using about: uri scheme did not (long story involving national security and identity platforms)

//stupid hack = somewhat ugly thing I am doing to somewhat solve problem because I am perhaps not clever enough to think my way to solution at this time. Example - when I set the center of the map to be a couple decimal points of latitude off from where the address actually was because the designer wanted the address to be not in the center of the map, because then it would be covered by the search box, but slightly above the search box. Stupid because I bet there was another way to do it, also stupid because it was not exact and so we did not know exactly where the address was going to be drawn in relation to the search box, but we knew pretty closely where and that was good enough.

//stupid fucking hack = ugly thing I am doing that must be done to get around problems even though as well as being ugly it is also less than optimal in multiple ways, requirement for this hack caused by third party who have screwed us over by their very existence which makes me incredibly angry Example: put span around any text node inside of an element rendered by React using a Ref to get around the Google translate bug and similar problems.

show 1 reply
koverstreet06/16/2025

There's degrees of hackyness. Tone and emphasis are important parst of clear and effective communication.

Something that's a mere "hack" might be something I don't mind, but worth being aware of and revisiting if and when the code becomes more complicated and has to do more things.

A "stupid fucking hack" indicates something that could have only come about by a whole chain of stupidity and mistakes, inflicting brain damage that we're now stuck with, to great anguish and misery.

Those things are important to highlight, if only as lessons in what not to do.

show 2 replies
nilamo06/16/2025

Similarly, "stupid hack" adds nothing that just "hack" doesn't say. And in that case, why have a comment at all? The code is likely obviously hacky.

At least I can have a laugh while looking at the hack someone came up with...

show 1 reply
cool_beanz06/16/2025

Adds some humanity and soul to it.