I'm a Systems Reliability and DevOps engineer for Netdata Inc. When not working, I enjoy studying linguistics and history, playing video games, and cooking all kinds of international cuisine.
I se two big advantages to Lodash/Underscore other than providing slightly stricter FP semantics:
They make your code more concise, usually in a good way. ECMA and W3C seem to love long super descriptive names for functions. Using Lodash or Underscore lets you avoid such needless verbosity without compromising on readability. _.has(x, y) is a whole lot easier to read than x.hasOwnProperty(y), especially if you're not using syntax hilighting, but doesn't reduce the amount of relevant information being conveyed to anyone reading the code. This is also, coincidentally, one of the arguments for continuing to use jQuery ($('foo') is a whole lot more concise than document.querySelector('foo')).
It helps you avoid having to write boilerplate code. Yeah, you could write your own symmetric difference algorithm for arrays, but it's a whole lot easier to just use _.xor(x, y) and worry about coding the actual application, especially when you've got a deadline approaching. The less generic code you have to write, the more time you can focus on actually getting the application itself written.
I honestly feel both points are far stronger arguments than making FP in JS nicer, especially considering the fact that most of making FP nicer in JS at this point is just enforcing FP patterns (the language itself is already very FP friendly).
How’s it going, I'm a Adam, a Full-Stack Engineer, actively searching for work. I'm all about JavaScript. And Frontend but don't let that fool you - I've also got some serious Backend skills.
Location
City of Bath, UK 🇬🇧
Education
10 plus years* active enterprise development experience and a Fine art degree 🎨
Your first point reminds me of the awquard case of the JavaScript Map, although vastly superior with an API just like you describe, nobody seems to use them despite the ease of use and performance improvement.
I don't really disagree with anything you say. Thanks for chipping in.
I'm a Systems Reliability and DevOps engineer for Netdata Inc. When not working, I enjoy studying linguistics and history, playing video games, and cooking all kinds of international cuisine.
nobody seems to use them despite the ease of use and performance improvement.
There are a lot of sites that transpile down to earlier versions of ECMAScript revisions. In such a case, there's no performance benefit to using new features, and quite often they actually make performance worse. I suspect that's a large part of it, and we'll probably see usage of some of these features pick up more as Internet Explorer and Opera Mini finally die off.
How’s it going, I'm a Adam, a Full-Stack Engineer, actively searching for work. I'm all about JavaScript. And Frontend but don't let that fool you - I've also got some serious Backend skills.
Location
City of Bath, UK 🇬🇧
Education
10 plus years* active enterprise development experience and a Fine art degree 🎨
That's fair. I do wish that the web would move a little faster in some areas. Browsers being one of them. And an approximation of a thing is not a real thing. I gues I'm just talking in an ideal world scenario.
I'm a Systems Reliability and DevOps engineer for Netdata Inc. When not working, I enjoy studying linguistics and history, playing video games, and cooking all kinds of international cuisine.
I mean, Opera Mini really is dead already for most purposes if you aren't dealing with some really big site. IE is still hanging on, but mostly corporate usage and not 'normal' users.
It's well within reason to just refuse to support either if you're doing something small. The issue is that people don't choose to do that, or they just kind of decide to use Babel without thinking (and thus make the site slow for all their actual users who aren't using browsers that need old JS).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I se two big advantages to Lodash/Underscore other than providing slightly stricter FP semantics:
_.has(x, y)
is a whole lot easier to read thanx.hasOwnProperty(y)
, especially if you're not using syntax hilighting, but doesn't reduce the amount of relevant information being conveyed to anyone reading the code. This is also, coincidentally, one of the arguments for continuing to use jQuery ($('foo')
is a whole lot more concise thandocument.querySelector('foo')
)._.xor(x, y)
and worry about coding the actual application, especially when you've got a deadline approaching. The less generic code you have to write, the more time you can focus on actually getting the application itself written.I honestly feel both points are far stronger arguments than making FP in JS nicer, especially considering the fact that most of making FP nicer in JS at this point is just enforcing FP patterns (the language itself is already very FP friendly).
Your first point reminds me of the awquard case of the JavaScript Map, although vastly superior with an API just like you describe, nobody seems to use them despite the ease of use and performance improvement.
I don't really disagree with anything you say. Thanks for chipping in.
There are a lot of sites that transpile down to earlier versions of ECMAScript revisions. In such a case, there's no performance benefit to using new features, and quite often they actually make performance worse. I suspect that's a large part of it, and we'll probably see usage of some of these features pick up more as Internet Explorer and Opera Mini finally die off.
That's fair. I do wish that the web would move a little faster in some areas. Browsers being one of them. And an approximation of a thing is not a real thing. I gues I'm just talking in an ideal world scenario.
I mean, Opera Mini really is dead already for most purposes if you aren't dealing with some really big site. IE is still hanging on, but mostly corporate usage and not 'normal' users.
It's well within reason to just refuse to support either if you're doing something small. The issue is that people don't choose to do that, or they just kind of decide to use Babel without thinking (and thus make the site slow for all their actual users who aren't using browsers that need old JS).