Sunday, 28 May 2017

Anti-if League

Problem

People using too many if-s in a single piece of code, resulting in convoluted logic that is difficult for most humans to trace.

https://cirillocompany.de/pages/anti-if-campaign

Solution:

What can you do about IFs?

https://code.joejag.com/2016/anti-if-the-missing-patterns.html

Use polymorphism if applicable.
Break it down into functions. Ideally, every function should only descend one level of abstraction. Following this, one can get extremely reusable code, although this does mean a lot more typing, initially.

Analysis

Software code is a form of written communication for humans, as much as it is for computers.

Paying attention to these small details makes a massive difference in the face of any code beyond 100 lines.

You cannot really develop reliable software without this.

What to do differently

People who are able to understand why they need to pay attention to these details and then automatically execute based on these principles are invaluable to any team, at least in the programmer/developer role.

Intended outcome

Now trying to get my team to join it!

No comments: