+ 10
Why most users write web codes in not-compatible way
Why they use "let" and new anonymous function expression "()=>" when old alternatives can run codes on most platforms (most users run codes on android and a great percentages run old versions when no support for new ES feautures)... When i ask... There are concrete motivations that i dont know?
21 Antworten
+ 8
The simple answer is many of the users here are learners. The common mentality of a learner is to learn to newest Technologies because that is what will most likely apply to them.
+ 11
ES6 have solution : Babel.
So I code in ES6.
But, in sololearn, I use old version.
But I hate that. Want sololearn add Babel to playground.
+ 10
Because new ES6 is better and we've need learn this version.
And, mouth after mouth, ES6 have better support. Always be ready for newest.
Finaly, with Babel no compatibility issues.
+ 8
@KrOW
I undetstand but... we are on 2018 not in 1900's.
We can't always make code compatible with old devices. It's boring.
And with JS it's special. ES6 fixes a lot of problems that were really painful.
I think Sololearn should quickly add Babel.
+ 8
Absolutely not. Sololearn is a learning platform. Therefore, it has the obligation to integrate a way of doing ES6. ES6 is the future and you don't have to wait another minute to get used to coding with it.
We must not find this with problems like the IE era, PHP 4 ect... Many others do, like codepen, so why not Sololearn?
The incompatibility force to upgrade. I will 100% for.
+ 4
Its in part true but i see not-begginer (users more expert than me) also do this
+ 4
KrOW
I understand, and I, too, value accessibility over my own convenience in writing codes.
I'm just saying I didn't realize my code wasn't compatible with IE and Android 4.x until someone actually reported it to me. I didn't even know "let" is an ES6 feature when I used it. Novice as I am, I thought if it was working on my phone, it should work on any phone--just like some other non-web codes on Sololearn.
I know that it's my fault for not doing enough research. But I shared my story to explain why I, and probably some other newbies do it without realizing it.
+ 4
im not sure, but i think arrow function work different with "this" (idk if i remember right, but i think it doesnt allow .bind()), and let variables are scoped
+ 4
KrOW wow, what a fast response...
Yeah, u are right, i dont think anyone uses them for this reason
+ 3
Adriel Matei Yes, you have right but many times they are used without true need of them
+ 2
Ok... Its right use it for learn, but if your are using for show your coding skills its counter-logic. I m writing/read from a android device (an old device) and like me most users do it occasionally. If i want run your code, and i cant do because "let" and "()=>" i can:
- edit code for run it on my device
- forget about your code and go next
I dont discuss much on other features (like class and const that have impact on code architecture) but "let" and "()=>" dont... They for most time, break compatibility only and is not good... If you must build a website with js what ES use in it?
+ 2
I understand your position KrOW. I will avoid this in my public codes here on out. If any of my old ones give you problems please leave a comment on them and I will address it for you. I'm sure many others would also.
+ 2
Kishalaya Saha Its true... Many new features of ES make development more "practical" and i dont want opposite to this, but though many users have android 4.x and these device dont support ES6 (but with firefox for android support that its weight to run in these devices)... I want only advice users of this community that if they want make run own code on larger users group, they have to think about this problem
+ 2
Kishalaya Saha Yes, i have understanded but i see many experienced users that do this (using only "let" and "()=>" without no real benefit but limiting own code compatibility) in own codes... For this is borned my question
+ 2
I see. Thank you!
+ 1
thanks but its not necessary.... Everyone choose own style version and language that it want... Mine is curiosity, i want know only motivations behind this choice but everyone has to know that if it want WRITE HIS JS CODE FOR SHOW CODING SKILLS, PLEASE DONT USE NEW FEAUTURES IF POSSIBLE, ELSE MOST USERS THAT RUN IN OLD UA CONTEXT (eg old android version) CANT RUN CODE WITHOUT EDIT IT
+ 1
You cannot reasoning about newest or oldest... If you are learning, it s ok but if you serve contents to others, you must considerate others systems and capabilities and try to find a compromise and in this case (about "let" and "=>") is totally not logic from my point of view
+ 1
anyway... if you make a website, what ES version use in it?
+ 1
Babel is a compiler and, in SL case where multiple js scripts be loaded, it always an overload for server... Hence i dont think that SL will use it... It depends on user browsers and code writer must has some restrictions if they want serve js code at more people on this community
+ 1
But SL do it.... It provide lessons on es6 and allow code writed with i to run... The problem (is not really a problem but i see so) is another and not only depends from SL...
P.S. i dont think that SoloLearn has "obligations" in strict sense