Applying the Linus Torvalds “Good Taste” Coding Requirement
I&#x27;m reminded of a quote from Moore in &quot;Thinking Forth&quot;:<p>&quot;A lot of conditionals arise from fuzzy thinking about the problem. In servo-control theory, a lot of people think that the algorithm for the servo ought to be different when the distance is great than when it is close. Far away, you’re in slew mode; closer to the target you’re in decelerate mode; very close you’re in hunt mode. You have to test how far you are to know which algorithm to apply.&quot;<p>&quot;I’ve worked out a non-linear servo-control algorithm that will handle full range. This approach eliminates the glitches at the transitioning points between one mode and the other. It eliminates the logic necessary to decide which algorithm to use. It eliminates your having to empirically determine the transition points. And of course, you have a much simpler program with one algorithm instead of three.&quot;<p>&quot;Instead of trying to get rid of conditionals, you’re best to question the underlying theory that led to the conditionals.&quot;<p>That&#x27;s part of a <i>chapter</i> of the book called Minimizing Control Structures. Forth guys are crazy about taste, and if I&#x27;ve learned anything from reading their stuff, it&#x27;s that chasing tasteful programming to its end gets very hard.<p>OP is right on the money. The hard thing is that it is a creative process, and takes a real understanding of the problem you&#x27;re solving to do it. Worst of all, aside from the feeling of solving a puzzle well, the benefits only begin appearing much later. I&#x27;m glad the kernel team takes it seriously.