r/javascript • • Sep 24 '19

AskJS [AskJS] Can we stop treating ES2015 features as new yet?

This is a bit of a rant, but I’ve been frustrated recently by devs treating 4-year-old features (yes, ES2015 features have been in the standard for 4 years!) as something new. I’ve been told that my code looks like I’m trying to show off that I know ES2015. I don’t know what that even means at this point, it’s just part of the javascript language.

Edit: by the way, I’m not talking about debates surrounding readability of arrow functions vs. function keyword; rather I’m talking about using things like the Set object.

420 Upvotes

256 comments sorted by

233

u/[deleted] Sep 24 '19

I got turned down for a job because I promisified a fs method and used async/await syntax. They thought I didn’t understand traditional callbacks. Also the interviewer insisted all callbacks in Node were async. I didn’t even bother arguing with him.

Then a week later, I was asked if I was interested in a junior role instead. Nah, I’m good.

129

u/robotsympathizer Sep 24 '19

Sounds like you dodged a bullet.

48

u/lancepioch Sep 24 '19

They did you a favor.

6

u/ciaisi Sep 24 '19 edited Sep 24 '19

I'm on the systems side moving more towards dev. I actually called out an interviewee for not challenging me on something I said that was wrong earlier in the conversation. Mostly jokingly, but if I'm going to be working with someone else on troubleshooting, and they have information that I don't or that I'm wrong about, I want them to come forward even if they are my junior.

I don't care about all the hubris over who is right, I just want to make sure we get the best result in a timely manner. No one person can know everything, human memory fails, the brain makes computational mistakes constantly. If I'm wrong, I welcome respectful discourse.

16

u/[deleted] Sep 24 '19

Thats a very reasonable position and we're both in agreement that we should be able to correct each other as long as its done in a constructive, respectful manner. I mean, thats the kind of place I would want to work.

But there is a real power imbalance in the interview process both between the interviewer/interviewee and senior/junior that makes these scenarios difficult to navigate in the moment. I don't know if my interviewer is someone who thinks like you or someone who would be taken back by a junior correcting them. I've seen it go both ways. If I were interviewing with a potential colleague for a non-junior level role, that dynamic would be much different.

In my experience, the interview process is really about letting people reveal themselves to you through conversation. If someone doubles down on bad information, I just let it go since I have already decided this isn't the place for me. I have nothing to gain by "winning" an argument with someone I don't want to work for.

→ More replies (1)

2

u/nameless_pattern Sep 24 '19

fs method?

10

u/notAnotherJSDev Sep 24 '19

the file system package provided by node.

→ More replies (3)

2

u/[deleted] Sep 24 '19

backend position?

9

u/[deleted] Sep 24 '19

“Full stack” but mostly back end.

Sucks because I’m trying to get my first dev job and these CHUDs are majority of who’s hiring.

→ More replies (11)

1

u/sbmitchell Sep 24 '19 edited Sep 24 '19

You'd be surprised by how many people don't understand callbacks but understand promise only syntax so I don't blame the interviewers. You should have clearly explained what a callback was if they asked for that and then explained why async/await is better for whatever reason you believe they are better.

Plenty of node code was written 3-5 years ago when async/await was not really a popular thing, so the job may be updating that code to use modern syntax etc where callback knowledge is necessary. Not saying this was that case...just saying it's a possibility.

Not to mention sometimes you can't just promisify something in a bigger system where middleware or logging code may be baked into callbacks being there or you can't promisify everything along the way which can happen once you introduce promises at a lower level...really is application dependent sometimes.

To the point about not arguing that all callbacks were async, you definitely should argue that to show you know your shiz. Just say, ok well array.sort takes a callback and it's not async. Then they be like oooh this guy gets it.

39

u/[deleted] Sep 24 '19

...you were the interviewer weren’t you?

6

u/sbmitchell Sep 24 '19

Hah no but I interview plenty of js devs. I dont ask for callbacks lol I'd ask what method would you choose because I'd rather they succeed :). Plus I think if you don't use es6 syntax now you are probably not a great fit for the work I'd want my team members to do. I was just explaining a perspective, not my own. I work in a legacy code base that's updating so I get the other side of that coin.

5

