DEV Community

Discussion on: If Statement Golf: what's the longest one you've seen?

Collapse
 
jsn1nj4 profile image
Elliot Derhay • Edited

I have something to admit: my entry isn't actually my code. It's just the code that gave me the idea for this post (although I'll also admit I've written a few bad-looking if statements myself).

I actually posted this because I figured it could possibly be a fun thing to see some crazy if statements (for those of us that aren't outraged by seeing the word if, anyway).

I'll also admit that coming up with writing ideas isn't something I'm terribly good at.

On that last note, thanks for 2 ideas in 1! (posts for motivation, and posts for sharing our own code that we need to learn from)

Edit: In your case, it's nice that you put everything inside of a function. That at least reduces clutter, and the function can be named something meaningful.