by jandrese · 5y ago · 0 comments
> When we identify and document one, that should not be the end of the story. Rather, we should have the long-term goal of trying to understand how to improve the language so that the pattern becomes invisible or unnecessary.
I'm not sure I agree with this thesis. The idea that you should make common patterns part of the base language is how you end up with bloated languages with a huge number of constructs that make code hard to read. There is a virtue in keeping things simple, even if it means more boilerplate in the code. Obviously this requires balance, you can go too far in either direction, but languages that try to include the kitchen sink do seem to have more trouble gaining popularity.
The semantics of the pattern/idiom will be there anyway, whether there's a language-implemented feature or a "userland" repeated code-pattern.
And the latter are often more sprawling, which has its own readability issues.
What he calls formal patterns, aren't those a sort of language in itself, one in which the coders talk to each other? Almost like comments.
You recognize the pattern, when you browse the code and think. "Aha, yes, so, there we go, uhm, okay…" and so on.