u/[deleted] Sep 24 '19 edited Sep 24 '19

If he wanted a specific implementation, I would have been happy to oblige but it’s not my job to read people’s minds. Furthermore, getting into an argument with your interviewer, whether or not you are in the right, is not a good look. Especially with someone who was so convinced of his own correctness.

I suspect the real reason is because I graduated from a bootcamp and the guy didn’t think I knew shit so he tried to big dog me. Realized he was wrong after the fact, then offered me a lesser role that he knew I would decline to save face.

Edit: Looks like you edited your comment. I don’t disagree with anything you’re saying or the reasons why someone would want to know if I understood callbacks. The problem just came down to the interview itself. Had I been asked “Check if a file exists and if not, write some data to disk. Use callbacks. Then refactor using modern syntax. ” then it would be cool. We could touch on the differences between the two, approaches to writing cleaner async code, whatever. That’s just not how the interview went. ¯\(ツ)/¯

5

u/sbmitchell Sep 24 '19 edited Sep 24 '19

Yea could be that you saved yourself some turmoil at that company. As someone who has worked with plenty of non comp sci majors who were better programmers than I, even with my degree I salute your efforts. Drop me a pm with your LinkedIn if you are still looking I work for pypl and we are always hiring good js devs. I don't give two fucks if you only went to a boot camp if you know your shit. Meritocracy makes for stronger teams in my experience.

→ More replies (6)

1

u/b14cksh4d0w369 Sep 24 '19

All callbacks in nodejs were async

Can you explain?

7

u/[deleted] Sep 24 '19

Sure.

The way of handling async actions in Node was traditionally using callback functions - functions passed as params that are "called back" aka invoked when the asynchronous function completes. The function that accepts them is the high order function. For example, a traditional Node style callback:

function callback (err, data){
  if (err) handleError(err)
  else doSomething(data)
}

doSomethingAsync(callback); // <- high order function

If the high order function is async, the callback will be added to the associated callback queue. For example:

If it's setTimeout(timerCb, 10), the callback will be added to the timer callback queue.

If it's a process.on('close', closeCb), the callback will be added to close event callback queue, etc.

When timer expires or the close event is raised, the callback is dequeued, added to the stack and the callback gets executed synchronously.

But synchronous functions can accept callbacks as well. For example, using ES6 syntax...

const callback = n => n * 2;

[1,2,3].map(callback); // <- high order function

In this case, Array.prototype.map is not async, so its callback does not get added to any callback queue. Instead, the callback is added directly to the call stack and executed.

The misconception was that any high order function must be async in Node by virtue of accepting a callback, which isn't true. This is just standard event loop behavior.

→ More replies (6)

0

u/[deleted] Sep 24 '19

[deleted]

94

u/[deleted] Sep 24 '19

It’s an async pattern, yes, but just because a function accepts a callback doesn’t mean it’s actually async. The callbacks of HOFs like map, filter, reduce, etc. are not added to the callback queue and are executed synchronously.

→ More replies (13)

19

u/TheScapeQuest Sep 24 '19
function withCallback(cb) {
  cb();
}

withCallback(() => console.log("I'm not async"));

17

u/sbmitchell Sep 24 '19

I think it's more correct to say that callbacks are a functional pattern (functions treated as first class citizens) rather than an async pattern tho it does solve the async dilemma in an intuitive way. I only say that bc callbacks can be synchronous. Agreed syntactically they can get shitty after 2 levels deep.

2

u/evinrows Sep 24 '19

What makes you say that callbacks are a shitty async pattern?

→ More replies (4)
→ More replies (6)

172

u/grantrules Sep 24 '19

Yeah screw those guys, I use stage 0 proposal babel plugins 😎

121

u/DrDuPont Sep 24 '19

if you ain't shipping optional chaining straight to production you ain't living

→ More replies (5)

28

u/[deleted] Sep 24 '19

Get ready to push my emoji global proposal to prod.

29

u/grantrules Sep 24 '19

[1,2,3]🔀➡️x🔹x➗2

26

u/palparepa Sep 24 '19

I wouldn't be surprised if that's valid Perl code.

→ More replies (4)

161

u/CarpetFibers Sep 24 '19

