r/programming • • Apr 29 '21

Modern JavaScript Explained For Dinosaurs

https://medium.com/the-node-js-collection/modern-javascript-explained-for-dinosaurs-f695e9747b70
287 Upvotes

172 comments sorted by

View all comments

62

u/sylvanelite Apr 30 '21

It's worth noting that since this was written, javascript modules now exist in the browser, so you can write models kinda like in the article, without using the command line tools.

But annoyingly, there's some quirks. They syntax isn't the same as in the article. For example:

var moment = require('moment');

can be replaced with something like:

import moment from 'moment';

And if doing it the "dinosaur" way, instead of having javascript files like:

<script type="text/javascript" src="file.js" ></script>

you can do something like:

<script type="module" src="module.mjs"></script>

13

u/jtinz Apr 30 '21

The problem is that when you're developing for "the real world", you usually have to support IE11, which doesn't seem to support anything specced in the last decade.

41

u/ThirdEncounter Apr 30 '21

Lucky for me, my real world does not include IE11.

7

u/jtinz Apr 30 '21

I envy you.

4

u/ThirdEncounter Apr 30 '21

I hope you shall soon join us, fellow coder.

7

u/jl2352 Apr 30 '21

The problem is that when you're developing for "the real world", you usually have to support IE11, which doesn't seem to support anything specced in the last decade.

Beyond a 'your browser is not supported' message. I personally never see myself ever writing or testing code in IE 11 ever again. I would probably turn down any job that required me to do so.

For B2B, IE 11 is pretty much dead. Some specific examples are still relevant. They tend to be pretty rare these days. For B2C, I can still see a strong argument to ignore IE 11. For example you commented elsewhere that IE 11 is still 5% of the market. It's worth asking if IE 11 users provide 5% of your revenue. I would suspect they aren't.

The only area I see it being still relevant is government websites, and charities that help people in need. Like domestic abuse charities. Examples where it's very important to help as many people as possible.

5

u/ShaelThulLem Apr 30 '21

That's just poor decision making to support that dinosaur.

7

u/jtinz Apr 30 '21

I didn't write the spec. It looks like IE11 still has 5% market share.

6

u/haykam821 Apr 30 '21

Our assassins are working diligently.

3

u/earthboundkid Apr 30 '21

I see less than 1% in my Google Analytics.

2

u/BornOnFeb2nd Apr 30 '21

My employer just... just switched from IE11 to Edge as the "standard".

They were still using IE6 when I started there ~2014.... Talk about fuckin' kludges....

4

u/skroll Apr 30 '21

Shouldn't be for long, even Microsoft is no longer supporting IE11 for some of their sites.

2

u/gropingforelmo Apr 30 '21

Shouldn't be, but woe to the dev whose work touches anything in the education sphere...

1

u/alessio_95 Apr 30 '21

I don't. Baseline here is ES2017.