Re:Rules for Developing Safety-Critical Code (2006) [pdf]
by snagglegaggle on Friday October 18, 2019 @08:37PM
(#21296099)
Interesting to note that the description of how the flags and main loop works in practice makes the resulting program close to ladder logic,[0] still used in programming PLCs. Having used it the global state is annoying at first but does make the program easy to reason about.
The ladders inputs and outputs almost become like a set of invariants like you would find in a functional program, but the monad for state is implicit.
Re:Rules for Developing Safety-Critical Code (2006) [pdf]
by proverbialbunny on Friday October 18, 2019 @08:00PM
(#21295959)
Rule #6 increases readability. eg:
int foo;
// a page of code
foo = bar + 5;
// more code
vs // a page of code
int foo = bar + 5;
// more code
This keeps everything in one place. It's more readable and easy to follow.I feel like the topic of inlined code is similar but is not quite the same.
http://number-none.com/blow/john_carmack_on_inlined_code.htm...