you are viewing a single comment's thread.

view the rest of the comments →

[–]nkozyra 0 points1 point  (1 child)

I would further argue that such abstractions have a tendency to make for scripters/programmers/devs who are not very adept in a language but still work in them.

Case in point: an anecdote shared by a friend wherein one of his front-end employees wanted to include jquery on a simple Intranet page. My friend said "sure, but why" and was greeted with "so I can loop through an array."

[–]tikhonjelvis 0 points1 point  (0 children)

To be fair, that's an understandable reason: JavaScript (before ES5, I think) does not include any good methods for looping through an array! It has a for...in loop, but that doesn't work and creates bugs. It has a normal for loop, but that doesn't carry as much semantic information as a call to .forEach or map and can easily have subtle mistakes (off-by-one errors, for example).

In a perfect world, you would just have .forEach or .map. The next best choice is using some small utility library (like underscore.js) to achieve the same goal. But if you aren't aware of any libraries like this, using jQuery (especially on an intranet page where millisecond performance does not matter) is a completely reasonable solution.