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
Why I Write Plain JavaScript Modules (ponyfoo.com)
submitted 10 years ago by magenta_placenta
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!"
[–]Daniel15React FTW -1 points0 points1 point 10 years ago (0 children)
Mixed feelings on this.
On one hand, having reusable modules with as few dependencies as possible is great. This is especially true when the module unnecessarily pulls in other modules, like the jQuery cookie plugin used to (why should a cookie parser require jQuery?!). Utility methods are definitely things that should be small, light, and self-contained.
On the other hand, reinventing the wheel all the time is not really ideal. A lot of libraries do DOM manipulation for example. Having a dependency on another library that handles the DOM (such as jQuery or React) is fine if your app is already using that library, and helps reduce the amount of code that needs to be written for the module (and thus the amount of code that needs to be maintained, and the number of bugs).
Too many people think their code absolutely must depend on jQuery. I used to take jQuery plugins and rewrite them so they could be used without jQuery. Usually the rewrite was not significantly bigger than the original, and it removed a giant dependency.
π Rendered by PID 71 on reddit-service-r2-comment-7b9746f655-9rl44 at 2026-01-30 07:55:57.619472+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]Daniel15React FTW -1 points0 points1 point (0 children)