text stringlengths 0 1.36k |
|---|
[1221.84 --> 1222.40] I don't know. |
[1222.76 --> 1225.44] I dislike that this is an issue. |
[1225.44 --> 1229.64] You're just trying to make yourself above the controversy. |
[1230.00 --> 1230.32] Exactly. |
[1231.88 --> 1235.52] Why don't you explain the controversy for us, Michael? |
[1236.20 --> 1236.62] Well, no, no. |
[1236.70 --> 1237.66] I don't think. |
[1237.84 --> 1242.80] Look, there's a long, long argument kind of against promises. |
[1243.02 --> 1245.44] There's just a lot of people that don't like promises. |
[1245.44 --> 1251.62] And in particular, like I actually don't care about promises. |
[1252.10 --> 1255.44] I'm fully in the do whatever you want and don't care camp. |
[1255.72 --> 1256.90] I'm telling your wife. |
[1257.38 --> 1264.18] But it does get annoying that people act like this is like revolutionary. |
[1265.58 --> 1271.60] You know, like a lot of the articles that were written about this feature coming into Node are like, Node finally tackles asynchronous programming. |
[1271.60 --> 1276.64] Like Node 0.02 tackled asynchronous programming. |
[1277.12 --> 1279.58] Like asynchronous programming has been part of Node since day one. |
[1279.70 --> 1281.66] It's been like the hardest thing for people to get over. |
[1283.14 --> 1289.38] And callbacks, for the most part of actually like the standard callback interfaces has kind of wrangled that into something usable and really fast. |
[1291.44 --> 1295.48] And I think promises landed, you know, a while ago in V8. |
[1296.38 --> 1297.22] Native promises. |
[1297.22 --> 1301.56] People have been using promises, though, since, you know, early promise standards. |
[1301.90 --> 1304.08] You know, Bluebird is based on the promise standard, right? |
[1304.12 --> 1306.38] Which is the really fast one that people tend to like. |
[1307.00 --> 1313.62] I feel like people use promises far before it was even standard in V8 or whatever. |
[1314.32 --> 1314.84] Right, right. |
[1314.90 --> 1318.04] And before it was a standard, there were all these competing standards for promises. |
[1318.50 --> 1323.22] So if you go back far enough, you know, you just could not get two people to agree on the same promise. |
[1323.22 --> 1327.52] Well, you couldn't get jQuery to agree with the rest of it. |
[1327.72 --> 1332.96] Like Chris Zippin and promises A, A+, like that was pretty early on, I feel like. |
[1333.58 --> 1341.38] So what Alex is hinting to is this fight in CommonJS over which standard would be the promise standard. |
[1341.64 --> 1347.56] And he said A slash A+, because there was also promises slash B and C and I believe D. |
[1347.76 --> 1349.40] And I don't know how many letters we got up to. |
[1349.62 --> 1350.22] It didn't get into... |
[1350.22 --> 1351.02] No one used those, though. |
[1351.12 --> 1351.84] They were just proposals. |
[1351.84 --> 1353.44] Right, right. |
[1354.00 --> 1360.56] But anyway, I think that Dominic Nicola did a ton of work just to get promised people to agree on the same spec. |
[1361.38 --> 1365.46] Or at least get everybody to stop listening to the people that weren't attracting. |
[1366.68 --> 1368.72] And got like a real standard in the language. |
[1368.72 --> 1373.00] Which a lot of people that don't like promises don't like. |
[1373.10 --> 1378.90] I personally prefer not to wrap this kind of state in an object myself. |
[1378.90 --> 1389.46] But one thing that you can say about it is that the browser, if you look at all browser standards, there's just no standard way to do IO handlers. |
[1390.02 --> 1394.34] There's, you know, if you look at every DOM API that has to do this, they do something slightly different. |
[1394.34 --> 1395.66] And all of them are awful. |
[1395.66 --> 1400.64] And even if you don't like promises, most of what people do in the DOM to do the same thing is just worse than promises. |
[1402.34 --> 1403.76] So, yeah. |
[1403.88 --> 1405.90] So it's nice to have a standard. |
[1406.26 --> 1413.26] And that going forward, you know, if you look at like the fetch API and some of these new browser APIs, you have something unified, which is so good. |
[1413.44 --> 1414.92] Like, I mean, yeah. |
[1414.92 --> 1420.24] To be clear, promises made it into the DOM specification, not ECMA, right? |
[1420.84 --> 1423.06] Well, it's sort of in both, right? |
[1423.20 --> 1426.72] So async await is a feature in the JS language. |
[1427.16 --> 1429.46] And it effectively yields a promise, right? |
[1429.84 --> 1430.16] Right. |
[1430.16 --> 1431.80] And it relies on that standard. |
[1432.06 --> 1437.12] So you're getting into like this annoying territory where we have two standards bodies working on the web platform. |
[1437.50 --> 1437.70] Yeah. |
[1437.70 --> 1438.10] Yeah, yeah, yeah. |
[1438.40 --> 1445.40] But like the promise object doesn't have to exist in Node, I guess, the native promise. |
[1445.50 --> 1447.16] It just kind of does because VA does. |
[1448.72 --> 1449.08] Right. |
[1449.22 --> 1451.62] But there's some really low level hooks. |
[1451.62 --> 1455.36] So now we're going to get into some Node.js details. |
[1455.64 --> 1463.22] But there's a lot of tracing and debugging that you can do in Node.js, especially in production systems, to really get at like the underlying state that's going on. |
[1464.10 --> 1467.44] And there's all kinds of different methods to get at this. |
[1467.44 --> 1470.30] Node.js is one of the more inspectable platforms out there. |
[1470.74 --> 1472.82] So there's different types of tracing that people do. |
[1473.06 --> 1478.82] And there's also this thing called async wrap, which is like an async hook into the low level event system. |
[1479.46 --> 1486.48] And in order to do that, in Node, there's this thing called make callback in C++ land that wraps the callback that happens. |
[1486.60 --> 1487.56] So it's just a little function. |
[1488.44 --> 1491.18] But promises don't have that kind of hook yet. |
[1491.42 --> 1493.16] Native promises don't have the hook yet in V8. |
[1493.16 --> 1503.04] So there's work that needs to be done to get an equivalent thing happening at the native level, which at that point actually will make it much more valuable to use native promises rather than something like Bluebird. |
[1503.04 --> 1511.90] But anyway, so what it all comes down to is that I think that people don't actually like composing all these promises into a bunch of things. |
[1511.90 --> 1513.44] They actually get kind of annoying and messy. |
[1513.84 --> 1518.96] And the end goal has been this async await feature, which essentially allows you to kind of yield out a promise. |
[1518.96 --> 1524.48] So it's a syntactic sugar on top of what people are doing now. |
[1524.62 --> 1529.98] But it is one of those more important pieces of syntactic sugar that makes us far more usable than it used to be. |
[1530.16 --> 1530.18] Right. |
[1530.76 --> 1530.96] Yeah. |
[1531.00 --> 1537.64] It doesn't it doesn't tackle a lot of the core problems people have with promises, namely error eating. |
[1538.48 --> 1538.96] Yeah. |
[1539.10 --> 1539.26] Right. |
[1539.76 --> 1540.18] But yeah. |
[1540.18 --> 1547.96] But I think if you're already using promises, I think await can be a nice update to to your code style. |
[1548.14 --> 1551.90] I think for the most part, it's it's fine. |
[1552.02 --> 1552.78] You don't have to use it. |
[1552.80 --> 1554.14] No one's forcing anyone to use it. |
[1554.14 --> 1562.70] You can almost always write a little wrapper around some dependent library that uses it to switch it back to whatever you like to use fibers or whatever. |
[1564.92 --> 1566.08] Nobody uses fibers. |
[1566.34 --> 1566.74] No, I know. |
[1566.86 --> 1569.36] I intentionally said something that no one uses. |
[1569.36 --> 1577.52] But the I think is a silly argument just because it's it's like it's sugar. |
[1577.74 --> 1581.54] Most of the time performance on it is it's not going to matter material at all. |
[1581.84 --> 1584.00] And you can choose to not use it. |
[1584.40 --> 1586.04] So deal with it. |
[1586.68 --> 1588.54] Yeah, that's that's that's a really good recap. |
[1590.60 --> 1591.84] I wanted more controversy. |
[1592.26 --> 1595.18] Come on, Rachel, come in and tell me how much you know promises real quick. |
[1595.26 --> 1596.16] I can get into it. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.