You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some developers feel uncomfortable taking on dependencies for simple problems. For example making a POST request, or checking if a number is equal to -0.
Should you only use the language, browser APIs, and NodeJS core modules for simple problems, or is it perhaps better to take on dependencies?
The text was updated successfully, but these errors were encountered:
It's always better to take on well-abstracted dependencies, because if in fact it is easy to implement it yourself using "vanilla", it'll be easy to replace it later. In the reverse scenario, if you don't take on the dependency, you may later discover you're missing important pieces of the picture - and it will likely be much harder to replace your homegrown solution with a dependency later.
In the rare case where no dependency exists of sufficient capability or quality, you have two options: write one yourself and publish it, thereby enriching human society; or write a PR and improve whatever's out there already. Anything else is at best selfish, and at worst a disastrous decision.
All that said - there are plenty of things built into JS, into node, and into the browser, that work well, are reliable, and are easily polyfilled/shimmed. It is worth evaluating a dependency much more conservatively here, with an eye for readability, maintainability, cross-engine quirks and bugs, etc.
Pro-dependency zealots (who audit their dependencies to ensure well-abstracted/well-encapsulated APIs) can result in a codebase that's got an annoyingly high number of deps, but is likely easy to refactor back to having fewer.
Anti-dependency zealots (who reinvent everything with "vanilla" primitives) almost always result in a codebase that has little to no deps, but that is exceptionally difficult to refactor later to use a dependency when needed.
Some developers feel uncomfortable taking on dependencies for simple problems. For example making a POST request, or checking if a number is equal to
-0
.Should you only use the language, browser APIs, and NodeJS core modules for simple problems, or is it perhaps better to take on dependencies?
The text was updated successfully, but these errors were encountered: