What happens when you search 'ugly hack' in GitHub
github.com
github.com
All of this is expressed in just two words :)
(Edited for clarity.)
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.
[1]: http://tvtropes.org/pmwiki/pmwiki.php/Main/LampshadeHanging
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.
[EDIT: oops, initially I failed to paste in the actual data.]
ugly hack ugly beautiful lol wtf buggy
xml --- --- 14.330 72.775 2.489 ---
c 6.348 35.421 0.670 0.768 3.650 32.009
html 1.359 9.001 34.791 4.233 3.095 5.870
rb --- --- --- 4.483 3.151 ---
py 9.051 35.614 28.506 --- 11.135 15.066
php 3.731 8.333 1.781 39.037 1.792 3.754
c++ 2.851 12.507 --- 0.501 102.657 7.579
js 6.850 16.826 2.643 2.635 7.406 29.761
Tentative conclusions: Python is ugly-hack-iest and (almost exactly tied with C) ugliest; HTML is most beautiful with Python a close second, XML is lolliest, C++ is WTFiest, and C is buggiest.Tentative meta-conclusion: these numbers have no value beyond idle amusement. But they idly amused me, so that's OK.
(The weirdest result of the lot, to me, is XML coming top for "lol". If you do the search and click on "XML" on the left you'll see why it is. Lots of instances of what I think are the same file, full of "&lol;" entities. LOL, that's pretty ugly. WTF? An ugly hack, I guess.)
My intuition tells me that if your alternative hypothesis were true, then php programmers have higher standards because they ajudge more code 'ugly and C++ programmers are universally perfectionists...or at least when they are not confused which it appears they usually are.
Just for fun with hypothesizing, does Python's near 50/50 split between 'ugly and 'beautiful suggest a large degree of random use? Or more interestingly, does it suggest there is a tendency to classify middle cases as extreme cases, and is this a result of the community having 'a Pythonic Way?'
https://github.com/search?q=beautiful&type=Code
https://github.com/search?q=ugly&type=Code
[1] Of course I don't mean you, my dear PHP writing comment reader.
https://github.com/search?q=todo&type=Code&ref=searchresults
My hypothesis is there'd be no real difference, but it would be fun to explore nonetheless.
Perl is not in their list.
Either everything we do is an ugly hack, or everything we do is simple and elegant. :)
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.
https://github.com/search?l=c&p=7&q=never+happen&ref=searchr...
[0]: https://github.com/search?l=python&q=ugly+hack&ref=cmdform&t...
https://github.com/search?q=clever+hack&type=Code&ref=search...
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 be quite different depending on the language and the community behind it.
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
Also PHP itself is an ugly hack of C anyway.
https://github.com/search?p=1&q=if+&ref=searchresults&type=C...
https://github.com/search?p=1&q=return+&ref=searchresults&ty...
Now to figure out how old these are.
https://github.com/search?q=ugly+duck&type=Code&ref=searchre...
(That said, I love its fruits.)
https://github.com/search?q=temporary+hack&type=Code&ref=sea...
As one obviously only writes extremely elegant code, it is important to notify the programmer coming after that you were forced to write it this way.