Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
R5on11c10557y@theuser it's better to have longer variables and method names, than not knowing exactly and isntantly what they do. Debugging is an absolute hell when you have complex code that isn't explicit in their naming.
-
JohanO20507yyou can do it yourself:
document.f = document.getElementByID;
document.f(...);
Im not saying that this is a good idea, but it can be done. -
theuser48027y@JohanO Good to know, but I think I would rather have my IDE autocomplete for me (using WebStorm)
-
joas19427yI quess you could wrap querySelector to $, so you don't have to use jQuery. Because of... it's too mainstream? There really not excuse not to use jQuery but I like to run as little libraries as possible on my sideprojects. Because why not.
-
Froot75547yWhy would you even need to touch the DOM manually?
My projects have exactly one place where I touch DOM:
React.render(
<App />,
document.getElementById('app-root')
)
If you need more then you're doing it wrong -
Froot75547y@theuser Ah then it makes sense. And it's the right path too, defenately know how HAS works before going into React 😊
-
Dacexi120367yGet yourself a good editor? I agree with you but changing it would basically break the whole web. When I type "d.geti" it corrects it to getElById and so on
-
Froot75547y@Walz I've had this discussion here many times, I'm not going to have it again. You might think that everything should be open-source, I don't. I'm not going to use some inferior second class product just because it's open-source.
Also, go read up on economics a bit, parents are not all that bad -
Walz517y@Froot I don't want every things I use to be open-source.
React is in a weird middle ground, it's open-source until Facebook takes the license back from you.
And, more importantly, it's said almost nowhere (Let's not pretend people read the LICENSE file).
In the end, its depends on how much you trust Facebook.
You can't say that React is the only way to go when there are tons of others framework that could better fit one's need.
"If you only have a hammer everything is a nail" or something like it, you get the idea. -
Froot75547y@Walz Well React works and it's good at what it does. It also has a great ecosystem around it. Why would I use anything else?
-
Walz517y@Froot The same thing can be said of Angular, but neither are lightweight and sometime that what you need.
Or you're building a proprietary app and would prefer to not get involved with the React licence.
You should assess your project need and then choose the right framework and not force your favorite in every project.
Also, and I know it's crazy, but you may not even need JS. (Or just a little and vanilla is enough) -
Dacexi120367y@Froot react is really unnecessary when building, let's say a sidebar with just a few elements. Something like vue would be a much better fit.
-
Froot75547y@Dacexi Well of course react is overkill if you just want JS on some buttons.
I'm talking about SPAs here.
I wish they would shorten the element reference method calls in js, it's just a tedious ordeal typing document.getElementByID() or getElementsByClassName() all the damn time.
undefined