Show HN: SuperUtilsPlus – A Modern Alternative to Lodash
61–70 of 88 posts
Re: Show HN: SuperUtilsPlus – A Modern Alternative to Lodash
#62Is there an idiomatic way to duplicate a hash while replacing one of its values, preferably something that supports nesting?
Whenever I work with react and immutable structures, this comes up and I hack something simple.
I don’t do FE on a regular basis though so my perspective may be skewed.
Re: Show HN: SuperUtilsPlus – A Modern Alternative to Lodash
#63Earlier quoted context omitted.
Couldn't you just pin a specific version dependency? My brain says there's some way to also pin to a hash, but that would require googling and I'm on mobile.
Pinning is a good strategy (I'd say that it should be the default one), but depending on your level of paranoia (think left-pad), you might consider just downloading the lib as it is, and storing it in source control forever.
[0] https://bower.io
[1] https://addyosmani.com/blog/checking-in-front-end-dependenci...
Re: Show HN: SuperUtilsPlus – A Modern Alternative to Lodash
#64Nice work! Reminds me of https://github.com/angus-c/just Suggestion: add more tests and run some benchmarks
Re: Show HN: SuperUtilsPlus – A Modern Alternative to Lodash
#65What I’d like is a utility library like this, but instead of it being an actual library, be it some utility that generates a single file with exports of the few functions I need. Even just something that would make copy pasting them easier. As in, I want actual zero dependencies, not even the library itself. The reason: I never want these to randomly update.
Nobody wants anything _ever_ to ”randomly update”. Why this is the default setting on so many development setups boggles my mind. I really havent figured out why professional systems insist running on the bleeding edge - it’s your feet are bleeding here I believe. 10 year … 15 year old code is generally excellent if you know it through and thorough.
Re: Show HN: SuperUtilsPlus – A Modern Alternative to Lodash
#66What I’d like is a utility library like this, but instead of it being an actual library, be it some utility that generates a single file with exports of the few functions I need. Even just something that would make copy pasting them easier. As in, I want actual zero dependencies, not even the library itself. The reason: I never want these to randomly update.
Why not copy & paste the code you need into a vendor/ subdir? If the vendored code needs to be updated because of a change in your build tools or whatever then you’ll likely be making similar changes to other parts of your project.
Re: Show HN: SuperUtilsPlus – A Modern Alternative to Lodash
#67Earlier quoted context omitted.
What do you think about empty strings being falsy in most languages including js? Null/undefined is a better choice, but there's many occasions where you do not have the power of choice. For example with document.querySelectorAll, which returns an empty array if nothing is found. The simple thing to do is to just check for it's length or just iterate over it's nodes, but still. I prefer empty arrays being falsy. Just…
Akshually, implicitly casting any non Boolean type to true or false is no better than implicitly casting “0” to 0. :) B-)
Re: Show HN: SuperUtilsPlus – A Modern Alternative to Lodash
#68Earlier quoted context omitted.
lodash is extremely common knowledge in the js/web world. you’re asking a chemist to explain atoms before sharing their big discovery
No I’m asking a commercial that pops up in what I’m watching and says “ask your doctor if ciallis is right for you.” and gives no context but someone washing their tesla.
You either care about Viagra and read or move on.
Re: Show HN: SuperUtilsPlus – A Modern Alternative to Lodash
#69Earlier quoted context omitted.
Akshually, implicitly casting any non Boolean type to true or false is no better than implicitly casting “0” to 0. :) B-)
No better based on what criteria? In what language? This is typical in Python and done even by core-devs. It is how the language was designed and it was designed to support that.
"If is an anti pattern", "null values are an anti pattern", "`string' is an anti-type", "util libraries are an anti pattern", etc.
And of course "boolean is an anti type" but let's not get into that. :D
(Nor into the value of "idiomatic python" as an argument on healthy programming habits....)
Re: Show HN: SuperUtilsPlus – A Modern Alternative to Lodash
#70Nice work! Reminds me of https://github.com/angus-c/just Suggestion: add more tests and run some benchmarks
Not to be confused with the other Just: https://microsoft.github.io/just/