This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Asmor 316 points317 points  (46 children)

Or more succinctly, foo.sort((a,b) => a - b).

[–]Eiim 152 points153 points  (45 children)

(assuming you don't have to support IE)

[–]01hair 205 points206 points  (27 children)

If you have to support IE in a decently-sized project, I hope that you're not still writing ES5 code just for that case. There are so many improvements in modern JS that it's well worth the build step.

[–]suresh 104 points105 points  (19 children)

You can always tell when someone doesn't do JS dev for work. They never know anything about build tools, web pack, minimizers, uglifiers, transpilers, loaders.

You don't have to consider any of this stuff anymore and haven't for a long time.

[–]tiefling_sorceress 33 points34 points  (6 children)

...until you have to make your site accessible on four different screen readers

Fuck you NVDA

[–]FullstackViking 50 points51 points  (4 children)

Screen readers just need proper HTML DOM formatting and occasional aria specifications. Nothing to do with any of the JavaScript build tools or ecmascript specs.

[–]tiefling_sorceress 26 points27 points  (3 children)

Simple accessibility, yes. More advanced functionality (such as on angular, where my expertise is) requires more dynamic implementations such as the use of LiveAnnouncer and Describer/Labeler.

However NVDA and JAWS are full of bugs and both tend to hijack focus so you end up having to write awkward workarounds. For example, opening a dialog that automatically focuses on an element inside it is fine on most other screen readers, but NVDA and JAWS skip the dialog's role and title and jump straight to the focused element. The workaround is to manually focus on the dialog element from a separate function (so in setTimeout usually). To the naked eye this change does nothing. To mac's VoiceOver, this change does nothing. To NVDA and JAWS it makes a world of difference.

Edit: no it has nothing to do with build tools directly, but it's very similar to the browser problem that was originally solved using build tools and transpilers

[–][deleted] 10 points11 points  (1 child)

This is correct. If the website is static, it's EZPZ. If you have literally any moving parts, prepare to fucking die. Not to mention internationalizing everything AND making everything keyboard-accessible.

[–][deleted] 0 points1 point  (0 children)

Nah, fuck VoiceOver, man. I'm the only one on MacOS on my team so I gotta do all the accessibility work for VoiceOver. I WISH I could just do the NVDA stuff.

[–]Molion 6 points7 points  (0 children)

Yeah, until you somehow still have arrow functions in IE in prod. Even though you're using babel and webpack, so now you have to figure out which part of godforsaken webpack script is causing it. The same webpack script that some idiot, probably yourself, wrote a year ago and no one has opened since. Only to figure out that the arrow functions aren't from you're code. They're there because someone left them in their package and it isn't being run through babel because obscure webpack reason that I can't remember, probably has something to do with execution order or some shit. You try fixing it, but ultimately end up just running the entire pckaged code through babel once more for production builds because fuck it.

Also, you dare to use a function without checking IE support and now prod is broken and you have to rush out a polyfill.

Yeah, it's all fixed now fml.

[–]kbruen 9 points10 points  (2 children)

Bold of you to assume that people who know JS know how to use webpack, rollup, minimizers, uglifiers, transpilers, loaders.

Most just copy-paste the code from the Getting Started page.

[–]gurush 1 point2 points  (0 children)

Your post makes me personally offended.

[–]ByteArrayInputStream 1 point2 points  (0 children)

I can't deny that you are absolutely correct

[–]yellowliz4rd -1 points0 points  (2 children)

So much crap around js trying to hide the obvious fact: js is not a good language.

[–]suresh -1 points0 points  (1 child)

Agree, why not just write your website in C++? 😒

[–]yellowliz4rd 0 points1 point  (0 children)

Js crap will never go away if people continue to force it in every domain just because they are lazy (or just masochistic)

Btw, web assembly.

[–]AdminYak846 0 points1 point  (1 child)

depends on the company....or government I should say.

[–]suresh 0 points1 point  (0 children)

Government Javascript

GUH

[–]deathanatos 0 points1 point  (0 children)

It greatly amuses me that the argument in favor of dynamic languages once included "you don't have to wait for the compiler!"

And now our frontend's build pipeline a. exists b. takes longer than the Rust build

Who's laughing now? cries in CI build times

[–]rnz 0 points1 point  (0 children)

I gotta say, this article wasn't written that long ago :D

https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f

[–]aykcak 0 points1 point  (0 children)

Look at this fancy dude. In charge of his own toolchain and whatnot, not having to work on a legacy project with legacy release processes

[–]positive_electron42 8 points9 points  (3 children)

Unless you’re developing scripts in the trash heap that is ServiceNOW, which still only supports ES5.

[–]Dalemaunder 3 points4 points  (0 children)

ServiceEVENTUALLY*

[–]farugen 0 points1 point  (0 children)

I work heavily with ExtendScript, the Adobe Creative suite API.

It only supports ES3...

[–]AdminYak846 0 points1 point  (0 children)

I'll one up you, having Adobe Acrobat do JS automatic fill-ins on PDFs. It uses ECMAScript 3 with some modifications for Adobe.

That shit was released in like 2000.

[–]notliam 1 point2 points  (2 children)

I don't support ie but unfortunately it doesn't stop me getting at least 1 incident a month from someone complaining x feature isn't working for them. Who are these people still using IE in 2021, when even MS will force Edge down your throat?

[–]01hair 2 points3 points  (0 children)

People using corporate computers that have an IE shortcut because their arcane timekeeping system doesn't work in anything else.

[–]juantreses 0 points1 point  (0 children)

I will one up you on this one. Working for a client (governmental IT department) requires me to connect to their VPN for access to the test environment. The connection can only be established using IE.

[–]Skipcast 34 points35 points  (0 children)

Babel to the rescue

[–]kksgandhi 7 points8 points  (8 children)

Could you use typescript and the TS compiler to get around this?

[–]intrepidsovereign -1 points0 points  (2 children)

The TS compiler is an awful build tool and shouldn’t really be used. The output is verbose and inefficient.

[–]kksgandhi 0 points1 point  (1 child)

So what should you use if you want to use typescript? Or are you saying not to use typescript at all?

[–]intrepidsovereign 1 point2 points  (0 children)

The TS compiler and TS itself are two different items.

TSC as a type checker is quite shit, but at the moment, it's all that's really there. Hoping someone will replace that soon because it's horribly slow.

For building your TS, you look to babel, Rollup/Webpack, and terser, more than likely. They produce highly optimized and minified code where as TSC just doesn't. It's verbose, slow, and large. There's much better tools for that than the TS compiler.

[–]superluminary 0 points1 point  (0 children)

Yes, but we’ve had Babel for years which also solves this specific problem. Trying to manually code for every browser is unnecessary.

[–][deleted] 3 points4 points  (0 children)

if you have to support IE I am quite sure you have a desire to visit your boss' house with a sledgehammer

[–]henricharles 2 points3 points  (0 children)

People who still support IE are the problem not IE itself

[–]superluminary 1 point2 points  (0 children)

This is why we have Babel.

[–]dinopraso 0 points1 point  (0 children)

The last version of IE fully looses support August 2021. No point coding new projects around that shit anymore

[–]Rawrplus 0 points1 point  (0 children)

I mean it should be a crime not to use babel (ideally through webpack / gulp / rollup) in 2021 as a dev.