Defaulting to Zero · Our Machinery | Niklas Gray | Archived 1 Jul 2017
(web.archive.org)
from ericjmorey@programming.dev to programming@programming.dev on 07 May 2024 14:46
https://programming.dev/post/13760590
from ericjmorey@programming.dev to programming@programming.dev on 07 May 2024 14:46
https://programming.dev/post/13760590
Niklas Gray writes:
I often find that when I work on the low level implementation of something I discover ideas that I can bring back and use to inform the high level design — to make it easier to work with, more performant, more orthogonal, etc. Thus, the flow goes back and forth from high-level to low-level, instead of just in one direction. If I’m stuck in some part of the high-level design, starting to work on the implementation is often the best way to get unstuck.
One such idea, which is really simple, but tends to lead to better and simpler code, is the idea of defaulting to zero. I.e. to always use 0 as the default or nil value. For example…
Read Defaulting to Zero
#programming
threaded - newest