Live data from Hacker News

Show HN: JAQT – JavaScript Queries and Transformations

github.com

11–20 of 40 posts

Re: Show HN: JAQT – JavaScript Queries and Transformations

#12

Wouldn'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

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.

Re: Show HN: JAQT – JavaScript Queries and Transformations

#18

Wouldn'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

I liked JAQT API but it is not really good to create a layer on top of already simple functional constructors.

Why is that not good? JavaScript is full of layers of unnecessary abstraction often for completely superficial reasons and sometimes even irrationally applied at great cost in defiance of evidence and simplicity. So, what makes this specific example less good than all the other countless examples of abstractions most JavaScript developers would happily die to defend?

Re: Show HN: JAQT – JavaScript Queries and Transformations

#19

Earlier quoted context omitted.

I liked JAQT API but it is not really good to create a layer on top of already simple functional constructors.

Why is that not good? JavaScript is full of layers of unnecessary abstraction often for completely superficial reasons and sometimes even irrationally applied at great cost in defiance of evidence and simplicity. So, what makes this specific example less good than all the other countless examples of abstractions most JavaScript developers would happily die to defend?

because in the past it didn't have those functional constructors so things like underscore or lodash would be needed but adding a layer as you mentioned. It is not good, for me, to add a dependency for this again. But in the end I have in my utils file a few functions that basically do what JAQT does and I might copy a few more.
Post reply on HN