4 ms·
In my view, aiming for simplicity is good, but only simplicity of the whole system, and superficial simplicity is often at odds with total simplicity. The foll
by GrantMoyer 2y ago
In my view, aiming for simplicity is good, but only simplicity of the whole system, and superficial simplicity is often at odds with total simplicity.
The following code is composed from a small set of simple operations,
transformed = []
for (i = 0; i < len(list); i = i + 1)
{
el = list[i]
temp = transform(el)
transformed.append(temp)
}
but together the simple operations form a complex operation. The effect of each individual line is immediately clear, but the effect of the whole procedure is (marginally, in this toy example) obscured. However, If we extend our small set of simple operations with complex but common operations, we can express complex operations with conciceness that, overall, makes them simpler to recognize and reason about:
transformed = list.map(transform)
The effect of the line now requires more background knowledge, but in return the effect of the entire procedure becomes more readily apparent.