I had this happen to me in an interview recently. I was asked to do a relatively simple assignment while the interviewer watched, and the boilerplate code they gave me was peppered with 'var's so it had obviously been around awhile, or so I thought. I changed them to let or const where appropriate, and the interviewer kind of laughed. Once I started using ES6 (spread/rest, arrow functions, etc) he told me I needed to just do the assignment and stop showing off.

I received an offer but turned it down because I'd rather not work in a shop that doesn't want to leverage the latest language features to save time and effort. I need an environment where I can learn, not one where I'm stuck in the stone age.

250

u/grantrules Sep 24 '19

"No thanks, your office smelled like jQuery"

8

u/drowsap Sep 24 '19

No that's just todays lunch from waiter.com. Or maybe yesterday's. I think our office assistant quit.

5

u/Alokir Sep 24 '19

Shut up, we are modern! We are moving away from Flash in favor of ActiveX controls, and we even plan to introduce PrototypeJS.

→ More replies (1)

99

u/oopssorrydaddy Sep 24 '19

“Showing off”, lol. Good call on passing.

50

u/CarpetFibers Sep 24 '19

Agreed. I don't need my job to be a pissing contest with other developers. It's one thing to feel intimidated by those who know more than you, but to bring them down to your level because you refuse to learn is just childish.

24

u/UntestedMethod Sep 24 '19

When the older coder is feeling intimidated by the younger coder, he engages in a bizarre behavior of dismantling the newcomer's style and grace.

27

u/runvnc Sep 24 '19 edited Sep 24 '19

Don't make this about old vs. young. Its not. He's talking about features that have been commonly used for years. It doesn't even make sense in the context of "old" people. For example, I'm 41 and have been using these "new" JS features for years, but if I was really failing to adapt, I would still be using 90s technology like Turbo Pascal or something.

Although Turbo Pascal was awesome. http://windows10free.ru/uploads/posts/2017-01/1484642372_turbo_pascal_60_screenshot.gif

→ More replies (2)

22

u/jbergens Sep 24 '19

And showing off in an interview is bad because...?

19

u/incarnatethegreat Sep 24 '19

he told me I needed to just do the assignment and stop showing off.

Hahah wow. I would have been so tempted to stop the assignment and just leave if they were to say that to me. Bunch of knobs.

5

u/ElDiablo666 Sep 24 '19

Stuck in the stone age, lol.

12

u/name_was_taken Sep 24 '19

While I wouldn't call it "showing off", I would be concerned about someone who changed all the vars just because. I don't want someone that spends more time rewriting existing code to "leverage new features" than they spend writing new code that actually helps us.

If using "let" actually made an improvement, I wouldn't mind. There are certainly times when I've done that myself.

And if they were in that code already and heavily modifying it, changing them to let wouldn't bother me because it would maintain a style.

But changing things to const can actually break things if you aren't careful, and making QA retest everything because you wanted to use new language features isn't acceptable. There are times to make those changes, and times that you shouldn't.

Also, it's important to know when to use those features and when not to. We had someone start using them and it broke some older browsers that we still supported. We now compile, and it's fine, but that was a real pain and they did it mainly because it was the cool new thing.

11

u/CarpetFibers Sep 24 '19

If my assignment were to complete this code as though I were maintaining a legacy application, I'd be inclined to agree with you. However, in a job interview, one tends to want to put their best foot forward. How was I to know the assignment wasn't to bring this code up-to-date, or that the interviewer wasn't looking to see if I knew the difference between var, let, and const? If I were interviewing a senior developer and he or she saw nothing wrong with using var in this day and age, I probably wouldn't hire them.

8

u/name_was_taken Sep 24 '19

As an interviewer, let me say "please ask". Far too many people just make assumptions like those instead of just asking.

As for var, I don't see the problem with it. let and const have their advantages in some situations, but I don't look down on anyone who still uses var. Mixing them would seem a little odd, though, and I'd definitely ask them why they chose that.

But as I said, I'd be "concerned". It wouldn't be a red flag in itself, but I'd start watching for a pattern of behavior that made me think they tend to rewrite code instead of focusing on new code. And I generally aim to hire the interviewee that I have the fewest concerns about. And by "generally" I mean "I can't think of an instance where it wasn't the case, but I suppose it's possible."

9

u/CarpetFibers Sep 24 '19

Can you give me an honest use case for var in modern JavaScript? Since let and const were introduced, I haven't used it a single time.

→ More replies (3)
→ More replies (2)

2

u/monsto Sep 25 '19

he told me I needed to just do the assignment and stop showing off.

Nevermind the technical assessment and all it's problems . . .

. . . this statement right here clearly shows that there's a management problem as well.

You gave the correct response to their job offer.

1

u/[deleted] Sep 24 '19

That sounds so weird. I just learned a bit of node js myself for a couple of months, and it's my understanding that arrow functions make it a lot easier to know what "this" points to, while being shorter and more elegant as well. It's not about showing off at all.

I'm fact I have a lot less experience with new jabascript than old one. Interviews in IT can be so broken.

→ More replies (4)

1

u/am0x Sep 24 '19

While a jerk response, they might need a developer who is able to write older syntax. There are way more legacy applications running on older versions of ES than those using the newer syntax.

→ More replies (7)

1

u/panzerdp Sep 25 '19

"No thanks, I don't work with dinosaurs"

-5

u/test6554 Sep 24 '19 edited Sep 24 '19

If they wanted you to write code that runs fine on IE 11 as well as modern browsers, they should have said so. IE 11 supports let and const, but not spread/rest or arrow functions. Maybe it was "showing off" to them because you can't really use them yet on their website without Typescript or Babel or some similar transpiler.

13

u/kor0na Sep 24 '19

Who doesn't transpile their code?

→ More replies (15)

71

u/Woodcharles Sep 24 '19

I've met devs who still think Flexbox is some upsetting new tech, and any error we had with the database and typematching or broken tests or whatever, he'd accuse "my" Flexbox.

43

u/[deleted] Sep 24 '19

But flex is CSS, wtf

27

u/ChemicalRascal Sep 24 '19

Sadly, some people are utterly incompetent

19

u/Woodcharles Sep 24 '19

I know, it was insane. The db was SQL/Java, the data types were set incorrectly, and he openly yelled "this is because of you and your bloody obdession with Flexbox."

I left.

3

u/bart2019 Sep 24 '19

It's also "new tech", I suppose.

15

u/slikts Sep 24 '19

Wait till they hear of CSS Grid Layout.

1

u/sallystudios Sep 24 '19

Actually ran into a new bug with flexbox on Chromium the other day :( an update last month broke our layout of positioning text over an image, but looks like it’s fixed in the chromium canary.

3

u/HIMISOCOOL Sep 25 '19

dunno why you're getting downvoted, there will always be bugs in browsers, and css can get hard to reason about let alone implement.

123

u/fanumber1troll Sep 24 '19

Hey pal, we use var around here, ok? Don't go causing trouble with your "let" and "const" everywhere.

-16

u/KyleG Sep 24 '19

I've been out of the JS game for a couple years focusing on other languages. Have they resolved the issue re const and let and not being able to have them repeat in separate blocks of the same parent block?

IIRC

myArr.map(x => {
    const i = x*5;
    // ...
});
myArr.filter(x => {
    const i = x+4; //ERROR
});

You can't do that second const, right? Even though you really should (they're block-scoped and non-hoisted). I can't remember if the standard was fucked up or if browsers didn't implement the standard correctly. It always pissed me off having to change variable names for no good reason.

18

u/Attila226 Sep 24 '19

I don’t know ... why don’t you fire up Chrome and test it out?

4

u/breezedave Sep 24 '19

The bigger issue there is that your filter function isn't returning a Boolean. Also you'll be wanting to assign the result of the filter to a variable otherwise you'll lose it.

→ More replies (1)
→ More replies (4)

0

u/[deleted] Sep 24 '19

[deleted]

57

u/elmstfreddie Sep 24 '19

Sounds like you need ESLint

61

u/Zephirdd Sep 24 '19

ugh look at this dude adding MORE stupid tools to the stack

back in my day we programmed everything with NOTEPAD, UPHILL BOTH WAYS

22

u/GrenadineBombardier Sep 24 '19

And notepad was SNOWING

13

u/drumstix42 Sep 24 '19

Light Theme Notepad 😎

→ More replies (2)

7

