Sean Hoffman
Sep 22, 2021

--

I could not disagree more. Code is read many more times than is written, and if by some chance you're on vacation and someone else needs to maintain your code, I'd much rather look at the switch statement than the alternative presented.

I live by the mantra of I don't want to know how smart you are; I want to know what your code does. The later or more urgent a production issue is, the more clarity I want when examining code.

--

--

Sean Hoffman
Sean Hoffman

Written by Sean Hoffman

Software Developer (C++, C#, Go, others), Husband, Father. I eat fried potatoes annually on July 14th.

Responses (1)