3 ms·
The standard patterns that frequently emerge within languages are often low complexity special cases of potentially more powerful constructs and usage paradigms
by yarg 5y ago
The standard patterns that frequently emerge within languages are often low complexity special cases of potentially more powerful constructs and usage paradigms.
I might start with a simple for loop:
for(int i = 0; i < limit; i++){
...
}
And then decide that I can make it more concise:
for(int i: [0 .. limit]){
...
}
But I still need the base form, for less likely scenarios:
for(int i = 1; i < limit; i <<= 1){
...
}
A language or its libraries can support new cleaner forms for fundamental structures and frequently repeated boilerplate constructs - but it increases library/compiler complexity, cannot always be predicted ahead of time and often sacrifices power for specificity and apparent language simplicity.