text stringlengths 0 1.36k |
|---|
**Rachel White:** I mean, I'll argue, but not about this... \[laughter\] |
**Alex Sexton:** The question on our chat in Slack - you can join the Changelog Slack and the JS Party channel... Seth asked "Is there any argument against async/await other than performance and "syntax sugar is bad"? Well, against async/await maybe not, because it's just sugar, but there are plenty more arguments agai... |
\[27:59\] You have to be very explicit about every error step along the path, and if you're not, then things just get swallowed and you don't realize that bad things are happening in your code. It may not be the number one design flaw with them, but it's certainly the number one thing people run into whenever they set ... |
**Mikeal Rogers:** Yeah, and I think also the way that it handles errors kind of conflicts with the way that not just Node handles errors, because that wouldn't be accurate - Node doesn't have a way to handle errors, but a lot of the debugging facilities and tracing facilities in Node rely on errors and exceptions kind... |
So a lot of production Node systems have issues with that particular mode. That's being worked on, right? This is all really, really early days. I think that a lot of this is going to get better over time, but people that already have a big production system kind of don't like this. |
There's also a style argument or a way that people like to write code argument, and this argument is as old as time. It's just an OOP versus functional programming argument. Essentially, Promises wrap up a bunch of state in this object abstraction that you can then stack and compose, and some people think that that is ... |
People have different brains, and different people's brains like these different ways of writing code. |
**Alex Sexton:** Sure. Seth also asked, "Is there a suggestion for avoinding the error stuff and some of these other gotchas?" I don't think there's a great one... There are good, baseline rules for how to not write Promises in a way that accidentally swallow errors, but in practice, with some of the most brilliant peo... |
So there are other mechanisms for asynchronous coding - the baseline won't be callbacks, but then you get to what people hate about callbacks, which is 'callback hell', or whatever. I'm sure Mikeal has some things to say about 'callback hell'. I don't think he can deny that callback hell exists for some people... |
But then there are other async mechanisms... Async functions are coming in the future, which is a pretty fundamentally different model. And then generators, if you know that model, or another way to yield control in certain sections, and then pop back to those -- not necessarily used in the same exact ways, but generat... |
**Mikeal Rogers:** Yeah, before we go too deep into this though, I just wanna point out that in the browser there's actually some new features around Promises, and for error tracking and handling, specific to Promises, that I believe actually rely on the native Promises. |
**Alex Sexton:** They're for debugging the Promises, though. Your code would still swallow it, but you might be able to see it in your tooling. Does that make sense? |
**Mikeal Rogers:** \[31:55\] Right, exactly. But honestly, the solution to callback hell is to write code that doesn't have callback hell, the same way that the way to not swallow errors in Promises is to write code in a way that doesn't swallow the errors, right? |
**Alex Sexton:** Yeah. Not necessarily a good solution, but viable. |
**Mikeal Rogers:** Yeah. I'll also say about coroutines - there's a library called Co, that's the main thing that people use on the Node side to really do a lot of the asynchronous programming using generators. It's not in super wide use generally, but it has this huge following in China. Really big. It's actually real... |
**Alex Sexton:** As we all did... |
**Mikeal Rogers:** He quit for Go, as you do... He took over a lot of the Co stuff, and DeadHorse is actually a really well-known programmer in China. He helps with some of the cNODE and cnpm local stuff. He's actually a great dude, I met him when I went out to China. But because he's such a presence there, I think tha... |
**Alex Sexton:** I actually only use the async module. |
**Mikeal Rogers:** That's kind of not maintained anymore either. |
**Alex Sexton:** That was not true... But back in the day, that was somewhat revolutionary. I think some of people's love for Promises came out of the bridge between Promises and callbacks that async was. It was like this weird middle ground where you didn't have to count the number of different things that had finishe... |
**Mikeal Rogers:** I think in the server space and in the frontend space, if you get popular enough somebody will make a Promise version of your thing and there will be like a following around that... Like, there's definitely that pull request. I'm actually curious, Rachel, if you see this in the hardware space at all,... |
**Rachel White:** I honestly couldn't tell you, because I live in such a siloed thing. A lot of the NodeBot stuff is a very single-usage thing, so you'll have like one sensor being controlled by some other input. There's not a lot of need for a ton of Promises or stuff that you would need to have something special. You... |
**Alex Sexton:** What about sequential actions? Like, you want some servo to do this, then this, then this, then this. |
**Rachel White:** Oh, okay... Well, the thing that you run into the most then is when you're trying to run stuff on serial port; when you're getting data from multiple places at once and sometimes this stuff that you're waiting to happen from your sensor over Wi-Fi isn't going to happen as quickly or in sync as the stu... |
**Mikeal Rogers:** \[36:21\] It's all like really low-level callback stuff, right? You don't get a lot of high-level proposition at that layer... |
**Rachel White:** Yeah... I'm trying to think of anything that I've done recently that has been what I would refer to as callback hell, and it probably would be some Node application that I utilized graphics magic with. I'm actually interested in going in and trying out the new Node version with that kind of stuff. I t... |
**Mikeal Rogers:** Also, there's these performance arguments right now, and honestly, even though I'm not a huge Promise advocate, I think most of the performance arguments are really dumb. But in hardware, it actually makes sense. The reason why I think that the performance arguments are stupid is that you're talking ... |
But with a serial port, you're talking to the hardware there. It is asynchronous, but it is really, really fast, so you could actually see some of the performance stuff stack up there, and you might actually start to care. |
**Rachel White:** I don't care about much, but we'll see. \[laughter\] |
**Mikeal Rogers:** How fast can I AI this cat photo to blink this LED to... |
**Rachel White:** Okay, listen, don't... Don't... |
**Alex Sexton:** Don't pigeonhole me... |
**Rachel White:** Yes, exactly. I like other animals. \[laughter\] |
**Mikeal Rogers:** I thought you were gonna say, "I do more than just cat images." |
**Rachel White:** I wish I did. |
**Mikeal Rogers:** \[laughs\] Oh, that's awesome. |
**Rachel White:** You know, I enjoy pigeons and raccoons and other various other animals that love garbage... \[laughter\] |
**Alex Sexton:** We should have Isaac on, so you guys could discuss... |
**Rachel White:** Oh, I've already discussed raccoons with Isaac... |
**Alex Sexton:** I know, I just want that to be like a live voice thing. |
**Rachel White:** I don't know if I ever want to have that conversation again. |
**Alex Sexton:** Yeah, I made a mistake then. |
**Rachel White:** For anyone that's wondering, Isaac from npm - if you ever see them, talk to them about how much they love raccoons. \[laughter\] |
**Alex Sexton:** They don't. |
**Mikeal Rogers:** \[laughs\] And on that note, we're about ready for another break. When we come back, we'll talk a little bit about the featured project of the week. |
**Break:** \[39:05\] to \[\\00:39:54.22\] |
**Mikeal Rogers:** And we are back. We're gonna get into the featured project of the week, AR.js. Rachel's particularly stoked about this one, so I'm gonna let you take this over. |
**Alex Sexton:** It's about assault rifles? |
**Rachel White:** No, no... |
**Mikeal Rogers:** That's version 15. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.