Explicit and consistent

… is probably better than elegant and tricky. When writing software, we are often tempted to reduce typing, insert a little magic, and be clever. However, any time we can reduce inconsistencies or variations in our data or APIs, we are much better off long term, even if it means a little more typing, more initial work, or storing more data. Why? Because with tricky you need to deal with it over and over again. You never know quite what you are dealing with. A little special case now turns out to be 100’s of special cases over the lifecycle of a product. And what looked simple or clean in an API or editor may be hard to maintain and extend later. When in doubt, opt for big-picture/long-term simplicity and maintainability. And often this means explicit APIs, constraints, and consistent data.

(recently considered this tradeoff in Simple IoT)

i agree. One should write code thinking it is to be read by humans not by machines.

1 Like