Programming Throwdown - Typescript

Episode Date: March 4, 2019

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/2019/03/episode-87-typescript.html ★ Support this podcast on Patreon ★

Transcript
Discussion (0)
Starting point is 00:00:00 programming throwdown episode 87 typescript take it away jason hey everyone welcome back awesome friday episode you know friday's a short month and uh it's always tough for us to uh Hey everyone, welcome back. Awesome Friday episode. Friday's a short month and it's always tough for us to plan. Sorry, not Friday. February's a short month. It's always hard for us to plan February. It's also my birth month. That doesn't help. Happy birthday! Thank you. I'm born right in the middle of the month.
Starting point is 00:00:45 Oh, we missed it. there's a wrench into things um but uh yeah here we are and hopefully we'll get this out to you uh right before uh before before march wait but that means you have to do it before friday of february that's correct because friday is march okay is friday march or saturday march friday friday that's a challenge we'll see if we can do it. We're going to do it. All right. So I'm actually going to talk about micro kitchens. Now, this is maybe very specific to Silicon Valley.
Starting point is 00:01:14 I don't know. No, I take it back. I worked at other places that had this. But a micro kitchen is basically a place where you can go that has food. It could be either a vending machine or or it could be free food um and micro kitchens are dangerous and so i tend to go through these cycles where um it's sort of like waking up uh like like 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 or something insane oh i'm like okay this has to stop and so i'll
Starting point is 00:01:51 like just stop eating any snacks and uh um 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 like regulate 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 uh 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
Starting point is 00:02:37 have yeah like some vending machine and there's typically refrigerators and a microwave and almost every place has coffee or a water cooler in 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 uh no i mean the thing is for me is like uh you know i'll hit compile and then maybe 30 seconds there's 30 seconds and uh i'll find myself going and getting a chocolate in that 30 seconds i'll come 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.
Starting point is 00:03:16 You get in this habit of like, I have this little delay. So let me go eat snacks. I have this. 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 um 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 know, a smoothie or something like that.
Starting point is 00:03:45 Or a brownie, or a cookie. No, 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 year, it'd be fine. But anything's perishable if you open it up and leave it out. Yeah, that doesn't count. That's totally cheating. That's like eating lobster on lent or something. So, 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.
Starting point is 00:04:18 And so I'm trying to see if that's going to 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
Starting point is 00:04:54 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 over consume yeah and it's a total waste like you're not really getting anything out of it and um 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 are like you know what is this person talking about because i'm a total beanpole if you've ever seen me i'm very skinny person but um it turns out this this people might
Starting point is 00:05:31 not know this but if you're like regardless of your frame um 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 uh so it's important for everyone to eat healthy. I feel like this became a PSA. Like, eat healthy, and I feel like you're about to say exercise. Yeah, that's right. Eat healthy, exercise. I don't know, what are the other ones?
Starting point is 00:05:55 Love yourself. We're just going to, the whole thing from now on is going to be a self-help episode. And use TypeScript. One of those things is true uh yeah all right well talking starting in on the news i'll go first so i 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 uh and space is cool
Starting point is 00:06:30 and so this uh last week virgin galactic uh went to space which they had traveled to space before on their newly designed spaceship two um and well uh it has a reversion a revision of spaceship one so now we version our rockets or our spaceships so spaceship two 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. So it was like a pilot test or something.
Starting point is 00:07:10 Yeah. 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. And it's just kind of exciting because I know we've talked about this in the past about when everyone was anticipating it. And I think it was very during the, what was that? The X Prize for going to space.
Starting point is 00:07:36 I have to be careful not to say SpaceX. The X Prize for going to space. Is that where the name came from? SpaceX from the X Prize? Not that i know of but it might be i don't i don't know um we'd have to look it up um the but people got really excited about buying tickets to go to space and there was 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 it, and then we actually just tried to make progress on it.
Starting point is 00:08:07 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. Really cool. So SpaceX and XPRIZE are not related. It's just a coincidence. But the Virgin Galactic, so what is it? What's the trajectory like? I mean, does it
Starting point is 00:08:34 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, 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 past the, is it the, oh man, I always forget the Carmen line or something well oh okay yeah but there's like a line that's generally considered uh i think it's the carmen 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 really yeah because space it's a gradient of atmosphere right yeah there's no like sign you know earth ends here and it's not so 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 very few
Starting point is 00:09:45 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 of hydrogen atoms from earth so earth's atmosphere is more and more diffuse all the way up 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 uh very close to earth atmosphere very dense at at the moon, basically non-existent, but somewhere, you know, in between, there's varying levels.
Starting point is 00:10:34 So most people would say, you know, satellites are orbiting in space, but some satellites orbit much lower than other satellites, very drastically different altitudes that satellites can orbit at. So yeah, cool. Anyways, yeah, so they made it to just space or at least recognized by the u.s as having done so and i think the last episode or a few episodes ago we looked this up and it was 100k for one ticket oh 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 a lot of money for a short experience 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, yeah.
Starting point is 00:11:10 I mean, then it's like, 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 that seems pretty awesome but i don't know how far away that is that's obviously much
Starting point is 00:11:35 even more difficult than what they're doing now so i feel like uh i mean it can't be that much more difficult right because when you the further out get, the less energy you need to go further, right? I mean, I guess that's hard for me 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.
Starting point is 00:11:56 I just need to go play some more Kerbal. But I think... So the issue is to get the extra height, though, the extra speed you need to be able to reach orbit and the extra height though the extra speed you need and you know to to be able to reach orbit and extra the height reach orbital velocities the the extra uh 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 uh so yeah that makes sense i mean it's
Starting point is 00:12:21 doable obviously like we get to outer space with satellites and stuff. But I don't think it's easy. And I think... And it becomes even more expensive. Yeah. And more dangerous. Yeah, makes sense. All right, my article is Hot Reload All the Things.
Starting point is 00:12:37 So this is about something I think is pretty fascinating. Basically, so just to give a little background here. So 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 http://mywebsite.com slash foo, and then there's a handler that has to process that foo and 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 your browser so the code that's executing on the browser is also running
Starting point is 00:13:28 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're you have an endpoint, it's supposed to return your name, and it only returns your first name. So you say, oops, you might have to say, okay, change the code, you know, add your last name, you know, compile it, maybe like, deploy it, like run a server maybe 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 do any of that basically you save the file and it's
Starting point is 00:14:16 just it notices that you've saved it and it hits reload automatically and you just see the change right away it's's really cool. So, you know, when I was trying to get, you know, trying to get a new TypeScript project off the ground, I found this website and 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 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 just, you're seeing it kind of build itself. It feels almost like very like futuristic.
Starting point is 00:15:02 And so check this out. It pretty long pretty detailed it'll take some time to get through um but once you have it it's a very very cool framework to build a site nice uh so i looked it up i'm not sure how accurate it is but it looks like it's a factor of 32 to go from suborbital to uh orbital velocity oh that sounds like a problem so i might be misreading it we could stay 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 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 no no i mean it's no no it just like pops up and pops right back down oh so this is even in a different state i mean how many miles
Starting point is 00:15:50 are we talking about so this is the thing that always confuses me too so we were just talking about uh 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 oh i see right so like going 62 miles is like nothing like i commute 10 miles to work um yeah each day right so like going 62 miles at 60 miles an hour this is one hour driving on the highway uh california is a big state so we actually don't get very far if we drive for an hour um but that far up and And you don't have to fly horizontally, right? You can fly in sort of a circle, a spiral up. Yeah, right.
Starting point is 00:16:31 So actually, no. So Earth's atmosphere is sort of thin if you compare it to sort of the circumference of the Earth. Okay, that makes sense. Yeah, which is why you hear astronauts talk about this thin blue line is 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 substantial. This is 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.
Starting point is 00:17:02 Like there's not really that much use for the entire kind of core of the earth i mean there's use but not that we do anything about i didn't enjoy the effects of gravity i mean well sure but like we haven't found a way to really uh i guess my i mean i guess it's just rock and dirt at the end of the day. So it says the deepest hole ever dug was 12 kilometers, but Earth's radius is 6,378 kilometers. What? Wait, really? Yeah.
Starting point is 00:17:37 6,000 kilometers is the radius? Yeah. Oh, yeah, that makes sense. Now that I think about it. I mean, now that I think about the circumference you know yeah okay well this is completely off topic but yeah it just turns out for me i have 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
Starting point is 00:17:57 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 phasm unfathomably harder but then it makes sense like climbing a staircase is way harder than going for a walk i mean it's kind of wild but like uh 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 a whole continent underground that's just supported by light that's being harnessed.
Starting point is 00:18:43 That would have been just going into the ocean. I feel like you're going to spoil our book of the show and you're going to tell us this is the, uh, this is what the book you read was. No, no. I mean, that's, that would be a great book. A great sci-fi book. Yeah. Yeah. I mean, all that kind of stuff. Okay. Well onto my next post, my next link. Uh, so mine was, was i guess keep i must be on like a kick recently i don't know what it is anyways my next post is uh how flight radar 24 works so flight radar 24 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 um okay and
Starting point is 00:19:24 it's kind of cool actually uh over much of the world it'll show you sort of where you are so if you just go to flight radar 24 and you can uh you know just sort of like see i did this the other day we're just like toggling around looking at various airplanes if you're into like aviation you can see more about uh you know like the specific tail numbers and things um is it run by the government or something no so that's the interesting part so it's not and uh and i was actually trying to find the map but uh what happens is is that all commercial uh air well there's more nuance but i'm not and i 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
Starting point is 00:20:32 and i'm at this location and they send that out to other airplanes can listen um and okay what happens is with some uh 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, these little bursts of data that the planes send out. And by doing that, which is what this FlightRadar24 website,
Starting point is 00:21:02 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 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 the burst of data that comes from all the airplanes and then i could make a little little map on my you know raspberry pi and there's already people who developed all this that would show me like
Starting point is 00:21:45 all of the airplanes I can currently hear where they're at, what their current heading is. 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. 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 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 to the triangulation. So other people are able to,
Starting point is 00:22:32 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 of 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
Starting point is 00:22:49 i was 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 will help me oh that's just i 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 yet. Or like, so when my, so I have kids, and when we go to the airport to pick up family,
Starting point is 00:23:29 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 going to have to play that game anymore. No, I'm just going to pull up the thing and be like, oh, they're playing, yep, there it is. It's the one on approach right now. You're going to be that dad.
Starting point is 00:23:42 Yeah, well. You're going to be that dad who's like, nope, I found the plane with my ssh connection in the airport no uh well so so the other cool one of the things is that this uh flight radar 24 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
Starting point is 00:24:10 software defined radio stuff is also pretty cool that this is uh something i always read about but it's it's beginning to become like kind of interesting and all the different things that you can use to uh instead of having a traditional radio where you would have a knob to tune or whatever you you're able to have fpgas i think is how it works uh 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 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
Starting point is 00:25:11 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 uh and then you know sort of write your own decoders built into the the sort of chain where 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, 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.
Starting point is 00:25:49 They have this warning, you know, this won't emit frequencies other than what it's designed for, blah, blah, blah. Yeah. So you're only listening. So you're only receiving. So as 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 you don't transmit 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 me but listening I think listening is fine I mean if you're just listening I mean just absorbing some signal I can't see why that would be there would be any issue now there is some stuff about like I think what I've said is fine i mean if you're just listening i mean just absorbing some signal i can't see why that
Starting point is 00:26:25 would be there would be any issue now there is some stuff about like i think what i've said about listening also works for uh flights like uh 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 i'm sure they're all encrypted at that point, right? Well, but again, you can listen for the transponding signal's presence and figure out where it is. And the fact that it's encrypted seems like it might be meaningful. Oh, sure. Yeah, so but varying.
Starting point is 00:26:58 Yeah, that makes sense. So I don't know, again, not an expert, not a lawyer. 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 sense. Yeah, I mean, if you are getting a signal at a location 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. Well, you should make your own decisions about that, I guess. Yeah, I mean, sure, make your own decision,
Starting point is 00:27:29 but I'm going to 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
Starting point is 00:27:58 or the start of a monologue, and it would write more paragraphs of that monologue. So for example example you could say you know john f kennedy you know 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, 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.
Starting point is 00:28:37 Or no, they actually released the source code, but they didn't want to release the trained model. Or the corpus. Yeah, or the input data that they had um 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 um 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
Starting point is 00:29:14 reasoning could see some serious flaws in, you know, the semantics of what it was writing. You know, it's just, it's, 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 said, we're not going to show anyone this model because we're afraid that people will just
Starting point is 00:29:46 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 um 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 with this post is there's this data set called MNIST, which is literally a bunch of photographs of digits on postcards. to 111999 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.
Starting point is 00:30:39 It's going to cause the singularity, and someone else was posting posting and they were saying, I have 100% accuracy on my model that predicts who died in the Titanic, you know, which already happened. And so this is a bunch of really funny jokes. But and actually, to be fair, I mean, as much grief as they've been getting, the result is pretty cool definitely not believable by you know like anyone who knows anything about the context of the text but but
Starting point is 00:31:13 still it's actually pretty good accomplishment and so um i think also someone posted in that reddit group just like a recreation of it already um but uh check it out it's pretty funny and uh some pretty interesting reads too yeah i mean there was some discussion about getting into everyone likes to talk about ai ethics and so i maybe that was cool it just didn't seem like this was particularly what needed to get called in that we we gotta make a decision about ai ethics right now because we're there like if they released this whoosh uh 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 uh oh that's what i get they'll become a market for ai clones of popular work so
Starting point is 00:31:55 like uh like famously a bunch of authors have not finished their trilogies people will just feed in like the first two books uh george rr martin they'll just feed in all of the all of the books and then out will pop the the end book and so yeah i mean i don't think we're there okay reading a novel if you're okay reading a novel where nothing actually happens then uh yeah go for it wait but that's the same as the first books that's awesome okay i'm a horrible person speaking of books oh man my book of the show my book the show is a super long title but it's also a very short and free book wow it's called how the economic machine works and how it is reflected now. Check this out. It's pretty cool.
Starting point is 00:32:46 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 in the stock market, you say, oh, I want to sell this stock. And someone else says, like, you know, someone else says at the same time, I want to sell this stock. And someone else says, like, 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? You can also short a stock, which, you know, I'm not going to get into it. I'm not even an expert by any means. But basically, the idea is you tell someone, you know, I'm going to buy your stock at, let's say, $60 a month from now.
Starting point is 00:33:30 And and a person says, OK. And so, you know, even if the stock goes to like $100, you know, that person still promised to sell it to you for 60. And so the higher it goes, the more money you make. But it always surprised me, these things like shorting. What happens if that person just can't fulfill that? What if that person can't pay? They promised to pay you, but what if they literally can't? Because 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.
Starting point is 00:34:07 Like this is actually more common than not. And so with all of this sort of, with all this 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 it turns out the exchanges do a lot more than I thought. So basically, the exchange backs all of these transactions. So if that person promises to buy your stock for $50 and then the stock goes to, let's say, a cent and that person somehow flees the country out or whatever, he somehow gets out of it.
Starting point is 00:34:54 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 basically insurance, 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 people are willing to sell things right away for money. So if someone promised you like a thousand cows, they can't deliver. At any given time 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 now of course
Starting point is 00:35:39 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 that sense. But it just surprised me the degree to which the market actually, you know, will bail people out. And it actually happens more often than you think. But is it not that so I've not looked into this specific thing, but is it not that if you're going through a brokerage or so most people don't access the market or I don't know most the person, an 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 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
Starting point is 00:36:30 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 then 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
Starting point is 00:37:05 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 works with, 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.
Starting point is 00:37:44 And that could either be sort of money or someone else who would agree to monitor your risk or you know basically be insurance yeah i mean it's basically a hierarchy of insurances like the brokerage is insuring you the the marketplace is ensuring the brokerages so on and so forth but yeah it's it's pretty cool and this And this article kind of explains that whole thing in detail. So if you're into stuff like that, check it out. It's pretty fascinating. So how many pork belly futures did you buy? Isn't that, there's a movie where these people bought,
Starting point is 00:38:18 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 uh it was trading places was that one is it what has eddie murray eddie murphy right 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 high.
Starting point is 00:38:45 Yeah, Orange Juice Futures Contracts. Buying frozen concentrated Orange Juice Futures Contracts. Yeah, they're saying it's some part of Trading Places. I don't know if I've ever seen this movie. Oh, yeah, yeah, yeah. So that's what does the movie in the end. All right. Yeah.
Starting point is 00:39:01 Well, my book of the show is salvation by peter f hamilton um 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've messed that up before but this one did say although now now I'm missing it. Oh, no, now I'm worried. I thought I had checked this right before I did. Oh, well. So I'll just say series just to be safe.
Starting point is 00:39:32 So this is book one of his newest series. I think it came out in 2018, like pretty recently. But it is a sci-fi book. It's a little different. I'm having just finished the first book, which it's, uh, 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 going to tell you a number in a minute anyways. Um, but it's a science fiction book and, uh, Oh crap. I just started downloading it. That's not what I wanted
Starting point is 00:39:59 to do. No. Okay. No, nevermind. Uh, I'm going to ruin my internet connection uh so the well i already locked my screen and that uh froze my audacity for a bit so we're in good shape uh so this book is uh set in multiple uh kind of time periods um so all in the future all sort of like you know science fiction um but the 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 stuff playing.
Starting point is 00:40:42 Well, I guess there's no past because like i'm not clear what the current is but the most forwarded timeline and the least most back timeline are 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 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 of cool yeah so i mean in what plays out in this
Starting point is 00:41:21 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 was 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. 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.
Starting point is 00:42:02 And I thought this was a solid first outing. It didn't really grab me, but I'm hanging in there. I think it's going to be good. Cool. And you can eventually you can watch or listen to the whole trilogy on Audible. This is the second one you said? This is the first one. Oh, first one. Okay.
Starting point is 00:42:21 And so the second one will be out, what, probably next year? Yeah, he's a pretty prolific writer so this one clocks in at 19 hours and 2 minutes so not his longest wow yeah you can check those out on audible you go to audibletrial.com slash programmingthrowdown
Starting point is 00:42:38 that gives us some support for the show you can also follow us on follow us on Patreon, um, patreon.com slash programming throwdown. Um, all patrons get the super fast RSS feed. Thanks to Patreon. Um, and with that, my tool of the show, this is honestly one of my favorite tools of the show ever. Um, it's, it's, it's it's not useful um it's not you know the the most useful tool i've ever put but it's hilarious it's called the sierra death generator um it actually it was it's it has that name because it was originally um just all of the
Starting point is 00:43:20 sierra games if you ever played like king's quest um uh the the um a lot of these point and click adventure games uh I'm drawing a blank right now but um King's Quest is definitely the most popular is like five isn't like Monkey Island something like yeah Monkey Island that's right and so um what this person did is they took uh various various like 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 like pulled it from the game RAM or if he took a bunch of screenshots and edited them.
Starting point is 00:44:02 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 you know extremely accurate um and uh and it's amazing for making memes party invitations uh whenever i have meetings now at work i'll just like put that as the meeting invite um it's hilarious uh and oh yeah and so he's he's he's included so many games now there's like mario 64 there's all the zelda games metal gear solid yes yeah metal gear solid system shock doom duke nukem and and all the fonts are perfect railroad tycoon um and i've made some absolutely hilarious memes um this is an absolute riot if you want to set up a meeting uh or an
Starting point is 00:44:54 invite to like your birthday or something like that this thing is fantastic i highly recommend it um absolutely hilarious uh definitely check it out. So I was clicking through these, though, and I have two concerns. First of all, I'm not clear how many people I work with who mostly are younger would know many of these titles. And then just in general, even people of any age, 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 Pokemon, because you can kind of see the people. But of these other ones i'm like i'm not sure i would recognize where this is from
Starting point is 00:45:30 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 um but uh yeah i sent a letter from princess toads to all that my co-worker saw was pretty hilarious you must have been very proud of 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 it's like if only you knew the secret uh my tool of the show is a game but this one's actually not a tablet game i feel like i'm i i just i'm falling down the well of not helping people so this one is a console game uh and it's
Starting point is 00:46:14 called overcooked and i thought this was pretty cool i you know i'm late to the game i don't is it a puzzle game i think i've played this uh kind of not really a puzzle game? I think I've played this. Kind of. Not really a puzzle game. 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 I got this one. I actually think I got it free on my Xbox one. I have the like Xbox membership someone gifted me.
Starting point is 00:46:43 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 um in my opinion but i was playing this one and in this game you are supposed to be uh preparing food for people ignoring the actual like storyline you're preparing food for. 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 need to chop some lettuce put that on a plate and then once the tomato and lettuce
Starting point is 00:47:28 are on a plate you can now serve it and there's little cards that tell you you know what you're trying to cook for the current people that are up there and there's some you know 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 like micromanaging
Starting point is 00:47:56 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 going to do the chopping. And you're going to, you know, take the food that's chopped and take it to the plate and serve it and then wash the dish when it comes back. And, 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.
Starting point is 00:48:32 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 like introduce various mechanics where the game world shifts around. People are walking through. You can't always get where you want. Cars that come together and separate. And so all these crazy places you're cooking.
Starting point is 00:48:59 And I thought it was just really fun. I enjoyed it. I can't say I really beat it. I got stuck. But I had fun. It was a really clever light-hearted thing i'm not sure i would have paid the original price for it whatever it was if it was expensive but um 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've i just i can't make my brain work this way is the 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 in half in the layout so the left half
Starting point is 00:49:32 controls one person and the right half controls another person oh and so you're 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 uh and and make them run around and do stuff and i yeah that sounds really difficult 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 yeah that's awesome i'm gonna have to check this out i really love uh party games because uh you know we've been actually playing more um games in the living room where we'll just all
Starting point is 00:50:10 gather around the tv yeah and so you know games especially games where you 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 definitely still kind of play it and have fun. 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,
Starting point is 00:50:32 it's not the end of 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,
Starting point is 00:50:38 like get out of my way. No, I'm doing that. Well, you weren't. That sounds awesome. Anyways, and that's available for like a lot of consoles,
Starting point is 00:50:44 like I think switch the xbox one playstation 4 so if you have a current gen console i'm pretty sure it's available cool man yeah i'll totally check that out all right on to typescript um i've been using a lot of typescript lately i've been building a little front end for this analysis, this 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. To understand TypeScript, you have to really understand typing, right? Otherwise, the appeal is just lost, right?
Starting point is 00:51:28 So, 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. I'm sorry, dynamically typed languages oh man you're about to get me on you oh man yeah i know i'm not a big fan of like uh 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
Starting point is 00:51:58 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 has typescript and they've had coffee script and other things in the past it seems like typescript is sort of uh has come to sort of dominate um but but all of these things are you know and also there's mypy which was what you could use in Python before Python 3 but all of these things are basically transpilers so what they do is if you don't put the type in Python it's not going to error like it would in C like in C you can't just say x equals 3. It's going to blow up.
Starting point is 00:52:46 But in Python, even with the typing support, you can still say x equals 3. Nothing's going to stop you unless you have like a linter that's really strict. But you don't get a compile error or anything like that. But you can say, well if you say x equals 3, it's going to assume that x is an integer. So then if your next line is x equals dog, then you actually will get a warning. It'll say, hey, you just said x equals a 3, and now you're saying it's a dog. That just seems a little shady.
Starting point is 00:53:18 You could do x colon any equals 3, and now you're telling the type system, leave me alone. Like you're saying, I want x to be anything. Don't correct me. You can do that. But if you do, you know, x equals three, and then later on, you pass x into a function. And 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 deploy version 10 of your system, it just blows up or your unit tests kind of blow up in some weird way. The type system is going to catch that immediately
Starting point is 00:54:06 and tell that person who's making that change, hey, buddy, someone's passing in an integer to this. So if you're going to make that change and say that's going to be a string, then we need to reconcile that. And actually, I would say even to this day, the majority of the errors get caught in this way. So the majority of the time, 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.
Starting point is 00:54:40 And Patrick, I think you mostly use statically typed languages, right? Do you do a lot of dynamically typed languages? No, I don't. Not that I avoid them. I just, I avoid them. I thought you did Scala now or no? No. So I've done, like dabbled in various of them, but I've not ever spent much time in them.
Starting point is 00:55:02 So I currently I've been doing some Python stuff. But as you point out, it was been mostly 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 hard to follow with 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 my pi 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 the um you have to do like a you know a double
Starting point is 00:55:45 quote integer double quote um and you do that i think it's after the variable name and then my pie just strips out all those comments and after it does the type checking and it's definitely not as nice as typing but it runs uh basically this transpiling this comp compiling step. That's right. So MyPy will strip out all of those things that you wrote, and 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 colon int equals three. It's not expecting that.
Starting point is 00:56:24 So what TypeScript does is after 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 um 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.
Starting point is 00:57:11 So in the case of TypeScript, it's like what line of TypeScript turned into 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 when you have an error in of JavaScript, and that's a source map. And so TypeScript will generate a
Starting point is 00:57:25 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 and my pi has something similar for python so yeah i think the that is an option have you thought about doing that like running my pi no i didn't know that was a thing until three minutes ago okay yeah i definitely recommend it i mean well actually why aren't you on python 3
Starting point is 00:58:06 don't is there like a really no reason no no no when i said which python and then i said python dash dash version and it told me it was python 2 oh okay all right i think you have to do well depends on the os but uh um if you're on mac you would have to brew install python 3 or use anaconda or one of those distributions yeah but uh but yeah so but i mean i do i do agree with your 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 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
Starting point is 00:58:55 middle or is is in the middle so not like the highest level code but code in the middle or the bottom it becomes very unclear and easy to lose track of what types. So if you have code that's supposed to sort of which a lot of code ends up being passed 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 they're more efficient, or to run better, it can be very difficult to tell what all 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 in 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 um well it gets there's actually
Starting point is 00:59:47 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 two i think it'll error which is good um in javascript i think it just fills the rest with undefined or nulls or something like that so 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.
Starting point is 01:00:17 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 colon question mark int, then that x could be equal to null or undefined. But if you just do x colon int, it has to be a number.
Starting point is 01:00:39 If you do x colon int equals 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.
Starting point is 01:01:01 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 um 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. So there's some disadvantages. It's not like anything is over bullet. One of the big disadvantages for TypeScript is you actually need to install two packages for every package.
Starting point is 01:01:47 So for example, if you typically say, yarn install jQuery, now you also have to yarn install typing jQuery, which is just a file that gives you all the types. So 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 um 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
Starting point is 01:02:18 um just 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 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.
Starting point is 01:02:52 Although most computers now are so fast, it doesn't really matter. And it makes the deployment more complex. 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 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 um now you've added this compilation step. And so you typically, there is actually a program called TSC, Transcript Compiler.
Starting point is 01:03:32 And you could call that on all of your transcript files and then concatenate all these JavaScript files together by hand. But in practice, nobody really does that. In practice, people do, they use Babel or Webpack. There's an extension called Webpack dash TS. But all of these things just are complicated. Like, I mean, it's going to take some serious setup time to get, you know, kind of the right flow up and running. And TypeScript is still
Starting point is 01:04:00 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 IDEs are actually communicating back and forth between 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
Starting point is 01:04:39 in an X to another function, that function, you do 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
Starting point is 01:04:59 TypeScript is a huge savings and you know it works with Flywheel and these other Emacs plugins. So overall, I highly recommend it. Getting time to actually learn to do front end is, is still on my list. But now that, you know, I was talking to Jason before, I mean, I, I previously was like, oh, CoffeeScript, this seems like a way for me to ease into not having to deal with the
Starting point is 01:05:21 craziness of no types, but I've been informed it's dead. So, and it's dead. So... 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
Starting point is 01:05:39 is with pure JavaScript. This is my first time doing TypeScript. So there's definitely a learning curve, but 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.
Starting point is 01:05:54 I shouldn't have admitted that. Apparently this is a bad thing now. It's end of life. We didn't talk about that, did we? But yeah. That's right. That's right. When is that? Do you know? I don't know. Sometimes. Yeah, so I'll fill in while you're looking. Basically,
Starting point is 01:06:10 Python... The backstory here is a little bit interesting. They created Python 3, and Python 3 is not backwards compatible. And this is pretty mind-blowing.
Starting point is 01:06:26 A lot of people don't know this, but the biggest reason why it's 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 um the issue is you know then they needed to support multi-byte characters for unicode so they created a unicode type and it just created total havoc because, again, without type safety, people would pass in Unicode types to functions that were expecting string types.
Starting point is 01:07:13 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 string functions on the Unicode type, Python would just error. They just became very aggressive about failing instead of trying to do the right thing as a defense mechanism for the weak typing. Python 3 fixes all of that by just deleting the string type and renaming the Unicode type string. And that is awesome. But it's a pretty devastating change.
Starting point is 01:07:50 Like almost every app uses a string. So it caused a lot of drama. There's times, there's a whole, there's years where people are saying Py3 is just going to die, things like that. But the Unicode thing is super frustrating and eventually it kind of went over. January 1st, 2020.
Starting point is 01:08:09 Python 2.7 loses its support. That's pretty soon. Or at least that's according to pythonclock.org in 10 months. Oh, pythonclock.org. It's just a clock that counts down the death of Python. Yes. Python 2.
Starting point is 01:08:24 Amazing. Yeah, right. Very cool. Well, yeah, definitely switch to Python 3. Use the typing module. It will save you a lot of headache. That was a good end to our TypeScript episode. That's right.
Starting point is 01:08:36 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 all be fantastic. You know, it's a short month, so we'll keep the TypeScript topic relatively short. But you should all be fantastic. You can use it for browser or server. So it actually supports both. So I have it set up right now, which you can see in that news article I posted.
Starting point is 01:08:58 It actually has TypeScript on both with the hot reloading. So it's the hotness. Check it out. All right. Until next time. See you later. The intro music is Axo by Binar Pilot. Programming Throwdown is distributed
Starting point is 01:09:15 under a Creative Commons Attribution Share Alike 2.0 license. You're free to share, copy, distribute, transmit the work, to remix, adapt the work, but you must provide an attribution 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 share alike in kind.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.