4 ms·
1) Some languages have tail call optimization and sometimes recursion is the clearest way to express an idea. 2) Requiring a fixed upper bound when iterating a
by closeparen 10y ago
1) Some languages have tail call optimization and sometimes recursion is the clearest way to express an idea.
2) Requiring a fixed upper bound when iterating a collection of objects is a direct contradiction of the ZOI rule[0]. Most programs should not place arbitrary boundaries on the number of objects they'll operate on. This is better adapted to systems with relatively fixed databases and a predictably low volume of operator and sensor input (i.e. flight management computers, train control systems) more than internet services.
7) "For this reason, most coding guidelines for safety critical software also forbid the use of all ansi standard headers like string.h, stdlib.h, stdio.h" should speak for itself.
9) Is pretty C/C++ specific.
[0] https://en.wikipedia.org/wiki/Zero_one_infinity_rule https://en.wikipedia.org/wiki/Zero_one_infinity_rule
- pjc50 10y ago> Most programs should not place arbitrary boundaries on the number of objects they'll operate on I think this can be argued both ways. The classic stateless pipe programs, sure, they can take as many lines as you want. User-facing programs? It can be worth imposing fairly small limits just so you don't have to worry about pathological behavior and security risks. (What happens if someone pastes a million lines of text into a small box, etc)