News for hackers. Stuff that matters.
Re:You might not need jQuery (2014) by petecooper on Thursday January 14, 2021 @03:12AM (#25773563)
>> Is saving 10-15 lines worth it if you need an 86.1 Kb vendor dependency? >Yes, absolutely. That's a total no-brainer.

I'm curious - would you be able to elaborate, please? Thank you.

Re:You might not need jQuery (2014) by porker on Thursday January 14, 2021 @04:42AM (#25774243)
Assuming I'm going to need the complexity more than 1-2 times in my source code, I'm going to be writing my own abstraction. Which takes time, needs tests writing, and I am going to make a typo or other silly mistake somewhere.

Run into a couple of examples of such complexity, and the dependency is well worthwhile.

A jQuery that can be tree-shaken would be awesome, as there are parts I use regularly and others I have never used. Ironically the -lite bundle leaves outs parts I use frequently...

Re:You might not need jQuery (2014) by lmm on Friday January 15, 2021 @02:11AM (#25787930)
Just look at the cost-benefit. Typically internal code has a defect rate of around 1/1000 lines, so 10-15 lines is about 0.01 bugs. 86.1Kb of an established, widely used library is a cost that I can't meaningfully distinguish from zero.