Programming is the art of trade-off
No matter what programming language you are using, one common suggestion you all probably hear is that:
Don’t use switch statements
Besides people usually forgetting to add the break statement, the more profound reason is that developers often avoid using special cases in their code. Instead, they prefer to use more flexible and powerful constructs such as polymorphism or dictionaries.
I heard lots of experienced developers say that they view their code as art. It’s not hard to understand since they spend hours or even days working on a particular piece of code. Therefore they view their code as a reflection of their personal style and aesthetic preferences, much like artists who create works of art.
However, this pursuit of elegant, well-designed code can sometimes lead to a disregard for special case handling. It's easy to get carried away with the desire to create perfect code, but this obsession can sometimes blind developers from seeing the real problems they are trying to solve. In other words, this fixation on perfect code can be like a stain on white paper, obscuring the bigger picture.