Live data from Hacker News

What happens when you search 'ugly hack' in GitHub

github.com

11–20 of 69 posts

Re: What happens when you search 'ugly hack' in GitHub

#11
post #4

I'd be curious to see if there's a relationship between 'ugly hack' in code commits and the languages being used (though it'd probably say more about the programmer than the language). The bar chart on the left of the page hints that it's possible, but would have to be normalised. My hypothesis is there'd be no real difference, but it would be fun to explore nonetheless.

I would think the left bar would remain accurate. C lets you shoot yourself and people do it. PHP is terrible for a lot of well documented reasons. Javascript is being used for things it originally never envisioned.

The hyped dynamic languages sort of surprise me, with their modern APIs. I'm guessing most of that is poor framework programing.

Finally, Java's numbers? lol. Its a brave new world. If this was 8 years ago in ejb v1.2 Java world have taken the crown.

Re: What happens when you search 'ugly hack' in GitHub

#13
post #9

It looks like ugly hacks are far more popular than clever ones. https://github.com/search?q=clever+hack&type=Code&ref=search...

Look for dirty hacks; still... C way ahead the rest. Interesting that "ugly" places PHP over Javascript, but "dirty" is the other way around. I wonder what does it mean. The comments and the "ugly" or "dirty" qualifiers are just part of the perception of the person writing the comment, and they're contributing to spread that perception to others. What qualifies as "ugly", "dirty" and "clever", or even as "hack", may…

Yeah, I don't think "ugly hack" or any other variants is frequent in bash script comments.

Re: What happens when you search 'ugly hack' in GitHub

#17
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 :)

Re: What happens when you search 'ugly hack' in GitHub

#19

Haha: https://www.dropbox.com/s/j7rwshax2e9zwln/Screenshot%202014-... Not even PHP can come within a factor of 5 of C when it comes to ugly hacks. EDIT: And its not exactly like there is a bias at work: http://goo.gl/ZezFiP

But is it because C programmers make more ugly hacks or that C programmers are more likely to know when they are making an ugly hack?

Re: What happens when you search 'ugly hack' in GitHub

#20
Pretty interesting/amusing to see the language breakdown of various words (with big grains of salt):

https://github.com/search?q=beautiful&type=Code

https://github.com/search?q=ugly&type=Code

https://github.com/search?q=lol&type=Code

https://github.com/search?q=wtf&type=Code

Post reply on HN