Live data from Hacker News

Show HN: SuperUtilsPlus – A Modern Alternative to Lodash

github.com

61–70 of 88 posts

Re: Show HN: SuperUtilsPlus – A Modern Alternative to Lodash

#62
About pain points / feature requests:

Is 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

#63
post #23

Earlier 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.

I do sort of miss bower [0] for this reason. It was really just a way to download javascript and plunk it into your application. It was standard practice to check all of your vendor dependencies into SCM. [1] Of course a good chunk of it was transformed through something like Gulp or Grunt before being added to the bower repository so you were unlikely to maintain those once checked in, but there was still quite a few packages (small jquery image gallery plugins and the like) that were just some un-transformed javascript someone typed up and threw at bower verbatim.

[0] https://bower.io

[1] https://addyosmani.com/blog/checking-in-front-end-dependenci...

Re: Show HN: SuperUtilsPlus – A Modern Alternative to Lodash

#65
post #48
post #21

What 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.

CVEs are a thing. If vulnerabilities are discovered in your dependency graph, choosing to ignore them can have severe consequences.

Re: Show HN: SuperUtilsPlus – A Modern Alternative to Lodash

#66
post #21

What 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.

This is the approach I'm sometimes using, but it would be nice to have tooling around that :)

Re: Show HN: SuperUtilsPlus – A Modern Alternative to Lodash

#67
post #29

Earlier 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-)

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.

Re: Show HN: SuperUtilsPlus – A Modern Alternative to Lodash

#68

Earlier 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.

To use your analogy, this is more of "Show HN: Cialis - A modern alternative to Viagra".

You either care about Viagra and read or move on.

Re: Show HN: SuperUtilsPlus – A Modern Alternative to Lodash

#69
post #67

Earlier 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.

In the "akshually" sense. "Zen of programming" (or "I'm smart because I use the word monoid unironically").

"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

#70

Nice 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/

Or this https://github.com/casey/just
Post reply on HN