What's the best example of pure show-off code you've seen?
- by Damovisa
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
)
);