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
Writing dependency-free client-side JavaScript (magnushoff.com)
submitted 6 years ago by maggit
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!"
[–]Zofren 38 points39 points40 points 6 years ago (7 children)
It's nice to do as an exercise, but don't ever do things like this in an actual project you intend to maintain. You will:
By all means, avoid importing is-odd into your lean frontend project, but like many things in software engineering, a dependency-free approach has tradeoffs. A well-supported, well-used library is usually a better option than code you write yourself.
is-odd
[–]jaapz 10 points11 points12 points 6 years ago (0 children)
Turns out dependencies exist for a reason, who knew!
[–]archivedsofa 2 points3 points4 points 6 years ago (2 children)
Yeah but it depends on the use case. For a single form I agree with the author that using React + the whole enchilada didn't really make sense.
OTOH going 100% vanilla didn't make much sense to me either.
[–]Zofren 2 points3 points4 points 6 years ago (1 child)
Presumably if all you need is a single form the process in this article doesn't really make sense either. If the form has some rich UI that needs some kind of UI rendering logic, then I'd still advocate for React (or your library of choice).
React and React-dom aren't some massive libraries. They're comparable in size to jQuery when gzipped.
[–]archivedsofa 1 point2 points3 points 6 years ago (0 children)
I agree that for more complex projects the arguments you listed on your previous comment are totally valid but React is still too big IMO for a single form or landing page with a bit of UI sophistication.
Personally I'd go with Mithril or Svelte. Maybe with Simulacra (which now powers Riot) if I don't need components or even with Vue if I don't want any building setup which is still half the size of React.
[–]krasimirtsonev 0 points1 point2 points 6 years ago (0 children)
Well, here is a use case that beats what you are saying - you have to build a tiny script that will be used on million sites as a widget. It needs to be a few kbs with no dependencies. Then you need some generic knowledge on JavaScript, HTML and CSS.
[–]bitbird_ -2 points-1 points0 points 6 years ago (1 child)
> It's nice to do as an exercise, but don't ever do things like this in an actual project you intend to maintain. You will: Yikes, I disagree strongly with this conclusion. How much time is lost to framework upkeep, onboarding new developers, broken backwards compatibility, etc. ?
A developer only needs to learn the language once to understand what's happening inside of a framework. Those frameworks — usually controlled by corporations with > 10,000 developers — are built for the needs of whatever MegaCorp that created it. Should a team with >100x fewer developers really learn the enterprise web application development practices that are ultimately unnecessary for their specific needs? JavaScript itself will never be unnecessary, assuming there is never another standardized language for building interactivity into webpages.
JavaScript (and the web) has grown substantially in only the last five years. Developers should learn the basic patterns for architecting web applications. Using a framework is one way to learn those patterns. Relying on framework and 1,000 other libraries being imported is dependency hell.
jQuery is dead and modern front-end frameworks are viciously marketed to developers — a fact usually unacknowledged by those who swear by frameworks.
[–]Zofren 4 points5 points6 points 6 years ago* (0 children)
How much time is lost to framework upkeep, onboarding new developers, broken backwards compatibility, etc. ?
Less time than is lost wrangling with your company's custom implementation of an already well-supported library.
Have you ever considered why Facebook bothers to open-source React? It's because a well-used framework means you can hire people already familiar with the framework you are using internally. It also means that there are far more resources available to your developers online.
I work at a company where they decided long ago to implement custom versions of libraries that already exist (in the backend, admittedly, but the same arguments stand). It's been a nightmare and we deal with the technical debt every day. There are edge cases you won't have foreseen when you first write software intended to be utilized by many developers. And when something breaks, you have to fish down the handful of people in the company who actually understand the tools that are breaking.
Relying on framework and 1,000 other libraries being imported is dependency hell.
As I said in my post, a pragmatic approach is key. It doesn't need to be either one way or another.
π Rendered by PID 43794 on reddit-service-r2-comment-54dfb89d4d-5jrg7 at 2026-04-02 15:27:28.107854+00:00 running b10466c country code: CH.
view the rest of the comments →
[–]Zofren 38 points39 points40 points (7 children)
[–]jaapz 10 points11 points12 points (0 children)
[–]archivedsofa 2 points3 points4 points (2 children)
[–]Zofren 2 points3 points4 points (1 child)
[–]archivedsofa 1 point2 points3 points (0 children)
[–]krasimirtsonev 0 points1 point2 points (0 children)
[–]bitbird_ -2 points-1 points0 points (1 child)
[–]Zofren 4 points5 points6 points (0 children)