Linus' idea of "good taste" code

Era Scarecrow via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 28 00:53:59 PDT 2016


On Tuesday, 25 October 2016 at 22:53:54 UTC, Walter Bright wrote:
> Eliminating loops is something D adds, and goes even further to 
> making code a straight line.

  A problem for myself and probably many programmers, is some of 
the tricks like what Linus did simply doesn't come to mind 
because it's not something we'd seen before so we can't model 
after it, and also that you sort of follow the same logic of how 
you'd resolve it because that's how you were taught to resolve it 
or it's how you know to resolve it.

  Often when I go for code I start with commenting the 
steps/breakdown, then I write each section, refactoring and 
cleaning up and shortening naturally are last, but once code is 
working it doesn't usually change too much even if there can be 
improvement.

  Hmm what we really need is something like a good 100 examples of 
good 'tasty' code, good code in a variety of code, something 
digestible and even explained down for those not following the 
full logic if how/why it works, perhaps even bad examples to work 
up from.


More information about the Digitalmars-d mailing list