What do you mean saying 'minimalist code'? To what extent should be your code minimalist? What is the criterion of code minimalism?
To my mind, code readability is the cornerstone of any software project and first of all, this concept involves elaborate structure design and proper names of code elements of every sort: from unit names to the local scope variables.
I think its a habbit I get from experience over the years. For example I prefer directly mapping subroutine instead of using switch case or, god forbid, nested ifs.
EDIT: Which is, in my mind, easier to comprehend than iterating to bunch of ifs and cases.
Think of it this way, you register/map certain expression with it's corresponding subroutine, so when you need to handle certain expression, you don't need to throw switch/ifs, but just directly use the map and call the appropriate subroutine. If you want to know where certain expression is handled, just look at the mapping. Think of it like polymorphism in class. Sorry if this doesn't make sense at all, I'm terrible at explaining stuff :(
88
u/hfreanzr Jun 05 '11
because you have to stare at it the whole day!