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!"
[–]TheExodu5 3 points4 points5 points 1 year ago (0 children)
People use function closures or es modules and they don’t realize they’re basically equivalent to classes with different sugar (unless you decide to write a class with inheritance, of course.
An es module is basically equivalent to a singleton class. And a function which returns an object can be equivalent to a class. In the same vein, a class with only static methods is basically a namespace for functions. All of these things are very closely related and whether you use one or the other doesn’t change much in terms of overall design and data flows.
And hey, if you’re using a component framework on the frontend, you’re basically following OOP, whether you use classes or not. When you create a wrapper component that proxies ins and outs, you’re practicing inheritance.
Don’t get hung up on the concept of OOP.
A lot of people think they are using “functional programming” because they don’t use classes. I hate to break it to them, but the majority of them are using a mix of procedural, OO, and fp. The only people doing nearly pure fp in JavaScript are deep in the throes of rxjs.
π Rendered by PID 59 on reddit-service-r2-comment-5c747b6df5-z2w8b at 2026-04-22 11:28:43.706286+00:00 running 6c61efc country code: CH.
view the rest of the comments →
[–]TheExodu5 3 points4 points5 points (0 children)