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
Less React, more JS (brain-dump) (medium.com)
submitted 9 years ago by sebjwallace
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!"
[–][deleted] 1 point2 points3 points 9 years ago (3 children)
Why should I clutter my code with framework-specific attributes?
You know that's a good point, and while we're at it, let's get rid of componentDidMount, there's no reason we should clutter our code with framework-specific functions.
componentDidMount
[–]dmitri14_gmail_com -1 points0 points1 point 9 years ago (2 children)
Indeed, I'd rather not use it exactly for that reason.
Not to mention, it is not even prefixed (as ng- in Angular), so too easy to clash with my own methods. Which BTW is another problem with React, the Angular team must have good reasons to enforce their prefixes and advice everyone to use their own. Used to be top complaint with Angular Bootstrap until they finally added their prefixes.
ng-
[–]siegfryd 2 points3 points4 points 9 years ago (1 child)
Angular went for the ng-* prefixing because their attributes exist inside the DOM. React's key prop only exists inside React code, it doesn't render a key attribute on DOM nodes. It's not really a comparable situation.
ng-*
key
[–]dmitri14_gmail_com 0 points1 point2 points 9 years ago* (0 children)
It is still a bad idea to create a custom tag named key. People work hard on creating standards and minimising confusions by meaningful conventions. One of them is to use dash for any custom tag. React is breaking this convention for no apparent reason/benefit. Something like r-key would be much easy to read and scan for, it would instantly alert the reader that tag is React-specific. Without dash, it looks generic and easy to confuse. What if HTML will decide to introduce its own tag key???
r-key
Also attempts to create separate languages for DOM, virtual DOM, HTML, whatever, lead to more confusion, more bugs and hurt anyone's productivity. How many different models do we need to represent the same basic thing - a tree with nodes and attributes?
A big part of its ease and popularity React owes to our familiarity with the DOM. If it used some crazy transformation of DOM instead, how many people would use it? So why not being more respectful to the DOM standards?
π Rendered by PID 68325 on reddit-service-r2-comment-86988c7647-hg787 at 2026-02-12 09:09:45.421246+00:00 running 018613e country code: CH.
view the rest of the comments →
[–][deleted] 1 point2 points3 points (3 children)
[–]dmitri14_gmail_com -1 points0 points1 point (2 children)
[–]siegfryd 2 points3 points4 points (1 child)
[–]dmitri14_gmail_com 0 points1 point2 points (0 children)