|
|
|
|
|
by preseinger
1516 days ago
|
|
Cognitive load is unrelated to SLoC. This expression let a = x.iter().filter(...).apply(...).map(...);
is equally or even potentially _more_ cognitively complex than this expression for _, v := range x {
if !filter(v) {
continue
}
vv := apply(v, ...)
vm := map(vv, ...)
...
}
|
|
consider it from a blocks-of-code metric, or some better slightly more abstract metric, that isn't affect by simple things like whitespace transformations, and try assuming that we all understand that we should write code that isn't monstrous to begin with.