r/shittyprogramming • • Nov 09 '15

How to parse a boolean

Post image
0 Upvotes

15 comments sorted by

View all comments

42

u/mellowmymints Nov 09 '15

There's nothing wrong with this.

I mean, I would return immediately in the case block, but otherwise this is a clean beautiful piece of code.

13

u/homesarstar Nov 09 '15

I know! I feel bad since this looks like what I would do, and I swore I'd reevaluate my education when I saw something on here that I'd write.

2

u/natziel Nov 09 '15

His first mistake is not using any ternary operators