top | item 6704846

The Six Most Common Species Of Code

25 points| prateekj | 12 years ago |willa.me | reply

10 comments

order
[+] mtdewcmu|12 years ago|reply
I like the large-company version with baroque OO/Java appendages hanging off of everything. Those flourishes make it feel safer and more reassuring, I guess.

The math PhD one seemed possibly unfair. It looked more like something that would come from a CS PhD who did his thesis in PL.

It's hard to judge what the right solution would look like. You could go many careers without ever having a real reason to write that function outside of an interview. Fibonacci numbers occasionally come about as a by-product of doing something interesting and useful; in cases where they would be interesting in and of themselves, you would probably be using a library or language, like Mathematica, that would have that built-in.

[+] prateekj|12 years ago|reply
Although the large-company version looks overwhelming to an onlooker, it actually starts from a simple version and then keeps growing as more bugs and compatibility issues are reported. Hilarious though!
[+] xux|12 years ago|reply
"//good enough for the demo, lol"

Killed it. This is hilarious.

[+] prateekj|12 years ago|reply
Totally! The large company version is hilarious too.
[+] jfasi|12 years ago|reply
Don't forget the tests of each. The startup's tests are all commented out because they failed at some point or another, the large company's tests are five times as long as the actual code they test, and all other categories consist of the stubs provided by the IDE.
[+] Buge|12 years ago|reply
The math PH.D takes a double parameter for b in exponentiate, but the way it functions actually only works for ints.
[+] oakwhiz|12 years ago|reply
The Math PhD one reminds me of the sorts of symbolic algebra systems that you find in Haskell and Scala.
[+] vezzy-fnord|12 years ago|reply
I feel sorry for that Math Ph.D. writing in Java.