Live data from Hacker News

What happens when you search 'ugly hack' in GitHub

github.com

51–60 of 69 posts

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

#51
post #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 peo…

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

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

#53

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?

I think PHP is more or less just for the web, giving C programmers more ugly hack surface overall.

Also PHP itself is an ugly hack of C anyway.

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

#55
post #37

Some results normalized by overall language popularity. Specifically, the entry in row R and column C is 1000 * (hits for C in language R) / (hits for "the" in language R) or "---" if either the numerator or denominator was small enough not to make the top-10 list on github. All the scraping was done by hand and the numbers rounded to a limited number of places in the process, so there may very well be mistakes. [EDI…

There is a namespace in C++ called WTF, which probably accounts for a skew in that column.

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

#56
post #37

Some results normalized by overall language popularity. Specifically, the entry in row R and column C is 1000 * (hits for C in language R) / (hits for "the" in language R) or "---" if either the numerator or denominator was small enough not to make the top-10 list on github. All the scraping was done by hand and the numbers rounded to a limited number of places in the process, so there may very well be mistakes. [EDI…

Could .py have the greatest number of "ugly hacks" because the community's standards for explicit, "beautiful" designs is higher? This would be shown if languages like Go have a much higher prevalence for "ugly hack" than a language like Perl. (Where even core language features, ahem you can complete the thought.)

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

#59
post #47
post #37

Some results normalized by overall language popularity. Specifically, the entry in row R and column C is 1000 * (hits for C in language R) / (hits for "the" in language R) or "---" if either the numerator or denominator was small enough not to make the top-10 list on github. All the scraping was done by hand and the numbers rounded to a limited number of places in the process, so there may very well be mistakes. [EDI…

I read your table and immediately jumped to a different conclusion: That python programmers are more sensitive to ugly hacks and more likely to call them out. Not saying I'm right, but I don't know that the data can distinguish the hypotheses.

I immediately felt the same and left a comment. But what would distinguish it is if "Go" had a high proportion of such comments, where "Perl" would have a low one.

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

#60
post #7
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'd be curious to see if there's a relationship between 'ugly hack' in code commits and the languages being used Perl is not in their list. Either everything we do is an ugly hack, or everything we do is simple and elegant. :)

Or... nobody writes in Perl anymore... or... every Perl developer is a seasoned Perl developer.
Post reply on HN