DEV Community


Discussion on: Write better code and be a better programmer by NEVER USING ELSE statements

jwp profile image
John Peters

And in 2005 this article affirmed what you are saying using the Visitor pattern.

dglsparsons profile image
Douglas Parsons Author

Hey, that's an interesting article. Thanks for sharing that.

Personally, I'm not convinced inheritance (and arguably over-abstraction) provides more readable code - but there is definitely something to be said for reframing the problem to remove any special cases.