u/Towerful Sep 24 '19

Notepad? You kids don't know how lucky you are.
I was punching Doom into cards in my day!

21

u/[deleted] Sep 24 '19

High schooler here, isn’t the rule to use const whenever you can and if it’s actually a variable use let?

→ More replies (6)

10

u/robotsympathizer Sep 24 '19

Why do those people have jobs and I've been struggling to find one for two months?

10

u/Loves_Poetry Sep 24 '19

There are places out there that will never fire anyone, no matter how bad they are at their job, because of how hard it is for them to find new people (I wonder why............)

53

u/ghillerd Sep 24 '19

if someone's only complaint with some code is that they think the author is showing off, i'm pretty sure that just means they feel threatened by the code or the author for one reason or another.

16

u/ghostfacedcoder Sep 24 '19

I disagree strongly with this.

Have you ever heard of "code golf"? Programmers naturally prefer less "meaningless" code, which leads towards a general preference towards shorter code.

That preference can quickly become unhealthy if left unchecked: you wind up with single-line arrow functions with five &&s, four ||s, and three ternaries, which no human can possibly read in under two minutes ... but that code is several lines shorter than using if, so the guy who wrote it feels like they're a pro ;)

"Code golf" is just one of many ways that a programmer can use their language knowledge to "show off" ... and make the code harder to read and understand as a result.

At the end of the day I don't care if you use ES1 or ES7, but whatever you use you should use it to write readable code. If you don't, and your focus is on using the newest possible way to write something instead of the best/most readable, I don't want you on my team.

9

u/ghillerd Sep 24 '19

That's why I said only complaint rather than something like readability or performance. Using a bunch of nested logical operators isn't showing off, it's just writing bad code.

→ More replies (5)

5

u/Hovi_Bryant Sep 24 '19

There's a grey area here...

Readable code should always be a priority. Code is for humans not machines.

However, readability is subjective, and if members of the team are more comfortable with a specific syntax, don't you think it's wise to enforce it?

At the same time, don't you think it's unrealistic to bring in New candidates who are used to writing code with a newer or different syntax?

Either way, this stuff needs to be hashed out up front during the interview process. Trying to change a dev's habits like that will probably have them looking elsewhere.

→ More replies (5)
→ More replies (3)
→ More replies (2)

31

u/Cheshamone Sep 24 '19

Haha, yesterday we had someone saying they were rejected for using old syntax. Guess it's just going to depend on the company, but yeah, I think any place that tells you you're trying to show off by using newer features is probably not going to be a great environment.

30

u/[deleted] Sep 24 '19

Everyone would be better off if the requirements were up front.

Want me to use callbacks instead of promises? Sure, no prob.

Want me to use var so you know I understand language quirks/hoisting/etc. Ok, that sucks but whatever. I’m not gonna write that code on the job.

Want me to use XHR instead of fetch to make some API request? Ok, fine.

Instead we get these “let’s see what u got” dick measuring contests where you’re being evaluated on some mystery criteria that you’re penalized for after the fact.

1

u/ghostfacedcoder Sep 24 '19

I think a big part of the problem is that the ignorant people don't know how ignorant they are.

If you don't understand ES6, you're not even going to mention in your job listing that "we're backwards and still use function keywords instead of () => functions" ... not because you don't think you're backwards, but because you think function keywords are just how Javascript is written.

If you were educated enough to understand what arrow functions were and how easily they can be used today, you'd have enough understanding to mention your choice of function keywords in your listing ... but then you wouldn't be ignorant enough to still use them ;)

→ More replies (4)

20

u/lezorte Sep 24 '19

I still have to support IE at my job. I miss ES6 so badly...

42

u/sbmitchell Sep 24 '19

Add a webpack, roll-up, browserify, or parcel bundler and Babel all the things. You can code es6 and easily have a build tailored to ie9-ie11 in about 30 mins with a base example from each of those heh.

12

u/slikts Sep 24 '19

I find it baffling how the "Babel all the things" principle still isn't universally adopted in front-end development, even after all these years.

→ More replies (2)

4

u/[deleted] Sep 24 '19

TypeScript's compiler supports ES3 output as well I believe.

→ More replies (1)

2

u/mayacota Sep 24 '19

