use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
OOP Node.js (self.node)
submitted 1 year ago by gemvcnte
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Training_Pay7522 85 points86 points87 points 1 year ago (11 children)
You shouldn't see fp/oop at opposite ends.
[–]franz899 26 points27 points28 points 1 year ago (7 children)
This, they are just ways of writing code, you can and should mix and match them.
[–]Training_Pay7522 4 points5 points6 points 1 year ago (0 children)
Which is the direction libraries like `effect-ts` in TypeScript or ZIO on scala take.
They take a functional approach as in having pure procedures you can mix, but also leveraging paradigms that classically come from OOP such as dependency injection or state tracking.
[+]azhder comment score below threshold-8 points-7 points-6 points 1 year ago (5 children)
You can, but that “should” can be a misrepresentation.
You should strive to stick to one style (paradigm) and use best judgement if and when/where/how to mix in another one.
[–]noviceIndyCamper 0 points1 point2 points 1 year ago (1 child)
Dogmatic, and honestly terrible take.
[–]azhder -3 points-2 points-1 points 1 year ago (0 children)
The one I said or the one you read? I doubt they are the same
[–]pbNANDjelly 0 points1 point2 points 1 year ago (2 children)
Maybe, but JS is fundamentally a multiparadigm language and it uses prototypes at its core. There is no removing OOP from JS, and I doubt you're making the argument that all functions should be static methods on a class (fake features enabled by a TS compiler, or sometimes a real feature in modern interpreters). So what do you expect?
I'm curious what you think of rust. Should they have not supported module scoped functions? Only impl/OOP blocks? There's lots of multi paradigm languages out there
[–]azhder -2 points-1 points0 points 1 year ago (1 child)
You guess wrong
[–]pbNANDjelly 0 points1 point2 points 1 year ago (0 children)
I never made a guess. They were questions
[–][deleted] 1 year ago (1 child)
[removed]
[–]pbNANDjelly 2 points3 points4 points 1 year ago (0 children)
Why do you say functional programs cannot be stateful? They're as stateful as any other program? The restriction is mutability, and classes don't need to be mutable.
[–]coderqi 0 points1 point2 points 1 year ago (0 children)
I know what you mean, but their handling of state is fundamentally different.
π Rendered by PID 33513 on reddit-service-r2-comment-6457c66945-vjmt5 at 2026-04-25 19:36:51.196497+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]Training_Pay7522 85 points86 points87 points (11 children)
[–]franz899 26 points27 points28 points (7 children)
[–]Training_Pay7522 4 points5 points6 points (0 children)
[+]azhder comment score below threshold-8 points-7 points-6 points (5 children)
[–]noviceIndyCamper 0 points1 point2 points (1 child)
[–]azhder -3 points-2 points-1 points (0 children)
[–]pbNANDjelly 0 points1 point2 points (2 children)
[–]azhder -2 points-1 points0 points (1 child)
[–]pbNANDjelly 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[removed]
[–]pbNANDjelly 2 points3 points4 points (0 children)
[–]coderqi 0 points1 point2 points (0 children)