Live data from Hacker News

I don't chain everything in JavaScript anymore

allthingssmitty.com

11–20 of 54 posts

Re: I don't chain everything in JavaScript anymore

#11
post #5
post #4

I agree that debugging these pipelines are a nightmare sometimes. It's something that frustrates me sometimes because even though in OOP it won't be terse the action would be clearer. OOP can at times also introduce less cognitive load as well. I wonder if the issue is the mixing of paradigms. Although I don't think everything should follow purity boundaries: functional must always be functional and OOP languages sho…

I guess I'm struggling because I also do like the IDEA of the unix commands being text that is piped around through commands so I do enjoy the concept of the purity of that mechanism.

This is the difference between a command (which is discarded after it's executed), and production code (which you probably want to keep around for a little bit).

But I'm in the same boat. I love the expressiveness of chaining a whole thing into a single call, but I have to break it apart for my own sanity.

Re: I don't chain everything in JavaScript anymore

#13

Name return variables bro. This is a solution that people fixed 25 years ago with detailedReturnObjectNames.

Can you elaborate on that? I'm not following. What makes return variables special?

I'd expect that much of the time, the return variable is closely linked to the name of the function. So closely linked that it risks being redundant.

Re: I don't chain everything in JavaScript anymore

#15
post #13

Name return variables bro. This is a solution that people fixed 25 years ago with detailedReturnObjectNames.

Can you elaborate on that? I'm not following. What makes return variables special? I'd expect that much of the time, the return variable is closely linked to the name of the function. So closely linked that it risks being redundant.

Not JS but I like having explicit return var assignments because it's easier to break on and inspect. I don't know why tools don't make this easier.

Re: I don't chain everything in JavaScript anymore

#16

The point of chaining is generally to avoid making intermediate objects.

the intermediate objects are still created, they just aren't given names/saved to a specific memory location somewhere

do you mean like streaming APIs where intermediate data structures aren't created? Is that what javascript does w/map() etc?

Re: I don't chain everything in JavaScript anymore

#18
post #9

I read two paragraphs of this and was already sure this article is AI generated. Read more, and "This isn’t just about..." there we go

Yeah, nowadays I'm finding more and more of such things and not wanting to read the article further. Sometimes I feel we ignore some good pieces because of LLMification!

When I write, I now use LLMs as an alternative to Grammarly and explicitly instruct it to not to rewrite. Sometimes the choice of words are very intentional and LLMs dont "feel"/understand the emotional reason behind that.

Re: I don't chain everything in JavaScript anymore

#19
What a high-level boring list of examples. Why not have one complex example that clearly shows your "take". (Quotations, because these "I stopped doing X, and now doing Y" posts are stupid. They're also easier to write now with LLM's.)

I'm sure there's a case to be made for either, this post just doesn't do it.

Post reply on HN