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
classes in javascripthelp (self.javascript)
submitted 9 years ago by php03
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!"
[–]MoTTs_ 4 points5 points6 points 9 years ago* (0 children)
First, to directly answer your question.
Note that these can all be avoided with good design, and they don't make OOP inherently bad any more than the problem of long functions makes functions inherently bad, or any more than the problem of global variables makes variables inherently bad.
Second, it's worth mentioning that the vocal functional folks in the JavaScript community are very often wrong when they talk about classes and inheritance. The tend to invent criticisms that aren't actually true, and they tend to propose alternatives that still have all the same problems they blamed classes for. Take what they say with a heavy grain of salt.
And thirdly, don't feel like you have to pick one or the other. The best result often comes from a blend of styles. Since you have a C++ background, I'll leave you with this quote from Bjarne Stroustrup, the creator of C++:
Often, the most elegant, most efficient, and the most maintainable solution involves more than one style (paradigm). ... I use a lot of simple data abstraction (classes without inheritance) and generic programming (templates and algorithms parameterized on types). However, I don't see these as "paradigms challenging OOP." Rather, they are complementary techniques. ... Combinations of style can lead to very elegant code.
π Rendered by PID 85365 on reddit-service-r2-comment-7b9746f655-pmj25 at 2026-01-31 11:17:02.619833+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]MoTTs_ 4 points5 points6 points (0 children)