News for hackers. Stuff that matters.
Re:You might not need jQuery (2014) by jamiesonbecker on Wednesday January 13, 2021 @10:47PM (#25771660)
> Hidden complexity you don't control is the most expensive kind I think.

That's called encapsulation. :)

Seriously, encapsulating complexity is the foundation of most programming paradigms.

Re:You might not need jQuery (2014) by userbinator on Wednesday January 13, 2021 @11:48PM (#25772162)
In the real world, it turns out that code you didn't write can also have bugs or not behave as you expect it to, so the less of that there is, the better.

Encapsulation/abstraction should really be a tool of last resort. From experience, it doesn't actually help reduce complexity if overused, but just makes it hidden and more likely to surprise you when you're debugging.

Re:You might not need jQuery (2014) by nicoburns on Thursday January 14, 2021 @05:53AM (#25774883)
> In the real world, it turns out that code you didn't write can also have bugs or not behave as you expect it to, so the less of that there is, the better.

jQuery's not a very good example of this though. It's one of the most widely used, and hence most tested and least buggy pieces of software out there. Nowadays the web APIs are pretty solid, but back in the IE6/7/8 days the jQuery API was a lot less buggy than using the built in APIs directly.

Re:You might not need jQuery (2014) by scubbo on Thursday January 14, 2021 @12:02AM (#25772294)
Have fun implementing everything from scratch in assembly.
Re:You might not need jQuery (2014) by jamiesonbecker on Wednesday January 13, 2021 @11:57PM (#25772235)
> In the real world... From experience...

Does jQuery (est. 2006) have more bugs in it than your code?

Re:You might not need jQuery (2014) by quattrofan on Thursday January 14, 2021 @02:25AM (#25773252)
As has been seen many times recently third party libraries are a major attack vector for the bad guys.
Re:You might not need jQuery (2014) by donapieppo on Thursday January 14, 2021 @07:55AM (#25775767)
> In the real world, it turns out that code you didn't write can also have bugs or not behave as you expect it to

To me this seems a comment that only stands for one-developer projects.

Re:You might not need jQuery (2014) by franklyt on Wednesday January 13, 2021 @11:02PM (#25771804)
Actually, it's called abstraction, as a technical point.
Re:You might not need jQuery (2014) by jamiesonbecker on Wednesday January 13, 2021 @11:09PM (#25771863)
Good point. This is what I was referring to:

https://en.wikipedia.org/wiki/Encapsulation_(computer_progra...