News for hackers. Stuff that matters.
Re:Show HN: A JavaScript function that looks and behaves lik... by madeofpalk on Wednesday September 27, 2023 @06:34AM (#37672764)
Right - because this library tries to fake a new language syntax feature without the actual support for it, it ends up being the worst of both worlds. Even ignoring the lines-of-code explosion, the non-standard use of parens/spacing makes it incredible difficult for me to parse.

Props to the author for trying out something neat, but this is probably a bit to clever for my liking.

Re:Show HN: A JavaScript function that looks and behaves lik... by spoiler on Wednesday September 27, 2023 @07:33AM (#37673158)
> the non-standard use of parens/spacing makes it incredible difficult for me to parse.

Same here. Not to mention this wouldn't work in a codebase with an autoformatter.The idea/API is clever. So, a pretty cool experiment I suppose

Re:Show HN: A JavaScript function that looks and behaves lik... by FroLeMageBlanc on Wednesday September 27, 2023 @08:07AM (#37673464)
Author here. Thanks for your nice comment. I added a note to say it does work with autoformatters too. Actually someone in a comment below said he or she prefers the autoformatted syntax.
Re:Show HN: A JavaScript function that looks and behaves lik... by spoiler on Wednesday September 27, 2023 @10:24AM (#37675120)
Oh, that's good to know! I haven't tried it and assumed an auto formatter might misalign some of it or put things on the same line, so the visual "downward arrow" appearance would be lost

Edit: I just checked the docs again and while it does look a bit "misaligned" at the start, I do think it looks more readable with the autoformatted version. Pretty cool!

Re:Show HN: A JavaScript function that looks and behaves lik... by newtom on Wednesday September 27, 2023 @10:49AM (#37675449)
Just an FYI to folks, there has been a proposal to add pipes to JavaScript for a few years:

https://github.com/tc39/proposal-pipeline-operator