As simple as possible, but no simpler
Let your code tell its own story
Localize complexity
Generalization takes three examples
Work backward from your result, not forward from your code
The first lesson of optimization is don't optimize
A good name is the best documentation
Bugs are contagious
Eliminate failure cases
Code that isn't running doesn't work
Sometimes you just need to hammer the nails
"Sounds quite solid - as guidelines. My only rule for programming is, that the result is correct and usable.
https://www.goodreads.com/book/show/39996759-a-philosophy-of...
https://web.stanford.edu/~ouster/cgi-bin/book.php
which has seen a fair bit of discussion here:
https://news.ycombinator.com/item?id=17779953
https://news.ycombinator.com/item?id=31248641
https://news.ycombinator.com/item?id=37975558
https://news.ycombinator.com/item?id=17906662
and there's a video:
https://www.youtube.com/watch?v=bmSAYlu0NcY
(which has also been discussed)
I read it when I got stuck on a recent project, and paused after each chapter to review _all_ of the code (fortunately, it's a fairly small project) and to apply the principles from that chapter to the code, and it was a big help and got me over the hurdle to a working version.
bool in_range = begin<=idx && idx<end;
if( in_range )
{
do_something();
}