I find all these arguments on different code patterns funny. Mostly because everyone ignores two things: cost and context.

Thread.
Every decision has a cost. We're usually aware of this for big architectural decisions, but we often forget that even the small ones, like what to name a variable.
Extract it into a function? Cost: too many functions could make following the code hard.
Inline it and add a comment? Cost: comment could become stale, too many lines of code in the function could be harder to follow.
Use a descriptive variable name? Cost: variable names could get too long and lead to a lot of horizontal scrolling.
Use a cryptic variable name? Cost: may not be as descriptive.
Extract this into a separate file or class? Cost: it might be harder to locate.
Keep it here? Cost: too much code might make this file difficult to navigate.
Use TypeScript? Cost: generics and complex types could add a lot of overhead in reading the code.
Stick with JS? Cost: less type safety.
Then there's context. Context is usually what determines which costs you're willing to bear. And context could be determined by a lot of things, from the target audience, to how much money is available, to how the developer is currently feeling.
Note that even with the same set of circumstances, for different people, the context can differ.

Examples of context: I'm building a JS library for other developers, and I want them to have robust autocomplete. I'll decide to pick the cost of using TypeScript.
Make your technical decisions, guys. But be aware of the cost. And let your context guide you.
(This is why sometimes I just reply people with "No" rather than arguing. I'm familiar with the cost, and only me has my context. No point persuading others.)
The sad part is when people haven't acknowledged the costs of both sides. Rather they turn it into "X is bad; Y is good". In my short career, I've adopted a lot of philosophies that I thought were "the answer", until I began to see their shortcomings.
Nowadays I still have flawed opinions. The difference is that I'm aware of their costs, and I've compared them against the alternatives and decided to pick that.

Keep this in mind when espousing an opinion over another.☝️ Have you thought of its downsides?
You can follow @theshalvah.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: