DEV Community

Discussion on: Is “Defensive Programming” actually healthy?

Collapse
 
cyberhck profile image
Nishchal Gautam

I generally avoid using else, in this case I'd have used switch and on default I'd have thrown an error. But never approach is better, I like your implementation