Friday, October 06, 2006

WTF

It's easy to prove what rules vs what sucks using Google. So using the new Code Search it's also easy to find out which language is most likely to produce the word "fuck" is in the code - the ultimate test of how good a language is (or how well things are going).
So here it is (higher the better):
  • C++ ~835,000 files / ~2000 fucks = 41.75.
  • Java ~766,000 files / ~500 fucks = 1532.
  • Ruby ~254 files / ~60 fucks = 4.2.
  • Perl ~186,000 files / ~400 fucks = 465.
  • PHP ~195,000 files / ~2000 fucks = 97.5.
  • Lisp ~400 files / ~100 fucks = 4.
  • Scheme ~400 files / ~50 fucks = 8.

2 comments:

Paula said...

Hmmm, interesting idea, but it's also a measure of the type of code that is likely to be released on the net, and the type of programmer using that language.

Professional code may be quite different. (It probably has a higher incidence, unless code reviews are common in the organisation). :-) Also, J2EE encourages the corporate type these days (ie. a programmer in a suit is more likely to be using Java than Scheme).

Incidentally, Erlang scores ~100/3 = 33. Not too bad, I think that might be a little low, given that "3" is not statistically significant.

Steve Dunham said...

Counting the number of files containing the word "fuck" may favor languages that encourage you to break your program down into many small files. I think Fucks / kloc would be a fairer measure (although arguably not perfect, since some languages are denser).

Maybe someone at Google can run a map/reduce to calculate both metrics precisely. :)