3 ms·
I think having code be proportional to 'complexity' is good, but having it be proportional to 'work' makes no sense. Personally I find things 'simple' when they
by contravariant 9y ago
I think having code be proportional to 'complexity' is good, but having it be proportional to 'work' makes no sense. Personally I find things 'simple' when they only require one level of abstraction, such as accessing an object, or performing arithmetic operations on algebraic objects (e.g. multiplying matrices). And complex when they require more (e.g. manipulating the coefficients of two matrices to define their matrix product).
Boilerplate is when you requires more code than the complexity requires, usually because the language doesn't provide a sufficient opportunity for abstraction.
Note that, if we define a '->' operator that roughly expands to the following:
(x, err) -> f :
if (err != nil) {
return nil, err
}
return f(x);
Then the entire code he wrote as an example of boilerplate can be written as
DoSomething -> SomethingElse -> MoreWork;
with some minor differences that could be optimized away in the right language.