Podcast Lookup

Typescript

Programming Throwdown

  • March 4, 2019
  • 1 h 10 min
  • Episode 87
Episode page
About this episodeWhile the web is one of the easiest platforms for deploying software, it can also be one of the trickiest to debug. People have many…

While the web is one of the easiest platforms for deploying software, it can also be one of the trickiest to debug. People have many different browsers, and some have plugins or settings that restrict functionality. It may be extremely difficult to reproduce errors on your development machine. As a result, we want to discover as many errors as possible before we launch a new site. With node.js and people running javascript on the server, static checks become even more important. Enter typescript! Typescript is a language that transpiles to javascript, but along the way it adds type checking and advanced javascript features. After checking the types, typescript produces javascript that can run in almost any browser. Show notes: https://www.programmingthrowdown.com/episodes/87-typescript

★ Support this podcast on Patreon ★

Transcript

From the publisher

This transcript comes from the podcast’s own feed, shown as the publisher wrote it.

Typescript

00:00—
  1. A

    Programming Throwdown Episode 87: TypeScript, take it away, Jason.

  2. B

    Hey everyone, welcome back to Awesome Friday. You know, Friday's a short month, and it's always tough for us to plan—sorry, on Friday, February, it's always time for a hard place to plan. February is also my birth month, that doesn't help. And happy

  3. A

    Birthday! Thank

  4. B

    you. I'm born right in the middle of the month, so oh, we missed it. There's a wrench into things. But yeah, here we are, and hopefully, we'll get this out to you right before March. Wait, but that means you

  5. A

    have to do it before Friday of February.

  6. B

    That's correct.

  7. A

    Because Friday is March? Okay, is Friday?

  8. B

    March or Saturday? March, Friday. Friday. That's a challenge. We'll see if we can do it. We're gonna do it. All right. So I'm actually gonna talk about micro-kitchens now. This is maybe very specific to Silicon Valley, I don't know.

  9. A

    No, that's—I take it back.

  10. B

    I worked at other places. I had this, but a micro-kitchen is basically you know a place where you can go that has food. You know, it could be either a vending machine or it could be free food. And micro-kitchens are dangerous, and so I tend to go through these cycles where it's sort of like waking up—like I'm waking up from a dream, I guess, or something. But I realize that I'm just eating like four candy bars a day, and so there's something insane. Oh, I'm like, okay, this has to stop. And so I'll just stop eating any snacks, and that will last a while. And then all of a sudden, I'm like, wait a minute. I just ate four candy bars today? Wait a minute, I've been eating four candy bars for the past month. And then it's like, oh, I have to start all over again. Do you have this or are you have you been able to regulate?

  11. A

    Yourself? So, so I do know what you're talking about, but I'll clarify. I think you mean that at a place of work, like at your office near where your desk is, so not like a cafeteria downstairs, but like the place near like each floor in an office building or something will typically have maybe this is a—I mean people who are in college, I guess it's not really like this. But like you have a vending machine like on your floor or in your sort of desk area, and they'll have yeah, like some vending machine, and there's typically refrigerators and a microwave, and almost every place has coffee or a water cooler, and coffee. And so like gathering around the water cooler, I thought you were going to go with a 'gathering around the water cooler' story, but no.

  12. B

    I mean, the thing is for me is like—you know, I'll hit compile and then maybe 30 seconds. There's 30 seconds, and I'll find myself going and getting a chocolate. In that 30 seconds, I'll come back, I'll hit compile again, and usually depending on the kitchen—I mean some micro-kitchens will have just kind of pretty small like little bite-sized snacks, and yeah, you just it's just a habit. You get in this habit of like, 'I have this little delay, so I'm gonna go eat snacks.' I have my latest—yeah, my latest thing now is I generally don't eat that many meals at work. Like I won't have a really big lunch or anything like that. So what I will do is my new rule now is it has to be perishable. So that means yogurt or a cheese stick or you know, like I guess a glass of milk or you know, a smoothie or something like that.

  13. A

    Like a brownie or a cookie, no.

  14. B

    those things well the ones that we have anyway are like kind of like those bagged up ones as long as it's in the bag you could leave it for a

  15. A

    It'd be fine, but anything perishable if you open it up and leave it

  16. B

    out that doesn't count. That's totally cheating.

  17. A

    That's like eating lobster on Lent.

  18. B

    Something so um no, no, it has to be something that you know would rot in a couple of days if it was at room temperature. That's my new rule, and so I'm trying to see if that's going to

  19. A

    work out? Interesting. Yeah, the temptation of getting lots of snacks when they're freely available and sodas is a real thing, especially if they're free. I feel as humans rationalizing and dealing with free is just very difficult. And so anytime I've been somewhere where even when I've worked in places where there wasn't free food, but someone might bring in like, oh, here's cookies or here's whatever, here's a cake for someone's birthday, and it's like always someone's birthday, like having access to that. Yeah, you really got to be careful because they're as you pointed out, I think what happens is you eat it while you're not thinking about it, like I'll take it back to my desk and eat it while I'm working or coding. And then that's the worst kind of thing because you're not thoughtful about eating it. You're not sitting there thinking like, 'I'm consuming this.' You're just sort of like putting food in your mouth while doing something else, and it's really easy to overconsume. Yeah.

  20. B

    And it's a total waste. Like you're not really getting anything out of it. And so I mean right now there's probably two camps of people: there's the vast majority of people who have never seen me, and then there's the few people who are like, 'You know what is this person talking about?' Because I'm a total beanpole. If you've ever seen me, I'm a very skinny person, but it turns out this—this people might not know this—but if you're like regardless of your frame, in fact, if you have a thin frame, it actually has a more dramatic effect if you eat a lot, and you have a thin frame, you really don't feel well. And so it's important for everyone to eat healthy, I feel.

  21. A

    Like this became a PSA like 'Eat Healthy,' and I feel like you're about to

  22. B

    say exercise? Yeah, that's right. Eat healthy, exercise. I don't know what are the other ones. Love yourself. We're just gonna—this is the whole thing from now on is going to be a self-help episode. Yeah, use TypeScript, one of those things is.

  23. A

    True. Yeah, that's right. All right. Well, talking starting in on the news, I'll go first. So I know that people have written in and reminded us of things we've talked about in past podcasts, and thinking about the kinds of things we've talked about—it's been one of those recurring but not directly related things that we've discussed on the podcast has been space travel because let's face it, rockets are cool, and space is cool. And so this last week Virgin Galactic went to space, which they had traveled to space before on their newly designed spaceship Two. Um, and well, it has a reversion of revision of Spaceship One. So now we version our rockets or our spaceships. So for Spaceship Two, it had gotten to space a little while ago—a couple weeks ago, a month ago, a couple months ago—and they went again, and this time instead of just the two pilots, the pilot and the co-pilot, they also brought a passenger. Now the spaceship is supposed to hold, I believe it was six passengers, but they only brought one, and it was actually a trained space person like, I think they were previously an astronaut.

  24. B

    It was like a pilot test, or yeah.

  25. A

    So they were there to test out the systems and the restraints and stuff and make sure everything kind of worked. But they did you know sort of go in again, but I mean this means they're getting closer. They're getting ready to, you know, actually take sort of paying passengers, I guess is what you would say, up. And it's just kind of exciting because I know we've talked about this in the past about, you know, when everyone was anticipating and I think it was very during the what was that? The X Prize for going to space. Yeah, I'd be careful not to say SpaceX. Uh, the the X Prize for going to space.

  26. B

    Where the name came from SpaceX, from the X Prize, not that.

  27. A

    I know of, but it might be—I don't know. We'd have to look it up. But people got really excited about buying tickets to go to space, and there were people who went up to their National Space Station, and it was, you know, for a while talked about all the time. And then I feel like I guess if you see that hype curve, I guess it's the typical stuff everybody got really excited about. And then we actually just tried to make progress on it, and now I think actual real progress is being made towards that end again where hopefully we'll start to see it soon. It'll still be really expensive, but hopefully it'll actually start happening pretty soon, and it seems like Virgin Galactic is on the verge of making it happen.

  28. B

    Really cool. So SpaceX and X Prize are not related; they're just—it's just a coincidence. But um the Virgin Galactic. So what is it? What's the trajectory like? I mean, does it go straight up like a rocket, or is it like an airplane that can just keep going up, or how does it work? No, I mean.

  29. A

    It's a rocket. So it has a big airplane with a really big wing that takes it to a very high altitude, and then the smaller spaceship detaches and turns its rocket on, shoots out from underneath it and goes into roughly a parabola. And the peak of the parabola is—uh past the is it the oh man, I always forget the common line or something. Well, oh okay, yeah. But there's like a line that's generally considered—I think it's the Karman Line. Yeah. Uh, is the line where people talk about space, which is actually a funny other thing which I won't get into because I don't have notes prepared for it, but there's a difference of reaching what the U.S considers reaching space and what the EU considers reaching space. Aren't at the same altitude. Yeah, because space—it's a gradient of atmosphere, right? Yeah, yeah, there's no like sign, you know, Earth ends here, and

  30. B

    It's not. So there's particles of air, um like in if you were to go in like really far out the moon still be particles of air, but there would be just

  31. A

    Very few. So I was reading about this recently. Somebody just did a study or whatever, and I guess there are particles at some density of particles per cubic meter at the moon of hydrogen atoms from Earth. So Earth's atmosphere is that makes sense more and more diffuse all about to the moon. Someone else pointed out that it's like—I want to say, I'm gonna mess up—like 120 orders of magnitude or something, so the difference is so extreme that it's not clear that it's meaningful. Like what does it mean to be meaningful? But whatever the moral of the story is, there's a gradient, right? It's very close Earth atmosphere, very dense at the moon basically non-existent, but somewhere, you know, in between there's varying levels. So most people would say, you know, satellites are orbiting in space, but somehow satellites orbit much lower than other satellites, very drastically different altitudes that satellites can orbit at. So yeah, cool anyways. Yeah, so they made to space or at least recognized by the U.S as having done so, and

  32. B

    I think the last episode or a few episodes ago we looked this up, and it's a $100k for one ticket. Oh, okay. So it's—it's still pretty pricey, but yeah, I mean if they cut it down to even 10k, I mean that could be reasonable. I mean, it's—it's still

  33. A

    A lot of money for a short experience.

  34. B

    But yeah, I mean it's something that's doable. Obviously if they get it down to a thousand, then it'd be very oh.

  35. A

    Yeah, yeah, I mean then it's like a well. Yeah, yeah. So but to answer your question, I mean it's a parabola. You at the peak, you know, get up, you see Earth's curvature, you have experienced weightlessness for a short amount of time, but it doesn't complete an orbit of Earth or anything. So it's still suborbital. Okay? So I mean that would be a cool thing to me like being able to go around a full orbit—that seems pretty awesome—but I don't know how far away that is. That's obviously much even more difficult than what they're doing now. So I feel

  36. B

    Like, uh, I mean it can't be that much more difficult, right? Because when you the further out you get, the less energy you need to go further, right? I mean, I guess it's hard for me.

  37. A

    To know well, but it's a so this is I feel like we should just play some more Kerbal Space Program. Whatever. Yeah, that's right. I just need to go play some more Kerbal. But I think the issue is to get the extra height, though, the extra speed you need and you know to be able to reach orbit and extra the height, reach orbital velocities. The extra fuel you burn up there, you have to carry with you, which means you have to carry more fuel to get that fuel up there. But then you need more fuel to carry—you know, it's like a compounding thing. So yeah.

  38. B

    That makes sense.

  39. A

    I mean, it's doable obviously, like we get to outer space with satellites and stuff, but it's I don't think it's easy, and I

  40. B

    think it becomes even more

  41. A

    expensive, yeah, and more dangerous.

  42. B

    Yeah, it makes sense. All right, my article is Hot Reload, all the things. So this is about something I thought—I think is pretty fascinating. Basically, so just to give a little background here, there's people who do the front-end web server in Node.js. So what that means is you go to a website, you go to, you know, http://mywebsite.com/foo, and then there's a handler that has to process that foo and do something—you know, return back some data or what have you. And now it might go and communicate to even more servers and things like that. But usually that—or not usually, but many times that front-end server is going to be running Node. js. Then your browser, so the code that's executing on the browser is also running JavaScript. It's not running Node.js, but it's running just regular JavaScript, right? And so what this lets you do is you can actually hot reload the server or the client. And what hot reload means is every time you save a file that takes effect immediately. So imagine, you know, you have an endpoint and it's supposed to return your name, and it only returns your first name. So you say, 'Oops.' Now you might have to say, okay, change the code, you know, add your last name, you compile it, maybe like deploy it, like run a server, maybe you have to push it to another machine or something like that. And then on the client, you have to like hit refresh, right? Well, you don't have to do any of that. Basically, you save the file and it's just—it notices that you've saved it and it hits reload automatically, and you just see the change right away. It's really cool. So, you know. When I was trying to get a new TypeScript project off the ground, I found this website, and it just—it just feels like visceral. It just feels so cool when you get this set up. It's a lot of work. It's way more cumbersome than than I would have liked. But once I did finally get it working, it's so cool that you just basically you just have two screens: one screen has your website, the other screen has your ID, and every time you hit save, like you're seeing it kind of build itself. It feels almost like very futuristic. And so check this out. It's pretty long, pretty detailed. It'll take some time to get through, but once you have it, it's a very, very cool framework to build a site. Nice.

  43. A

    So I looked it up. I'm not sure how accurate is, but it looks like it's a factor of 32 to go from suborbital to orbital velocity. Oh.

  44. B

    That sounds like a problem. So I might be

  45. A

    misreading. We could sit here and compute the math, and I guess there's a lot of assumptions to be made, but this article I found says it's about a 32-fold, like a 32x difference. Okay, that makes it way harder, I think.

  46. B

    I mean, so as it is now though, it doesn't circumnavigate the Earth, but it does maybe what a third of it or something. No?

  47. A

    No, no. I mean, it's no, no. It just like pops up and pops right.

  48. B

    back down. Oh, so this is even in a different state? I mean, how many miles are we talking?

  49. A

    About. So this is the thing that always confuses me too. So we were just talking about space. This, the Carmen Line, is about 100 kilometers up—yeah, about 62 miles. But if you think about 62 miles along the surface of the Earth, that's actually not far at all.

  50. B

    Oh, I see.

  51. A

    Right. So like going 62 miles is like nothing. Like I commute 10 miles to work. Yeah, each day, right? So like going 62 miles at 60 miles an hour—this is one hour driving on the highway. California is a big state, so we actually don't get very far if we drive for an hour. But that far up and you don't have to fly horizontally, right? You can you can fly in sort of a circle, a spiral up. So yeah, right.

  52. B

    Yeah, so actually,

  53. A

    No, so Earth's atmosphere is sort of thin if you compare it to sort of the circumference of the

  54. B

    Earth? Okay. That.

  55. A

    Makes sense. Yeah, which is why you hear astronauts talk about this thin blue line—it's like where all of Earth's life lives because like Earth itself is really big compared to how thick the atmosphere is or the like part we consider this.

  56. B

    Is this totally totally off topic? But I'm just kind of surprised that I guess other than digging for oil, there's not really that much—like there's not really that much use for the entire kind of core of

  57. A

    the Earth. I mean, there's use, but not that we do anything about. I would enjoy the effects of gravity.

  58. B

    I mean, well sure, but like we haven't found a way to really—I guess my—I mean, I guess it's just rock and dirt at the

  59. A

    end of the day. So it says the deepest hole ever dug was 12 kilometers, but Earth's radius is 6,378 kilometers? What?

  60. B

    Wait, really? Yeah, 6,000 kilometers is the radius. Yeah. Oh, yeah, that makes sense now.

  61. A

    That I mean.

  62. B

    Now that I think about the circumference, you know it's yeah.

  63. A

    Okay. Well, this is completely off topic, but yeah, it just turns out for me I had the same realization a while ago when I was thinking about this—being always thinking, oh, I kind of like space. I'm into space. And then putting these numbers in perspective, it's like, yeah, I never really thought about it like this. Yeah, like it's really hard work to go that 100 kilometers up, like way, way, way, way harder than just like traveling horizontally 100 kilometers, right? Just like in fathom—infathomably harder. But then it makes sense, like climbing a staircase is way harder than going for a walk.

  64. B

    I mean, it's kind of wild, but. Like, you know, with the right—with the right kind of solar panels, couldn't you take energy that was just going from the sun that was just going to be wasted in the ocean and light up like an entire surface below the surface that you dig out? And you could have, you know, a whole continent underground that's just supported by—by light that's being harnessed—that would have been just going into.

  65. A

    I feel like I feel like you're gonna spoil our book of the show and you're gonna tell us this is the—this is what the book you read was.

  66. B

    No, no. I mean, it's that would be a great book, a great sci-fi book. Yeah, yeah.

  67. A

    I mean, all that kind of stuff's cool. Yeah. Okay, well on to my next post, my—my next link. So mine was I guess keep—I must be on like a kick recently. I don't know what it is anyways. My next post is how FlightRadar24 works. So FlightRadar24 is a website you can go to that will show you many of the—or at least, I think all of the commercial airlines that are flying around, like where they are in real time all over the country. Okay? And it's kind of cool actually. Over much of the world, it'll show you sort of where you are. So if you just go to FlightRadar24 and you can—you know, just sort of like see—I did this the other day. We were just like toggling around looking at various airplanes. If you're into like aviation, you can see more about, you know, like the specific tail numbers and things. Um.

  68. B

    It run by the government or?

  69. A

    Something no. So that's the interesting part. So it's not. And I was actually trying to find the map, but what happens is that all commercial air—well, there's more nuance, but I'm not and I'm not a pilot so I don't exactly understand the distinctions they were trying to make when I was reading up for this story. But the requirement for many airplanes is that they have to have on a transponder that is used so that other things in the sky don't hit them. So if you have two airplanes, they each have these transponders, these radio emitters, and then they say, 'Hey, I'm airplane with this metadata, this information, and I'm at this location.' And they send that out to other airplanes can listen. Um, and okay, what happens is with some—it turns out over time has gotten cheaper with some cheap radio software-defined radio, you can listen for those beacons. So if you live anywhere near an airport or anywhere where airplanes sort of fly overhead, you can listen for these little chirps, those little bursts of data that the planes send out. And by doing that, which is what this FlightRadar24 website and there are other ones with varying degrees of how open or APIs, you want or all that kind of stuff, but basically they establish a network of people—amateurs, I guess—who have these radios that know where you are. Oh, I guess you don't have to know where you are for the first part, but just listen for these chirps. So for instance, I live near an airport in the Bay Area, and when an airplane flies over, I could have one of these, and anytime an airplane's in range, I could use my radio receiver to listen for this burst of data that comes from all the airplanes, and then I could make a little map on my, you know, Raspberry Pi. And there are already people who developed all this that would show. Me like all of the airplanes I can currently hear where they're at, what their current heading is. Um and sort of if I sent that data to this website, they could aggregate it from lots and lots of sources and have it, you know, kind of all over the world, which is what they do. Um and so that's pretty nice. And then what they also are able to do is—so apparently some of the airplanes don't say I'm at this location, like they don't give their coordinates. But if you have—if you know where you are and you know where other people are, then you can sort of correlate those reports together and figure out where the airplane is and where it's going by sort of just listening to its beacon over time and saying, 'Yeah, that makes sense.' You know, do the triangulation. So um other people are able—I think it's called like multilateralization or something. They call it. And so they're able to do that. And I thought that was kind of cool for a couple reasons. One, I kind of didn't know that that's how that worked. It's kind of interesting to say, 'Oh wow, all these airplanes flying around are just saying where they are all the time.' I always—you kind of have this feeling when you go to the airport that planes are places, but you never it's always just sort of like, are they here or are they not here? But being able to pull up now next time I go, I'm looking forward to this actually going and figuring out what flight—what airplane my flight is going to be and then figuring out where it is and actually being able to see sort of like on a map like, 'Oh, it's I'm in California and it's in Nevada headed towards me. Oh, it's almost here.' Good. Um I don't know that it'll help me. Oh, that's cool.

  70. B

    Never put that together, but you're right. You can—you could look at your own plane that's getting to you and see if it's at the airport.

  71. A

    Yep. Or like, um, so when my, uh, so I have kids and when we—when we go to the airport to pick up family, we're always like, we get to the airport, it's like, oh, is that their plane? Is that their plane? Yeah, we're not gonna have to play that game anymore. Now I'm just gonna pull up the thing and be like, 'Oh, they're playing up there.' It is. It's the one on approach right now, and

  72. B

    You're gonna be that dad? Yeah, well, that dad is like,

  73. A

    Nope. I found the plane with my you.

  74. B

    Know SSH connection in the airport.

  75. A

    No, uh, well, so the other cool one of the things is that this FlightRadar24, I guess has varying levels of subscription. I only learned about this; I haven't messed around with it a lot, but if you buy one of these Raspberry Pi radio things and set it up, you actually get access to like a higher level of subscription in return for contributing your data. So um, that's another cool thing, but the Software Defined Radio stuff is also pretty cool. That this is something I always read about, but it's—it's beginning to become kind of interesting. And all the different things that you can use to, instead of having a traditional radio where you would have a knob to tune or whatever, you're able to have FPGAs, I think is how it works. I'm not actually a big radio person; I feel like it's always one of those things. One day I wanted to learn more about like Ham Radio and how that works. But basically, you're able to control a lot of the parameters of the radio from your computer and do things like tune into the frequencies where the transponders are transmitting. Whereas if you just went and bought a normal radio off the shelf, like a—what would you like an FM radio or AM radio? They're going to have a very specific limited set of frequencies they listen to, and also the FM or AM, the frequency modulation or amplitude modulation, they're going to assume a way of decoding those signals. So instead, the Software Defined Radio allows you to have a broader set of, you know, spectrums you're listening to, tune into a different place, and then you know sort of write your own decoders built into the—the sort of chain where um it could do, you know, frequency-encoded messages where it hops around and uses them as some sort of pattern. It could just be anything, I guess. And different radio systems use different patterns, including this one that airplanes use. That's awesome. Yeah.

  76. B

    It's—I think at some point though, you have to be careful with the legality, right? Like I know all the things you buy, even just headphones and stuff, they have this warning, you know, 'This won't emit frequencies other than what it's designed for.' Blah blah.

  77. A

    Blah. Yeah, so you're only listening? So you're only receiving? So far as I know, I'm not an expert, but I mean, you don't even need to mount an antenna. So having something that listens to radio waves in your house isn't going to cause a problem. So as long as we don't transmit—it makes sense if you start transmitting. Yeah, I think you could get sort of like that could be a problem. So don't transmit unless you know what you're doing, and I don't. So don't ask.

  78. B

    Me? All right. Sounds good.

  79. A

    But listening—listening is fine, I mean.

  80. B

    If you're just listening, I mean, you're just absorbing some signal. I can't see why that would be there would be any issue.

  81. A

    Now there is some stuff about like—I think what I've said about listening also works for flights, like, you know, I don't know, like military flights and stuff. I think also have it. I saw some discussion about this, but the nuances escaped me, so I won't try to recite them here.

  82. B

    I'm sure they're all encrypted at that point.

  83. A

    Right. Well, but again you can listen—you can listen for the transponding signals presence and figure out where it is. And the fact that it's encrypted seems like it might be meaningful. Uh, and so, oh sure. Yeah. So, but varying. Yeah, that makes... So I don't—I don't know. Again, not an expert, not a lawyer. You talk to someone who is, but I know that various of these websites and aggregators have different rules for what they sort of will and won't post information for. Yeah, that makes.

  84. B

    Sense. Yeah, I mean if you are getting a...

  85. A

    signal at a location,

  86. B

    that's encrypted and just happens to be over some military base, and you're posting on the internet. Yeah, that seems like you can get in trouble.

  87. A

    Well, you should make your own decisions about that, I guess. Yeah. I...

  88. B

    Mean, sure, make your own decision, but I'm gonna make it for you. That's a bad idea. Called it speaking of bad ideas—don't write crazy articles about your AI. That's not a good idea. So there's some folks at this research lab; they created this AI that could basically, you would give it the start of a conversation or the start of a monologue, and it would write more paragraphs of that monologue. So for example, you could say, 'You know John F. Kennedy was assassinated on such and such a day,' and then it would actually just write sentences that sounded like they were sort of world-building or just describing that event. So they would just say, 'You know the grass was a certain way, there was a gunman he shot John F. Kennedy blah blah blah.' And they claimed that it was so realistic that they didn't want to release the source code, or no, they actually released the source code, but they didn't want to release the trained model or...

  89. A

    the corpus, which—

  90. B

    you. Yeah, yeah. Oh, yeah, or the input data that they had. But I believe the input data was just Common Crawl, so it's publicly accessible. I don't really understand, but maybe they did some pre-processing. Either way, most scientists kind of agree that it's not that big a deal. It's not that big an accomplishment. It didn't—you know, it generated phrases that more or less you know could be considered grammatically correct. But the—you know, anyone with some common sense reasoning could see some serious flaws in the semantics of what it was writing. You know, it's just... I would say it's novel in that the syntax looks correct and so it might confuse other AI algorithms. But yeah, I mean if you read some of these, you'll know right away that this isn't normal. Nonetheless, they—they said we're not going to show anyone this model because we're afraid that people will just start generating things that aren't true and everyone else will start believing them. And a lot of people in the community found this really funny. So there's this whole Reddit post dedicated to making fun of that, and I'll put a link to that too. And the idea with this post is—there's this set, this data set called MNIST, which is literally a bunch of digits, photographs of digits on postcards. So someone gets a postcard they write you know to you know one one one nine nine nine View Avenue, and someone takes a picture of those one ones and nines. And there's a whole corpus of that, and so you can recognize different handwritten digits, right? And someone said, 'Oh, I have 99% accuracy in MNIST,' and I'm afraid to— release it. You know, it's gonna you know cause the singularity. And someone else was posting and they were saying, 'I have 100% accuracy on my model that predicts who died in the Titanic,' you know, which already happened, right?' Um, and so—

  91. A

    This is...

  92. B

    Just a bunch of really funny jokes. But actually, to be fair, I mean as much grief as they've been getting, the result is pretty cool, definitely not believable by anyone who knows anything about the context of the text. But still, it's actually pretty good accomplishment. And so I think also someone posted in that Reddit group just like a recreation of it already. But check it out; it's pretty funny and some pretty interesting reads too.

  93. A

    Yeah, I mean there was some discussion about getting into—everyone likes to talk about AI ethics. And so maybe that was cool. It just didn't seem like this was particularly what needed to get called in. That we got to make a decision about AI ethics right now because we're there like if they released this, whoosh, good luck. You know everybody who has a job as a writer or author, like you're—you're done. We're just gonna make like, oh that's what I get. They'll become a market for AI clones of popular work. So like, famously, a bunch of authors have not finished their trilogies. People will just feed in like the first two books. George R.R. Martin, they'll just feed in all of the—all of the books and then out will pop the end book. And so yeah, I mean I

  94. B

    Don't think we're there reading a novel if you're okay reading a novel where nothing actually happens. Then—uh wait, yeah, go for it. Wait, but

  95. A

    That's the same as the first books. That's awesome. Okay, I'm a horrible person.

  96. B

    Speaking of books? Oh man.

  97. A

    My book.

  98. B

    Of the show, My Book. The show is a super long title but is also a very short and free book. Wow. It's called How the Economic Machine Works and How It Is Reflected. Now, um check this out. It's pretty cool. So the reason why I stumbled upon this book is I was looking at—I was trying to figure out what happens when someone can't fulfill an order. So like you're in the stock market. You say, 'Oh, I want to sell this stock,' and someone else says, like, 'Uh, uh, you know, someone else says at the same time I want to buy this stock.' And as long as he's willing to pay more than you're willing to sell it for, you make the transaction. Right? Um you can also short a stock, which, you know, I'm not going to get into. I'm not even an expert by any means. But basically the idea is you tell someone, 'Um, you know, I'm going to buy your stock at let's say 60 a month from now.' And and the person says okay. And so, you know, even if the stock goes to like a hundred dollars, you know that person still promised to sell it to you for 60. And so the higher it goes, the more money you make. Um but I always wonder—it always surprised me these things like shorting. Like what happens if that person just can't fulfill that? What if that person can't pay? You know they promise to pay you, but what if they literally can't? Um because I know that we all know that there's leverage. So there's people who say, 'Oh, I'll buy this for you for 50,' and they don't actually have the 50. Like this is actually more common than not. And so with all of this sort of um uh with all the speculation, like what happens when someone just can't pay? Or it's even worse with commodities. Someone says, 'Like I'm going to deliver a thousand cows to you to some butcher.' And then that person just literally just can't do it for whatever reason. And uh it turns out the exchanges do a lot more than I thought. Um so so basically the exchange backs all of these transactions. So if if that person promises to buy your stock for 50 and then um the stock goes to let's say a cent and that person somehow flees the country or whatever, he somehow gets out of it, the exchange market itself will still pay you the 50, and it'll just eat that loss. So part of what you're paying when you pay these commissions is to uh is basically insurance, you know, because there are transactions that fall through. And in the case of commodities, there's this thing called the cash market, which is just a fancy way of saying, you know, people are willing to sell things right away for for money. So um if someone promised you like a thousand cows they can't deliver, at any given time there's someone trying to sell cows for money, and the stock market will just pay whatever—or sorry, the commodity market will just pay whatever it takes to get you those cows, and they'll just eat it. Um now of course, you know people like the person who doesn't pay, like their credit is ruined or I don't know how it actually works in in that sense, but it just surprised me the degree to which the market actually um you know will bail people out, and it actually happens more often than you think. But

  99. A

    Is it not that? So I've not looked into this specific thing, um but is it not that if you're going through a brokerage or so most people don't access the market? Or well, I don't know. Most the person—a average person not directly involved with this would use a brokerage, and my guess is the brokerage has to be sort of put up money as part of uh interacting with the exchange. And I know what the brokerage will do in the case like 50 going down to one cent, like it could happen instantaneously, but typically it starts to slide, and you get margin called, which is basically they say either you need to put more money in or we're going to liquidate your positions and limit the loss. Because like you said they have to back it. So the brokerage would have to back it, which means they're going to basically do like a risk assessment and say how much other things do you have in your account? And they can just wipe your whole entire account to, you know, try to cover your position. And then they can even, you know, charge you money. So like you said if you were leveraged up and it would move market moved faster than they could liquidate your position, then uh you know they could come after you for what's left or whatever. And so I imagine that's on them, and that happens when uh when you have those those kind of like crashes. One of the things is like the Flash Crash is particularly kind of bad because if people freak out and liquidate your position and then the stock goes back up, you would have actually not been as bad off as it was when they liquidated you. But uh they weren't going to hold—they weren't going to be left holding the bags. But I imagined I don't know but that the when you directly, you know, communicate with the exchange, which I don't know how that that works with um but that you would have to put up some sort of bond like some sort of money on the side to say like, 'Hey, here's something that you know, like you said insurance. Like here's insurance.' So if I go belly up on this, that like it'll pay out, and that could either be sort of money or someone else who would agree to monitor your risk or, you know, basically be insurance.

  100. B

    Yeah, I mean it's basically a hierarchy of insurances. Like the brokerage is insuring you, the the the marketplace is insuring the brokerages, so on and so forth. But yeah, it's it's pretty cool. And this this this article kind of explains that whole thing in detail. So um if you're into stuff like that, um check it out. It's pretty fascinating. So how

  101. A

    many pork belly futures did you buy? How many?

  102. B

    Isn't that um there's a movie where these people bought what was it? Orange juice. It's actually Florida orange juice futures. What was that movie called? And they totally went bankrupt. Um I'll have to look it up. I think it's Trading Places. Is that right, or is that a romantic comedy?

  103. A

    Uh, it was Trading Places. Was that one? Is it what has Eddie Murray—Eddie Murphy in it, right?

  104. B

    Oh no, that's not it. I'll have to look it up later, but there's a show where basically it's like a Wolf of Wall Street type thing where these people are riding.

  105. A

    High? Yeah, Orange Juice Futures Contracts. Buying frozen concentrated orange juice futures contracts. Yeah, is that they're saying it's some part of Trading Places? I don't know if I've ever seen this.

  106. B

    Movie? Oh yeah. Yeah, yeah, yeah, yeah. So, so that's what does the end, all right?

  107. A

    Um, yeah. Well, my book of the show is Salvation by Peter F. Hamilton. I've recommended books from his other series and standalone ones before. This is his newest one, so this is the first of what I did check said that it was going to be a trilogy, so I messed that up before, but this one did say. Although now, now I'm missing—I'm missing it. Oh no, now I'm worried. I thought I had checked this right before I did. Uh oh. Well, um, so I'll just say series just to be safe. So this is book one of his series. I think it came out in 2018, like pretty recently. Um, but it is a sci-fi book. It's a little different. I'm having just finished the first book, which it's a pretty hefty, hefty book. I listened to it on Audible, which I normally do. I want—I'm gonna look it up. I think it was here. I'm gonna tell you number in a minute anyways. Um, but it's a science fiction book, and oh crap, I just started downloading it. That's not what I wanted to do. No, okay, no, never mind. I'm gonna ruin my internet connection. So the well, I already.

  108. B

    Locked my screen and that uh froze my Audacity for a bit, so we're in good.

  109. A

    Shape. Uh, so this book is set in multiple kind of time periods. So all in the future, all sort of like you know science fiction, but there's sort of like different timelines being explored. So it'll sort of like jump back and forth between sort of like a future timeline and a past timeline. And I think that was a little different than sort of a lot of his other works, and so I kind of enjoyed it. So like there's some stuff playing, like sort of far out some play stuff playing. Well, I guess there's no past because like I'm not clear what the current is, but the most forward timeline and the least most back timeline are spread pretty far apart. Um, and it's sort of like a detective thing. I didn't feel like it focused as much on some of the sort of technology stuff as he's done before, but I thought it was a pretty good book. It was a little tough. I think that's an interesting idea, you.

  110. B

    Know? Like if I guess in one sense, like it's not like a Back to the Future thing where you're worried about influencing the future because you're just reading things that happened, but they're happening at different times. It's kind.

  111. A

    Of cool. Yeah. So I mean in what plays out in this, it's like you're seeing the impact of stuff. You're like, oh, this is the way the world is, and they sort of go to the past and say something. I'm like, oh, that's why that's happening. Um, and so I thought that's cool. It says it's a trilogy. I did see confirmation. So yeah, it says it's the first book in a trilogy. So I did not mess that up. Very cool. Um, but yeah, so Salvation, you know, it's hard judging like the first book because like it does a lot of world building. It's setting it up. But you know, like if you've read he has other series which are finished, um and so The Commonwealth Saga series. I enjoyed a lot. I really like that one. So I'm hopeful that this series is also going to be good, and I thought this was a solid first outing. It didn't really grab me. Um, but but I'm hanging in there. I think it's going to.

  112. B

    Be good. So cool. And you can eventually you can watch or listen to the whole trilogy on Audible. Is this—this is the second?

  113. A

    One? You said this is.

  114. B

    The first one? Oh, first one. Okay. And so the second one will be out what probably next year. Yeah, he's.

  115. A

    A pretty prolific writer, so I would be sorry. So this one clocks in at 19 hours and two minutes, so.

  116. B

    Not his longest. Wow. Um yeah, you can check those out on Audible. You go to audibletrial.com/programmingthrowdown. That gives us some support for the show. You can also follow us on Patreon—patreon.com/programmingthrowdown. All patrons get the super fast RSS feed thanks to Patreon. And with that, my tool of this show, this is honestly one of my favorite tools of the show ever. It's not useful. It's not, you know, the most useful tool I've ever put, but it's hilarious. It's called the Sierra Death Generator. It actually—it was—it has that name because it was originally just all of the Sierra games. If you ever played like King's Quest, um, a lot of these point-and-click adventure games—I'm drawing a blank right now, but King's Quest is definitely the most popular. It's like

  117. A

    Five. It's like Monkey Island, something like that. Yeah.

  118. B

    Monkey Island, that's right. And so what this person did is they took various motifs for those—like the death screen and even like the 'You completed the game' screen. And he actually pulled all of the fonts—I don't know how he did this, like if he pulled it from the game RAM or if he took a bunch of screenshots and edited them, but he has the exact font and he has the exact position so that you can replace the message in the death screen with anything you want, and it will look extremely accurate. And it's amazing for making memes, party invitations. Whenever I have meetings now at work, I'll just like put that as the meeting invite. It's hilarious. Oh yeah, and so he's included so many games now—there's like Mario 64, there's all the Zelda games, Metal Gear.

  119. A

    Solid. Yes. Yeah.

  120. B

    Metal Gear Solid, System Shock, Doom, Duke Nukem, and all the fonts are perfect. Railroad Tycoon. And I've made some absolutely hilarious memes. This is an absolute riot. If you want to set up a meeting or an invite to like your birthday or something like that, this thing is fantastic. I highly recommend it. Absolutely hilarious. Definitely check it out. But so I

  121. A

    was clicking through these though and I have two concerns. First of all, like I'm not clear how many people I work with who mostly are younger are gonna would know many of these titles. And then just in general, even people of any age, like you have to be pretty nerdy for some of these. So some of them, like the Zelda ones, I think are a little obvious, or Pokémon because you can kind of see the people, but some of these other ones, I'm like I'm not sure I would recognize where this is from.

  122. B

    Yeah, there's definitely a lot of esoteric ones. Um yeah, I mean stick to the, you know, Mario 64. Yeah, you know, stick to the heavy hitters. But yeah, I sent a letter from Princess Toad's to all that my co-worker saw was pretty hilarious. You must have

  123. A

    been very proud of.

  124. B

    Yourself. I was—I was like, 'Look at you guys! I got this stuff figured out!' People thought I actually made it myself. Like how long did that take? I was like if only you knew the secret.

  125. A

    My tool of the show is a game, but this one's actually not a tablet game. I feel like I'm—I just—I'm falling down the well of, 'Oh my gosh, what are you doing?' So this one is a console game, and it's called Overcooked, and I thought this was pretty cool. I, you know, I'm late to the game. Is it?

  126. B

    A puzzle game, I think.

  127. A

    I played this—kind of not really a puzzle game. Um but I'm way behind the times. I think there's even like Overcooked 2 now, but I play really old games that are like super cheap because I don't play games that much. And so yeah, so I got this one. I actually think I got it free on my Xbox One. I have the like Xbox membership someone gifted me, and so I get like a couple games free a month or whatever, and this is one of them. And I was like, a lot of them are junk in my opinion, but I was playing this one, and in this game you are supposed to be preparing food for people, ignoring the actual storyline. You're preparing food for people, and each food has sort of a recipe, and you control a little character and need to get ingredients and then perform some number of steps. So it might be like get a tomato from the tomato bin, put it on the cutting board, and then chop the tomato. And chopping the tomato, you know, takes some amount of time. And then once you chop the tomato, you need to go and put it on a plate. And then you need to chop some lettuce, put that on a plate. And then once the tomato and lettuce are on a plate, you can now serve it. And there's little cards that tell you what you're trying to cook for the current people that are up there. And there's some optimizations you can do about what you're working on, how complex a given dish is, and you serve it. Then it comes back dirty. Then you need to wash the plate and then put it back. And it's a series of tasks, and some things need to be cooked in like a stock pot as like a soup, and if you leave them on too long they'll burn. And so the game becomes this sort of micromanaging because there are several characters running around, and I originally played it cooperative with other people, and you have to do this sort of hilarious amount of coordination between everyone to be like, 'I'm gonna do the chopping,' and 'you're going to take the food that's chopped and take it to the plate and serve it and then wash the dish when it comes back.' You know, trying to divvy up the tasks, and you know, you're working. Through the first couple levels and you're feeling pretty good. But then you realize the game starts like throwing a monkey wrench into it, and so they'll have like a path that's only one person wide, and so you can't actually go back and forth. So everyone needs to go like around a racetrack, like counterclockwise. They'll have something where cockroaches will come out from underneath the cabinets and grab your food if you leave it sitting there. They'll introduce various mechanics where the game world shifts around. People are walking through like you sort of know can't always get where you want. Cars that come together and separate, and so like you know you're all these crazy places you're cooking, and I thought it was just really fun. I enjoyed it. I mean, I can't say I actually beat it. I got stuck, but I had a lot of fun. It was a really clever, light-hearted thing. I'm not sure I would have paid the original price for whatever it was if it was expensive, but I've seen them on discounts a lot because it's been out for a while. But I will say what I've been trying to do and I just can't make my brain work this way is like I'll call it Extreme version because for me it was extreme is you take your controller, and it sort of becomes split in half in the layout so the left half controls one person and the right half controls another person. Oh, and so you have two people and you're trying to make them work together at the same time in your head. Like you control two characters and you do it by like controlling each half of the controller, and and making them run around and do stuff. And I yeah, I

  128. B

    That sounds really difficult.

  129. A

    I feel like I want to be good at doing this, but I just like each time I just find one of the guys just standing there doing nothing, and

  130. B

    Yeah, that's awesome. I'm gonna have to check this out. I really love party games because you know we've been actually playing more games in the living room where we'll just all gather around the TV. Yeah, and so you know games, especially games where you know it sounds like this is one where you know at least on the earlier levels you could have one person who maybe isn't as efficient as everyone else.

  131. A

    Definitely still kind of

  132. B

    play it and have fun.

  133. A

    Yeah, and if you play on like higher player counts too, I think we've played like three or four people. Yeah, and yeah, if one person is messing it's not the end of the world. You might not get a high score. You know, you're not gonna beat the end levels, but yeah, you can definitely have fun. It's hilarious, and people are like yelling at each other like, 'Get out of my way!'

  134. B

    No, I'm doing that well. You weren't. That sounds awesome.

  135. A

    Anyways, and that's available for like a lot of consoles, like I think Switch, the Xbox One, PlayStation 4. So if you have a current-gen console, I'm pretty sure it's available.

  136. B

    Cool man. Yeah, I'll totally check that out. All right, on to TypeScript. I've been using a lot of TypeScript lately. I've been building a little front end for a data analysis pipeline that I've been building, and it's really nice actually. The tooling is great. And so we'll kind of recap, you know, to understand TypeScript, you have to really understand typing, right? Otherwise,

  137. A

    It may be

  138. B

    The appeal is just lost, right? So um yeah, basically, and I've talked about this before, and actually I've gotten a lot of flack for this. This might be the thing that I get the most hate mail about in the history of us doing this show, but I'm just not a big fan of statically typed languages. Um I'm sorry, dynamically typed languages? Oh man, you're about to

  139. A

    get me on you? Oh man, yeah, I

  140. B

    know. I'm not a big fan of like—we'll call it—like I guess pure Python. I don't know what you want to call it, um or JavaScript or things like that. And basically, it just kind of falls apart in many different ways. Um now, you know, just a caveat: so Python 3 has the typing module, which everyone should be using. Um and now JavaScript has TypeScript, and they've had CoffeeScript and other things in the past. It seems like TypeScript is sort of—has come to sort of dominate. But all of these things are, you know, and also there's Mypy, which was what you could use in Python before Python 3. Um but all these things are basically transpilers. So what they do is is, you know, if you don't put the type um in Python, it's not going to error like it would in C. I can see—you can't just say X equals three; it's going to blow up. Um but in Python, uh even with the typing support, you can still say X equals three. Nothing's going to stop you unless you have like a linter error that's really strict. Um But but you don't get a compiler or anything like that. Um but but you can say, well, if you say X equals three, um it's going to assume that X is an integer. So then if your next line is, you know, X equals dog, then you actually will get a warning. It'll say, 'Hey, you know, you just said X equals three and now you're saying it's a dog.' You know, that just seems a little shady. Um you could do X: Any = 3 and now you're telling the—the—um type system, leave me alone. Like you're saying like I I I want X to be anything. Don't correct me. Um you can do that. Um but if you do, you know, X equals three and then later on you pass X into a function, and um that person who wrote that function—let's say a week later changes that function to now take strings instead of integers, that's going to cause an error right away. So it's not like that person will make that change and then the next time, you know, you deploy version 10 of your system, it just blows up or your unit tests kind of blow up in some weird way. Um you know that the type system is going to catch that immediately and tell that person who's making that change, 'Hey buddy, someone's passing in an integer to this.' So, you know, if you're going to make that change and say that's going to be a string, then you know we need to reconcile that. Um And actually, I mean, I would say even to this day the majority of the errors get caught in this way. So there's—there's the majority of the time um, you know, I don't actually have to run something because I've caught some error right away and I can just go in and fix it. And when I run things, the chance that they're successful goes way up. And Patrick, I think you mostly use statically typed languages, right? Do you do a lot of dynamically typed languages? No, I

  141. A

    don't. I not that I avoid them. I just—I avoid them.

  142. B

    I thought you did Scala now? Or no?

  143. A

    No. So I've—I've done like dabbled in various of them, but I've not ever spent much time in them. So I currently—I've been doing some Python stuff, but as you point out, it was been mostly Python 2 stuff, so it's not with types. And the things you're pointing out are the issues I run into, which is people don't and in Python sometimes people do it intentionally, like change the type of a variable so in some places it's one thing and in some places is another and use that for sort of code flow. But that's to me is like really confusing. Uh yeah, I really try to avoid.

  144. B

    that. So just to—I mean, it is a hassle to set up, so not everyone has this set up. But with Python 2 you can use Mypy, and the way it actually works, it's—it's a little frustrating. It's done with comments. So you actually have to do the, you know, um you have to do like a, you know, double quote integer double quote. Um and you do that I think it's after the variable name, and then Mypy just strips out all those comments and after it does the type checking and

  145. A

    it's definitely not.

  146. B

    as nice as typing.

  147. A

    But it runs—uh basically this transpiling, this compiling step that's right? Yeah. So

  148. B

    Mypy will strip out all of those um things that you wrote and um along the way it will check the types, and that's exactly what TypeScript does as well. So you're putting all of these things that aren't valid JavaScript—like JavaScript doesn't expect you to put X: Int = 3. Um it's not expecting that. Um so what TypeScript does is it, you know, after it's done checking everything, it has to go through and delete all of that um extra code. And I think it's, you know, it's—it's not even like that would be kind of frustrating for them to do. So they don't actually do that. What they do is they they compile the code down, I believe, to some intermediate language and then decompile it. Um but uh one thing they do is they create what's called a source map, which is something that I don't think we've talked about ever on the show. But a source map is basically um when you're compiling code either to, you know, machine language or assembly code—thing, you want to kind of keep track of what line of source code contributed to what lines of whatever it is downstream. So in the case of TypeScript, it's like what line of TypeScript turned into, you know, this section could be part of a line, it could be multiple lines, but this section of JavaScript. And that's a source map. And so TypeScript will generate a source map. So, you know, when you have an error in your JavaScript, it's going to be very hard to look at that code and see what's going on because you didn't write it; it was generated by this TypeScript compiler, right? So the source along with some browser plugins and things like that will actually make it so that when you get an error, you see the error in TypeScript in your TypeScript file. And uh and Mypy has something similar for Python. So yeah, I think the—that is an option. Have you thought about doing that? Like running running Mypy? No, I didn't.

  149. A

    know that was a thing until three minutes.

  150. B

    ago? Okay. Yeah, I definitely recommend it. I mean, well, actually, why aren't you on Python 3? Is there like a really no, no, no, no when I said—

  151. A

    which Python and then I said 'Python dash dash version,' and it told me it was Python.

  152. B

    2. Oh, okay. All right. I think you have to do—well, depends on the OS, but if you're on Mac, you would have to brew install Python 3 or use Anaconda.

  153. A

    or one of.

  154. B

    those distributions. Yeah, but yeah, so but I—

  155. A

    I mean, I do agree with your preference for static typing because I feel one of the things is when you get in someone else's code, and that's the crazy thing is you might have an intuition for, 'Oh, this thing is supposed to be a, you know, this type or that type.' But when other people read it, especially code that isn't the middle—or is in the middle, so not like the highest, highest level code, but code in the middle or the bottom—it becomes very unclear and easy to lose track of what types are. So if you have code that's supposed to sort of which a lot of code ends up being pass stuff around or do some transformations, it's very difficult to tell what the type can be. And for someone coming in and trying to make something more efficient or to run better, it can be very difficult to tell what all, especially if you know like Jason was pointing out, like this type 'any' makes it very difficult to know that you're doing is safe across all the kinds of types that can be passed.

  156. B

    Yep. And then you have to handle optional as well. So like by default in Python, anything can be None at any time. And what's even worse is if a function takes—well, there's actually some checks for this, but depending on the language, I think in JavaScript, if a function in Python, if a function takes three arguments and you pass it to—I think it'll error, which is good. In JavaScript, I think it just fills the rest with undefined or nulls or something like that. So if someone adds an option to a function and they're expecting an option to be able to say true or false, and you haven't updated all of the different call sites, they'll start getting undefined. And so what happens is people have to guard against that. It just makes the code a total nightmare with TypeScript unless you say explicitly. And I think the way it works in TypeScript is you put a question mark in front of the type. So if you do 'x: ? int,' then that x could be equal to null or undefined, but if you just do 'x: int,' it has to be a number. If you do 'x: int = null,' you'll get an error. And so what that means is by default everything needs to exist, and which is actually really, really nice. You know, people think that—you know they're used to like C pointers and C++ pointers, which are null and become allocated and things like that. And in that world it kind of makes sense, like especially like, 'Oh, I've destroyed this object; all of its members should now be null or undefined or something,' right? But when you go to these higher-level languages in general, you really don't need a lot of things to be null. I mean, there might be some things that are sort of optional based on the context and things like that, but it's nothing compared to what you need when you're manipulating memory at the level of C or C++. So by default having null turned off is— actually a really nice feature. One of the so there's some disadvantages. It's not it's not like anything a silver bullet. One of the big disadvantages for TypeScript is you actually need to install two packages for every package. So for example, if you used to—if you typically say, 'You know, Yarn install on a jQuery,' now you also have to 'Yarn install typing-jquery,' which is just a file that gives you all the types. So you know, a lot of these systems they're either written in pure JavaScript or they don't want to have to force everyone to use TypeScript. And so for that reason, the way they get around that is they have a separate repository for all the types, which is pretty weird. I mean, it's just—it's this file that just has lists and lists and lists of types and then their location, and it must be programmatically generated because it just looks too difficult to write by hand. But so you have to kind of keep that in mind: if you don't install the typing, then the IDE will kind of complain, and you have to either go and turn that off or go find the typing. So that whole process could be pretty frustrating. You know, another thing is it takes time. So with JavaScript, you just run it. With TypeScript, you have to now do this process of turning it into JavaScript, although you know most computers now are so fast it doesn't really matter. And and it makes the deployment more complex. Like now if it's JavaScript, you just have to—you could if it's JavaScript, you could just rsync the code over to your web server. Most people want to run it through some type of packer or minifier or something like that, but those run extremely quickly. I mean, the simplest minifier would just cat all the files together, which could be done like almost instantly. Now you've— added this like compilation step. And so typically there is actually a program called TSC (TypeScript Compiler), and you could call that on all of your transcript files and then concatenate all these JavaScript files together by hand. But you know in practice nobody really does that. In practice people do—they always use Babel or Webpack. There's an extension called webpack-ts, but all of these things just are complicated. Like I mean it's going to take some serious setup time to get the right flow up and running. And TypeScript is still relatively new, so there's going to be some hiccups and things like that along the way. But with all that said, it's totally, totally worth it. I really enjoy the system that I have up and running right now. If you use an IDE, it gets even better. So if you use for example Visual Studio Code or Sublime with the TypeScript plugin, these IDs are actually communicating back and forth between the TypeScript compiler, and so you know they'll give you errors right away. They're also sort of plugged into the types of the objects. So if you do—you know, if you pass in an 'x' to another function that function, you do 'x dot,' you're going to get the functions on int. You know, it's going to know that it's going to do the type inferencing and things like that for you. So definitely, you know, IDE really doubles the advantage of TypeScript. But even if you're just using Emacs, your TypeScript is a huge savings, and you know it works with Flywheel and these other Emacs plugins. So overall, I highly recommend it.

  157. A

    Getting time to actually learn to do front end is still on my list, but now that you know, I was talking to Jason before. I previously was like, 'Oh, CoffeeScript seems like a way for me to ease into not having to deal with the craziness of no types,' but I've been informed it's dead. So—

  158. B

    and it's gone. Yeah, I would recommend it. I mean, it took me a while definitely to get up to speed. It's been years since I built a website, and everything I'd built up until now is with pure JavaScript. This is my first time doing TypeScript, so there's definitely a learning curve, but it was—it's really nice once you get it up and running. But I think it sounds like the first thing you need to do is get on Python 3. Oh, okay.

  159. A

    Because I shouldn't have admitted that. Apparently, this is a bad thing. That's just crazy. Yeah. Oh, it's end of life. We didn't talk about that, did we? But

  160. B

    Yeah, that's right. That's right. When is that? Do you know?

  161. A

    I don't know.

  162. B

    Sometimes. Yeah. So I'll fill in while you're looking at basically Python. So yeah, the backstory here is a little bit interesting. Is—they created Python 3, and Python 3 is not backwards compatible. And this is pretty mind-blowing. A lot of people don't know this, but the biggest reason why it's not backwards compatible is the way strings are handled. And anyone who's ever done Unicode or internationalization in Python 2 knows what a total disaster it is. Python 2 strings were kind of designed to be single-byte strings that kind of comes from the C days where it's like you'd have a string of four characters and it just meant kind of four bytes. The issue is, you know, then they needed to support multi-byte characters for Unicode, so they created a Unicode type. And it's just—it created total havoc because again, without type safety, people would pass in Unicode types to functions that were expecting string types. And some of the functions wouldn't work the way they expected. So then Python got really strict about that. And if you tried to run like string functions on the Unicode type, Python would just error. It just—it just became very aggressive about failing instead of trying to do the right thing. As a defense mechanism for weak typing, Python 3 fixes all of that by just deleting the string type and renaming the Unicode type to String. And that is awesome, but it's a pretty devastating change. Like almost every app uses a string, so it caused a lot of drama. There are times—there's a whole there's years where people are saying, Py3 is just gonna die things like that. But the Unicode thing is super frustrating, and eventually it kind of

  163. A

    Won over. January 1st, 2020: Python 2.7 loses its support. That's

  164. B

    Pretty soon, I mean.

  165. A

    Relatively, or at least that's according to pythonclock.org in

  166. B

    Ten months? Oh, Python Clock. It's just a clock that counts down the death of

  167. A

    Python. Yes. Fight on two.

  168. B

    Amazing. Yeah, right. Very cool. Well, yeah, definitely switch to Python 3. Use the typing module. It will save you a lot of headache.

  169. A

    That was a good end to our

  170. B

    TypeScript episode. That's right. Use typing. Typing is great, and you know it's a short month, so we'll keep the TypeScript topic relatively short, but you should—you should all fantastic! You can use it for browser or server, so it actually supports both. So I have it my is set up right now, which you can see in that news article I posted. Actually has TypeScript on both with hot reloading, so it's the hotness. Check it out. All right, till

  171. A

    Next time, see you.

  172. B

    Later. The intro music is axo by Binar Pilot. Programming Throwdown is distributed under a Creative Commons Attribution-ShareAlike 2.0 license. You're free to share, copy, distribute, transmit the work, to remix, adapt the work, but you must provide attribution to Patrick and I, and ShareAlike, and kind.