[flagged]
Show HN: JAQT – JavaScript Queries and Transformations
31–40 of 40 posts
Re: Show HN: JAQT – JavaScript Queries and Transformations
#32Earlier quoted context omitted.
This is such a weirdly contrarian take. You’re basically saying that everything in context is terrible, and somehow at the same time, on the same basis, that it’s wrong to critique anything because everything is terrible. That’s certainly a logically consistent position, but it isn’t one that allows much room for anything to improve… or even become a productive discussion.
No, I am saying don't complain about something only because its an abstraction when likely the person making that comment cannot program without vanity abstractions. Clearly, this is about bias and preference. At the very least people could be consistent in their reasoning.
It is perfectly reasonable to ask whether something for convenience adds value to something also for convenience.
Nearly everything in any high level language isn’t strictly necessary to achieve general purpose computation. That doesn’t invalidate any distinction between all higher level concepts! They specifically add expressiveness, so it’s eminently meaningful—for people who find expressiveness valuable—to discuss and distinguish between like solutions in those terms.
Re: Show HN: JAQT – JavaScript Queries and Transformations
#33Earlier quoted context omitted.
No, I am saying don't complain about something only because its an abstraction when likely the person making that comment cannot program without vanity abstractions. Clearly, this is about bias and preference. At the very least people could be consistent in their reasoning.
The critique was that the existing abstractions address the same set of problems as do the newly introduced abstractions. You’ve said that the existing abstractions are bad, as an invalidation of that critique. It is perfectly reasonable to ask whether something for convenience adds value to something also for convenience . Nearly everything in any high level language isn’t strictly necessary to achieve general purpo…
> They specifically add expressiveness
Not really. Expressiveness is the ability to achieve the same end state in different ways. How do you then determine that? You have to count the different ways a given thing is achieved. Under the abstraction if its doing the same thing in the same way as something else then its not really different, and thus not expressive. That is why these large SPA frameworks have wildly different super large APIs, but their output is strikingly similar, which isn't expressive at all. Really, with these tools none of that matters, because its really just about the perceptions of convenience.
Re: Show HN: JAQT – JavaScript Queries and Transformations
#34can a query like that be observable? so updating the array/object would cause the results to update?
Re: Show HN: JAQT – JavaScript Queries and Transformations
#35Typically I use something like JSONPath [1] (basically XPath for JSON) [2] or jq for this but having more options with other syntax and style is helpful.
For streamed JSON like NDJSON [3] there are some nice filtering options [4]
[1] https://en.wikipedia.org/wiki/JSONPath
[2] https://datatracker.ietf.org/doc/html/rfc9535
[3] https://github.com/ndjson/ndjson-spec
[4] https://github.com/mbostock/ndjson-cli?tab=readme-ov-file#fi...
Re: Show HN: JAQT – JavaScript Queries and Transformations
#36Earlier quoted context omitted.
[flagged]
jQuery provided a DOM manipulation API that was the same in all browsers when there were lots of differences between browser implementations. While you could do everything using standard web APIs, that would be incredibly error prone and tedious at a time when `querySelector` was not a thing yet. Lodash does way more than some basic functional wrappers. I've seen too many buggy re-implementations of debounce, throttl…
Re: Show HN: JAQT – JavaScript Queries and Transformations
#37Wouldn't the query for your example just be data.filter(d => d.friends.includes("John")).map(d => ({name: d.name+" "+d.lastName})) Maybe I'm missing the bigger picture, but that doesn't seem so bad
Re: Show HN: JAQT – JavaScript Queries and Transformations
#38Looks like .net Linq. Many js projects use lodash and variants, how do you compare that?
Re: Show HN: JAQT – JavaScript Queries and Transformations
#39Re: Show HN: JAQT – JavaScript Queries and Transformations
#40Earlier quoted context omitted.
one of the cases something like this is useful for is when you have user configured saved 'filters' - you can simply pass the stored object into the where clause. I agree if you're doing hard-coded queries on arrays of objects, this may not add a lot. That said, a consistent syntax for doing searches and mapping is useful - projects like lodash have that as part of their api too.
This is actually a pretty decent use case for something like this. You could technically convert a user provided filter function to a string to serialize it, then recreate it using the Function() constructor, but that requires adding 'unsafe-eval' to your content security policy [1][2]. [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... [2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe…