On Tuesday, 25 October 2016 at 22:53:54 UTC, Walter Bright wrote:
It's a small bit, but the idea here is to eliminate if
conditionals where possible:
https://medium.com/@bartobri/applying-the-linus-tarvolds-good-taste-coding-requirement-99749f37684a#.nhth1eo4e
This is something we could all do better at. Making code a
straight path makes it easier to reason about and test.
Eliminating loops is something D adds, and goes even further to
making code a straight line.
One thing I've been trying to do lately when working with DMD
is to separate code that gathers information from code that
performs an action. (The former can then be made pure.) My code
traditionally has it all interleaved together.
I'd like to point to Joel Spolsky excellent article "Five Worlds"
- http://www.joelonsoftware.com/articles/FiveWorlds.html
TL;DR: Joel Spolsky argues that different types("worlds") of
developments require different qualities and different
priorities, both from the code and the process. Because of that,
advice given by experts of one world does not necessary apply to
other worlds, even if the expert is really smart and experienced
and even if the advice was learned with great pain.
Linus Torvald is undoubtedly smart and experienced, but he
belongs to the world of low-level kernels and filesystems code.
Just because such code would be considered "tasteless" there
doesn't mean it's tasteless everywhere.