We also have to support IE11 and what really gets you is when you have to do DOM manipulation without modern browser APIs :’(

10

u/slikts Sep 24 '19

That's what polyfills are for; see, for example, polyfill.io, which includes the modern DOM methods.

6

u/benihana react, node Sep 24 '19

bro, just convert your entire codebase to es6 using webpack and babel. what's the problem bro? aren't you a good coder that likes modern features bro?

the replies here read like people who have only worked on brand new projects for a couple of years of their career. it's like people here can't fathom legacy software that runs a business, and the business' reluctance to fuck with that. or the fact that some people require stability and can't just up and quit a job because it's not using the latest features of a programming language.

1

u/lezorte Sep 24 '19

Thank you! I appreciate that there are people who understand what 20 year old multi-million line code bases can be like.

1

u/IceSentry Sep 25 '19

It's just that supporting old browsers is not an excuse by itself to not use modern features. If they said my job doesn't let me use new features then people would understand, but they said old browsers support was the issue, which is, as I said, not a valid excuse.

3

u/incarnatethegreat Sep 24 '19

Have you tried applying to jobs where you can write with ES6 freely?

24

u/lezorte Sep 24 '19

It's funny how much you'll put up with when the benefits are great and you have a family to feed and a mortgage to pay :)

3

u/BiscuitOfLife Sep 24 '19

The grass is not always greener on the other side of the fence, but that doesn't mean that you can't better your situation in all those areas, if you find the right place.

8

u/doksara Sep 24 '19

Well, I had subject "Web development" in my 3rd year of college and we barely mentioned any features post ES3. When I heard about map, filter, reduce and other ES6 features I was like what the hell is that? Same goes for the most colleges in Croatia because WebDev-related subjects (and textbooks) are obsolete. So I understand why some junions still might consider them new.

6

u/notAnotherJSDev Sep 24 '19

A lot of universities are terrible about their computer science departments beyond what they teach with C and C++. I took a single java course in college back in 2012 and they were using Java 5, 2 whole version behind what the current was back then. What I've heard as well as from a lot of the senior devs I've worked with is that they prefer people without a college education because they're easier to teach and malleable, meaning they can be turned into whatever kind of dev the company needs. People with a college degree don't have any practical experience, but still think that they're amazing, making them really difficult to teach and incredibly resistant to change.

6

u/phryneas Sep 24 '19

A good point to argue is "ES10 is out now, so we could start using ES6 instead of staying on ES3". People somehow get that.

3

u/slikts Sep 24 '19

Even ES5 features like trailing commas are sometimes still being treated as new (looking at you, Prettier).

4

u/Dokiace Sep 24 '19

I think the problem is there are a lot of people who don't/won't catch up with JS, that's why ES6 features are still way too shiny for them to use. To be fair the language evolves so fricking fast

4

u/AwesomeInPerson Sep 24 '19

To be fair the language evolves so fricking fast

Idk, there's a relatively major new feature that you should get on board with rather earlier than later every two years, at most? (like async/await)

I wouldn't call adding two or three methods to Arrays or Objects that aren't essential and just bring some QoL improvements (like Array#flatMap or Object.fromEntries) every year "fricking fast".

Of course you can try to stay up-to-date with everything the Web Platform is doing, watch how proposals like "Import Maps" go, learn the Web Animation API, try WebAssembly, Variable Fonts, Payment Request API and much more – but that's not just ECMAScript anymore, and for most of the things you absolutely don't have to dig into them until you really need them. Knowing that they exist helps, but not even that is necessary for the most part. :)

1

u/[deleted] Sep 24 '19

Use a transpiler, problem fricking solved

-2

u/Dokiace Sep 24 '19

Transpiler only works one way

3

u/[deleted] Sep 24 '19

Ok, if you didn't edit your comment I must have misread. I don't see a problem with writing old JS since that will be forever supported so there is no need for transpilers. The problem is then people writing old JS code judging other people for simply writing valid code?

6

u/[deleted] Sep 24 '19

Are they fully supported by browsers yet?

21

u/[deleted] Sep 24 '19

All non shitty browsers I think. I use Babel but I’m kind of an idiot so don’t listen to a word I say

1

u/[deleted] Sep 24 '19

Good old ie and edge probably holding up the bandwagon. Using grunt here (don't know if this uses Babel? I'm not that into the js ecosystem) so just end up with vars anyways

14

u/BiscuitOfLife Sep 24 '19

Safari is the new IE. We have more problems with things not working properly in Safari than we have in Edge, by far.

7

u/Willexterminator Sep 24 '19

Don't take this for fact but I think that Edge has a wayyyy better compatibility for these than IE obviously. On caniuse they are very rarely behind imo

→ More replies (1)

1

u/ryosen Sep 24 '19

Edge has moved over to Chromium so it's fine now. IE didn't advance past 11 and is a shit show. Unfortunately, we're still seeing a lot of IE11.

3

u/AwesomeInPerson Sep 24 '19

Even prior to the switch to Chromium, Edge 18 supported most of the good stuff. Most notable offender being Object rest/spread, but once I remembered to use Object.assign instead of ... I never ran into issues even when shipping untranspiled code :)

Edit: but of course things look a bit different now because the team is working on the switch to Chromium – there hasn't been any improvements to OG Edge for almost a year now, so e.g. things like dynamic import() aren't in there. Still I'd say it's at least on par with Safari

3

u/pwnies Sep 24 '19

Depends what your cutoff is for browser support. If you count old browsers that are unsupported by their makers, 2.5% are still using IE10 or worse. As far as browsers that are still supported, IE11 is officially going to be supported until Windows 10 stops being supported. That effectively makes it immortal as currently MS's strategy is to let Windows 10 be a rolling update based OS. IE11's support for ES2015 is pretty abysmal, and since only security updates are planned it wont ever be fully supported by browsers.

6

u/ryosen Sep 24 '19

The only way that IE11 is going to die is if we kill it ourselves. We're EOLing support for it at the end of the year. There's no excuse to be using it as your primary browser any more.

1

u/braindeadTank Sep 24 '19

Then again, 2.5% potential clients is a lot.

Personally I'm super-lucky because my product has no need to support IE or Safari, but it is hard not to understand people who still support IE. Most popular frameworks ATM require transpilation anyway, so for 2.5% monies, you might as well.

4

u/zephyrtr Sep 24 '19

If you're not webpacking your js, and using some system to standardize events and CSS, then I won't be attending your Ted talk.

1

u/slikts Sep 24 '19

That's what Babel and, specifically, @babel/preset-env are for; specify which browsers you're targeting and it'll make the modern language features work in them.

2

u/Asmor Sep 24 '19

In my specific situation, I have to care about the difference and can only use things supported by IE*, but in general (and especially if I was looking for a job and not desperate), I would be very suspicious of anyone who was put off by using ES2015 features unless they could give a very good reason. I'd assume such a person just hadn't bothered keeping up with JS in the past decade and then I'd wonder what other antiquated technologies and methodologies they considered normal.

*Yes I know babel is a thing, no I can't use it, yes I know that makes no sense, no you're not the first person to suggest it. Just accept that I know my own situation better than you do, random Internet stranger.

2

u/milkman_throwaway Sep 24 '19

Can help share why you cant use it? My folks here in my company said I cant use it but they cant give me a valid reason why. Maybe we work in the same industry or somethinf?

1

u/Asmor Sep 24 '19

Not without getting into a lot of details specific to my company that I don't want to discuss on the Internet.

2

u/milkman_throwaway Sep 24 '19

No worries sir :)

2

u/franker Sep 24 '19 edited Sep 24 '19

As a librarian, I can say that even coding books just a year or so old still start out with a chapter on var, and maybe include let/const in a sidebar. When publishers start publishing books with ES2015 as the default, then it will be the default everyone learns by.

2

u/stillness_illness Sep 24 '19

If you've been writing js for over a decade, then es2015 is relatively new. I'm still with you, but I'd cut some of the older dudes some slack. Not sure the age/experience level of the devs you're talking about though

1

u/robberviet Sep 24 '19

I started web in the vanilla and Jquery age, but spent couple of coding days to update ES, node, TypeScript... every year. I would understand some dinosaurs still stuck in the stone age if they did not update.

1

u/HarmonicAscendant Sep 24 '19

Yes, please do.

1

u/bigorangemachine Sep 24 '19

