text stringlengths 0 1.36k |
|---|
**Alex Sexton:** No, what I'm saying is that if you use arrow functions, the functions can't be rebound. It's guaranteed to be lexically bound, whereas if you use just the class syntax, it more mimics using the function keyword, and then using this will default to the right thing probably, to what you want. But pulling... |
So there are still gotchas if you use the class syntax. You could still go further and say "I still want to use arrow syntax inside of my classes", if that makes sense. |
**Mikeal Rogers:** Yeah, I guess you could... |
**Alex Sexton:** And I think if you are going to say "We require arrow functions everywhere they can be used", you should also require them in classes, too. So rather than saying "function name(arguments)" and then brackets with the function, you should say "function name=(fatArrow)" brackets, if that makes sense. |
**Mikeal Rogers:** Yeah. I don't think that the point that any of these people are trying to make though is to be zealots about arrow functions. I think the point that they're making is that we can deprecate the use of the "function" keyword and just rely on these numerals, and then we get out of a lot of ambiguity if ... |
**Alex Sexton:** I think I disagree on what those people -- at least the people I've talked to who are doing this aren't necessarily... They're not doing it just because they think it looks better or it's smaller or it's more streamlined or anything like that; they're explicitly doing it because the lexically bound amb... |
**Mikeal Rogers:** Okay. Transitioning a little bit... We're talking about all these features, and my assumption is that we're talking about using them without a compiler, and I think that that may not be your assumption. I'm wondering, where do you have to have a compiler done to ES5 to use this stuff right now? Are t... |
**Alex Sexton:** \[11:59\] Yeah... IE9 doesn't -- IE10 and IE11 get into some of the territory, but still are missing quite a bit. I think the problem is that -- and Babel is perfectly capable of doing this, it's just somewhat uninteresting to try to solve unless there's a performance problem... But if you think about ... |
**Mikeal Rogers:** This isn't my thinking at all, though. I don't know if Rachel feels similar to this, but I don't use a compiler, like ever, for down to a different language. I only use browsers that support this, and if it's a feature that isn't widely available, I just don't use that feature. |
**Rachel White:** Same. I don't. |
**Mikeal Rogers:** Yeah, yeah... |
**Alex Sexton:** I think you guys are definitely the minority. |
**Mikeal Rogers:** That seems a little nuts to me. I really enjoy line numbers and all the simplicity of not having it... |
**Alex Sexton:** Well all that works... |
**Mikeal Rogers:** Well, yes... Provided that you have all that tooled properly, and it can be kind of a pain. Look, if you're gonna use Babel, then you're already in this -- or sorry, if you're gonna use React, you're already in this, right? So there's enough people using frameworks or other upper-level tools where th... |
**Alex Sexton:** I think a lot of people do that. I think it's pretty common these days to just start your project writing in the new thing even if it's compatible with the latest browsers or the latest whatever and still \[unintelligible 00:14:37.13\] |
**Mikeal Rogers:** In your pure Node module you're already gonna have a compiler. |
**Alex Sexton:** I think Node is a little bit less this way, because there are different norms there. But I think even in those cases it's somewhat common to see... Yeah, sure. |
**Mikeal Rogers:** I wonder how many IoT projects Rachel has seen where they're compiling things with Babel. \[laughter\] |
**Rachel White:** Not many, that's for sure. \[laughter\] |
**Alex Sexton:** Yeah, I mean... I think IoT projects in the grand scheme of the amount of JavaScript that's being written are a small percentage... |
**Rachel White:** True. |
**Alex Sexton:** That doesn't make them unimportant or anything like that, I'm just saying that I think the average JavaScript developer these days is working in a framework, and those frameworks somewhat already introduce enough compile steps to where it's just a non-issue to add this. |
So if you're working in Vue or you're working in React or you're working in Ember or you're working in Angular or you're working in any of these things, you have a Babel-like compiler already in your stack, so adding object spreads is just like a decision you can make or not. |
**Rachel White:** I feel like most of the features that I have used and interacted with would have been like things that we touched on already: \[unintelligible 00:15:57.04\] arrow functions, some of the way they're doing class definitions and stuff like that. I guess this is gonna be the same thing that Mikeal was jus... |
**Alex Sexton:** \[16:18\] I guess there's two buckets there... The ones that people aren't trying out yet because they're bad, and the ones that people aren't trying out yet because they aren't' fully aware of them or they aren't fully powerful, or things like that. I guess there's also things that go in both buckets. |
A lot of the stuff we use in Babel and the stuff that we're compiling down to is stuff that isn't even finished getting through ECMA and will change. Modules is something that everyone uses and a lot of the semantics of how modules load haven't been known for a very long time and that's kind of the driving force behind... |
**Mikeal Rogers:** Yeah. I mean, without getting into the specifics there, there's actually a particular point where the spec sort of implies but does not define how things are supposed to work, and Babel made a decision about how they work at one point, and we're not gonna be able to support that in Node. In fact, the... |
That one's even out. That one is actually in the spec, we just haven't had enough implementations to know what some of these really nitty-gritty details are. |
You're by definition kind of on the bleeding edge if you're using features that aren't even actually in the browser yet. |
**Alex Sexton:** Modules are now in the browser though. |
**Mikeal Rogers:** In one browser, yeah. \[laughs\] |
**Alex Sexton:** Pretty cool. |
**Mikeal Rogers:** Yeah. So what features are you staying away from though? Like, actually staying away from... |
**Rachel White:** The ones that I don't need... \[laughter\] |
**Mikeal Rogers:** I think proxies are a terrible idea and I don't know why we should use them; they're just kind of a performance bottleneck. |
**Alex Sexton:** Proxies were a really good idea for like a hot second. It seemed like a really solid solution to a thing that everyone was trying to solve at the time, and then we found better ways to solve those userland problems and then proxies became this thing that made a lot less sense... Namely like the "get se... |
Generally, if you're using proxies you're hacking the crap out of a closed library these days... |
**Mikeal Rogers:** Yeah, I remember similar features are in Python metaclasses, and the guidance for metaclasses is "Don't use metaclasses." \[laughs\] |
**Alex Sexton:** \[19:53\] Other things - I'm trying to think... There are definitely proposals that -- I think it's less about... I'll use anything that's kind of in the language; they're pretty conservative, I think, about -- by the time it gets in the language, everyone's already been using it for so long that it's ... |
**Mikeal Rogers:** I used them when I was a Python programmer, and my general feeling is that they complicate more than they simplify. |
**Alex Sexton:** Yeah. There are some cases where they're really -- I think the authentication case for decorators is so pretty all the time; it's just like "This is an authenticated function" and it just magically makes off something that makes sense on a per-function basis. That's such a cool use case for decorators ... |
I think they have a place, and I know the Ember community uses them a little bit. There are also people in the React community... |
Ember concurrent uses decorators to do some of their stuff and I think it's a decent use case for it. But in general, I haven't seen a huge need for them, even though I'd probably use them once they made it into the language... Once they became more of a first-class supported thing by the libraries I was using. |
**Mikeal Rogers:** I don't know, I'm more on the functional programming side of things, so I just don't -- I don't like encouraging people to write more classes. |
**Alex Sexton:** Sure. That's a different conversation, but there are kind of two properties -- I'm pretty happy with the React world's... There are function components and some people are very big into that, but if you don't mind the class components. But then all functions that are a part of it are pure functions, an... |
**Mikeal Rogers:** Yeah. I think that we've hit a nice little spot here... I think we can take a short break, and when we come back we're gonna get into create-react-app. |
**Break:** \[22:49\] |
**Mikeal Rogers:** We're gonna get into some new features that just landed in create-react-app. It actually seems like a pretty substantial change. |
**Alex Sexton:** Well it's 1.0. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.