What's the best example of pure show-off code you've seen?
Posted
by Damovisa
on Stack Overflow
See other posts from Stack Overflow
or by Damovisa
Published on 2010-05-21T06:44:31Z
Indexed on
2010/05/21
6:50 UTC
Read the original article
Hit count: 296
Let's face it, programmers can be show-offs. I've seen a lot of code that was only done a particular way to prove how smart the person who wrote it was.
What's the best example of pure show-off code you've seen (or been responsible for) in your time?
For me, it'd have to be the guy who wrote FizzBuzz in one line on a whiteboard during a programming interview. Not really that impressive in the scheme of things, but completely unnecessary and pure, "look-what-I-can-do".
I've lost the original code, but I think it was something like this (linebreaks for readability):
Enumerable.Range(1,100).ToList().ForEach(
n => Console.WriteLine(
(n%3==0) ? (n%5==0) ? "FizzBuzz" : "Fizz" : (n%5==0) ? "Buzz" : n
)
);
© Stack Overflow or respective owner