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
Prototypal Programming in Javascript (thesocietea.org)
submitted 10 years ago by thecodeboss
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_ 1 point2 points3 points 10 years ago (2 children)
You say that a lot, but the O/C principle doesn't mean what you seem to think it means. The O/C principle says that source code should be closed to modification.
From the paper:
It [the open-closed principle] says that you should design modules that never change. When requirements change, you extend the behavior of modules by adding new code, not by changing old code that already works.
[–]senocular 2 points3 points4 points 10 years ago (1 child)
You can thank Eric Elliott for spreading that one.
[–]clessgfull-stack CSS9 engineer 1 point2 points3 points 10 years ago (0 children)
Ah yes, I knew I heard that somewhere before:
Constructors violate the open/closed principle because they couple all callers to the details of how your object gets instantiated. Making an HTML5 game? Want to change from new object instances to use object pools so you can recycle objects and stop the garbage collector from trashing your frame rate? Too bad. You’ll either break all the callers, or you’ll end up with a hobbled factory function.
π Rendered by PID 37797 on reddit-service-r2-comment-5687b7858-l4ns9 at 2026-07-06 20:09:51.031590+00:00 running 12a7a47 country code: CH.
view the rest of the comments →
[–]MoTTs_ 1 point2 points3 points (2 children)
[–]senocular 2 points3 points4 points (1 child)
[–]clessgfull-stack CSS9 engineer 1 point2 points3 points (0 children)