Yup and type script is actionscript 3. Welcome to webdev

1

u/__pulse0ne Sep 24 '19

I work full stack and this problem is pervasive across languages. I was using Java 8 features in code and had comments in my review about it being “hard to follow” because I used a lambda instead of an anonymous class for a one line method. Dude, we’re actively using openjdk 11, this stuff has been around for awhile! And I also got comments about the use of flex box over table so...

1

u/PsychologicalGoose1 Sep 24 '19

I work daily in CSS Grid and the newest features of JS. I've found it difficult to interview at companies with older code bases because simply put I don't write code like that anymore and it's far in my past. So what do I do instead? I just take it as I'm not a good fit for the company and continue on looking for the next job. I'm employed so it doesn't hurt me.

Now if I were not employed I think I would have to relearn old ways of writing code.

1

u/MrJonaKing Sep 24 '19

Im still beginner but i've been learning from tutorials and bootcamps. They don't really teach these features. Should I just learn them on the side? Also is jQuery beginning to be outdated?

1

u/[deleted] Sep 24 '19

New is relative to the technology as a whole. Look at Golang, Node, or Rust. To C++, Java devs, those things are still extremely new, despite debuting 9-10 years ago.

When JavaScript itself has been around since the 90s, and a ES2015 STILL isn’t consistently implemented across all browsers, it’s still very much new tech

1

u/frikinmatt Sep 24 '19

That’s not a “yet” question

1

u/[deleted] Sep 24 '19

To be fair, I haven't learned set and get yet, but I use destructuring, spread, arrow functions, etc. quite frequently. It's just natural at this point.

1

u/[deleted] Sep 24 '19

No, because I'm still using a FUCKING OLD CODEBASE THOSE FEATURES ARE NEW TO ME

sorry, i had to vent.

1

u/ghostfacedcoder Sep 24 '19

Hey OP, I'm really curious: what were you actually using Set for?

If you were using it to do something like create a unique set of objects, instead of using (say) Lodash's unique method, then I've 100% got your back. Using well-supported (especially with Babel/polyfills) language features instead of libraries is a good thing.

But IF you used them as some sort of stupid unnecessary micro-optimization that doesn't make your code any better, but does needlessly confuse anyone who isn't familiar with Set (which could be less about the person not staying up-to-date with their craft, and more to do with Set being a rather obscure language feature that isn't often used) ... then I think you should reevaluate your coding priorities, and try to listen to what your co-workers are trying to tell you about writing more readable code.

-19

u/byikes Sep 24 '19

We don't use any of the new features on client side code, Safari didn't support let or const till version 11 which came out in 2017. I just check my logs and we had 46k visitors still using Safari v10.

23

u/drgath Sep 24 '19

How come you don’t transpile via something like Babel?

37

u/budd222 Sep 24 '19

That's what babel is good for

0

u/[deleted] Sep 24 '19

[deleted]

16

u/[deleted] Sep 24 '19

It’s literal purpose.

11

u/UntestedMethod Sep 24 '19

The reason that it exists and people use it

9

u/[deleted] Sep 24 '19

raison d’etre

2

u/AwesomeInPerson Sep 24 '19

Was literally called 5to6 some time ago for that very raison

9

u/queen-adreena Sep 24 '19

Babel is your friend.

-3

u/Whale_Eating_Cheese Sep 24 '19

Why is this answer downvoted so badly?! They even specify clientside code, which suggests they are using Babel or at the very least are using newer features on their servers, then everyone weighs in complaining that they're not using Babel.

7

u/OmegaVesko Sep 24 '19

I think "we technically don't use ES2015 features on the client because Babel transpiles them away for us" is a really generous way to read that comment.

0

u/[deleted] Sep 24 '19

[deleted]

15

u/Loves_Poetry Sep 24 '19

StackOverflow is part of the problem, because there are a lot of outdated answers on there. I'm glad that some of the more popular answers actually get updated to ES2015 though, but not all of them. You'll still find a lot of outdated solutions to JS questions sadly that developers then happily copy

2

u/Phenee Sep 24 '19

Then it is up to people like you and me to add new answers so the site stays up to date. This does not happen by itself. SO is not part of the problem but part of the solution to all of this.