DEV Community

Saurabh Sharma
Saurabh Sharma

Posted on • Edited on

What javascript would look like if they could make breaking changes in it.

We all know most of the problems in javascript is because of the fact that it was designed in very short period of time. Result of that we have lot of bad parts and w3c dont want to break backwards compatiblity of web so they don't fix it.

But just for this post imagine if we could make breaking changes in javascript.

What it would look like then?

Top comments (4)

Collapse
 
fynn profile image
Fynn Becker

The whole Date situation would probably be thrown away and build from scratch with a lot more convenience stuff. Maybe the best parts of moment.js and date-fns as part of the core language.

And switch would become a bit more JavaScript-y, so devs won't be afraid to use it more 😁 The colons really look out of place in regard to the rest of the language.

Collapse
 
itsjzt profile image
Saurabh Sharma • Edited

Yeah switch is like the unused part of language, along with with

Collapse
 
guitarino profile image
Kirill Shestakov

I think "===" would become "=="

We'd have "box-sizing: border-box" by default

Collapse
 
itsjzt profile image
Saurabh Sharma

To me I think

  • it will get more parts from scheme
  • fix type null == "object"
  • breaking changes in var
  • strict types i.e. less type coercion
  • maybe pattern matching and stuff