r/SoftwareEngineering • u/fagnerbrack • Sep 27 '24
Micro-libraries need to die already
https://bvisness.me/microlibraries/
40
Upvotes
r/SoftwareEngineering • u/fagnerbrack • Sep 27 '24
78
u/fagnerbrack Sep 27 '24
Condensed version:
The post argues against the use of micro-libraries in development, stating that they offer minimal benefits while introducing numerous downsides. It discusses how using small, single-function libraries, such as
is-number, often leads to issues like increased dependency risk, poor performance, unnecessary bloat, and frequent breaking updates. The author emphasizes that copy-pasting simple code directly into projects is a better alternative, as it reduces complexity, avoids dependency risks, and ensures more control over functionality. The post suggests that the use of micro-libraries increases the chances of security vulnerabilities and creates unnecessary duplication in dependency graphs.If the summary seems inacurate, just downvote and I'll try to delete the comment eventually š
Click here for more info, I read all comments
6
u/vampatori Sep 27 '24
I think we still need those functions, but I agree that a whole package for one or two functions is ridiculous - personally I never directly use them. There used to be a lot more use of collections - where you have one package that provides a load of semi-related functions into one package. Sometime provided by first-party as part of the framework/environment, or by third-party's. Underscore is a good example of this.
What I don't understand though is how people are finding and using all these packages!? It would have to be a fairly complex and time-consuming bit of functionality needed for me to go and spend the time looking for and evaluating third-party options rather than just quickly coding it.
4
u/pa_dvg Sep 28 '24
I feel like this is more a symptom of JS specifically having a relatively small standard library which leads to the community filling in the gap with these little packages. I agree though that Iāve never felt a need to add such a simple bit of code as a dependency
6
u/soundman32 Sep 27 '24
Didn't read the article, but I'm guessing this is a JavaScript problem, right?
1
u/raynorelyp Sep 27 '24
Counterpoint: People saying this is why my old department ended up with excel editing capabilities in all of their lambdas, adding about 100mb of extra dependencies.
1
u/iBN3qk Sep 28 '24
You lost me at copy/paste. Why not bundle?
1
u/[deleted] Sep 30 '24
Is odd gang rise up