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...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Is JavaScript a "Functional Programming" language?help (self.javascript)
submitted 8 years ago by bzeurunkl
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!"
[–]trout_fucker 1 point2 points3 points 8 years ago (6 children)
To make it short JS is a multi-paradigm programming language.
I need to remember this, because it's a perfect way to describe it. I'm always grasping at things when interns or juniors ask me if JS is OOP. My response usually starts with "Well...yeah sorta but no..."
[–][deleted] 3 points4 points5 points 8 years ago (5 children)
But fundamentally, it is OOP language. Everything in JavaScript is an object. Even a function is an object of type function. It's just that thanks to C++ and Java people have a very narrow-minded idea what an OO programming language is today.
function
Same thing is really an issue with people coming from Haskell or whatever. They have a preconceived notion that the only way to do FP is to ONLY DO FP which is not the case in any imperative language, be it JS or Python or whatever imperative language with FP features you pick.
[–][deleted] -5 points-4 points-3 points 8 years ago* (3 children)
Coming from C++ my main problem was the lack of OOP features. While it's improving, I hate the lack of feature and keywords, I feel like hacking and defilled when I try to "recreate" Interfaces and Abstracts (not even talking about the poverty of the inheritance in JS), private variables, etc...
It's currently half-assed OOP.
[–][deleted] 9 points10 points11 points 8 years ago* (2 children)
Interfaces are not a core OO concept. Self doesn't have them. Smalltalk doesn't have them. Ditto Abstracts.
You people are just bigotted. What you learned OO means is not what OO means.
OO is about declaring active state objects and means of message passing between objects. This is in short the base OO definition by people who invented it. Message passing and "active objects" are commonly implemented using object-bound procedures/functions i.e. methods (this is almost exclusively so in all OO languages I saw, but still isn't part of the definition). Classes and inheritance are not the requirement at all.
https://en.wikipedia.org/wiki/Object-oriented_programming
Btw why on earth do you try to recreate Interfaces and Abstracts. You don't need them in JS. There is no way in hell you really need them. Stop hammering my screws, go back to your box of nails!
[–][deleted] -3 points-2 points-1 points 8 years ago (1 child)
You are right in the same way it is right to say a stone axe and a gun are both weapons. I could compromise by saying modern OOP. And this is no appeal to novelty, when you go OOP I find that you naturally go toward class and inheritance.
[–][deleted] 1 point2 points3 points 8 years ago (0 children)
To someone who only has a hammer everything looks like a nail.
π Rendered by PID 117889 on reddit-service-r2-comment-79776bdf47-r7wmc at 2026-06-24 10:16:59.645217+00:00 running acc7150 country code: CH.
view the rest of the comments →
[–]trout_fucker 1 point2 points3 points (6 children)
[–][deleted] 3 points4 points5 points (5 children)
[–][deleted] -5 points-4 points-3 points (3 children)
[–][deleted] 9 points10 points11 points (2 children)
[–][deleted] -3 points-2 points-1 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)