DEV Community

Discussion on: Keeping your code clean by sweeping out "if" statements

Collapse
 
apostolou profile image
Peter

What a brilliant discussion ☺️! I go around a lot of large companies and organisations and work with the developer teams. the one thing that really disappoints and alarms me is how much code is written in such a way that it is not obvious how it does what it does. Yes, of course code should be written to do what is supposed to do and do it well! However remember the phrase 'Old code never dies it just gets maintained over and over....' (or something like that). How many times I meet developers who's job it is to maintain and update code written by some one who has long gone from the organisation! Code HAS to be readable first and foremost, this article helps to understand that.
I also think that using enumeration or possibly inheritance is a great way around problems like this ☺️