Re:John Carmack on Inlined Code (2014)
by ctrlrsf on Tuesday July 19, 2016 @09:13AM
(#12121509)
Long functions might read easier but you lose some testing precision. I think recent focus on testing has lead to shorter functions with as little responsibility as possible. When short functions fail a test you have smaller surface area to look for the cause.
[ Parent
| on HN ]
Doesn’t this imply the need for a new language feature? So that well-defined sections of inline code can be pulled out, initial conditions set in a testing environment, and then executed independently.
I guess this could trip up if the compiler optimisations available when considering all the code at once means that the out-of-context code actually does something different in testing...
Pull out well-defined sections of inline code that can be executed independently for testing? Sure, that's breaking it down into functions.
Re:John Carmack on Inlined Code (2014)
by MereInterest on Tuesday July 19, 2016 @12:30PM
(#12122686)
I think there is such a feature. In most languages, these are called "functions".
Re:John Carmack on Inlined Code (2014)
by virtualized on Tuesday July 19, 2016 @10:18AM
(#12121904)
Game developers don't test, they debug. That's why he draws wrong conclusions like "inline everything manually".