WEBVTT

0:00:00.000 --> 0:00:08.720
<v A>Hosting provided by HostTornado. They offer website hosting packages, dedicated servers, and VPS solutions. HostT.net.

0:00:15.960 --> 0:00:21.760
<v B>Programming Throwdown, episode number 10, JavaScript. Take it away, Jason.

0:00:22.480 --> 0:00:24.800
<v A>So, welcome to the Valley, Patrick.

0:00:24.800 --> 0:00:32.025
<v B>Patrick, yeah, part of the delay for this episode has been, I've been moving. Yeah,

0:00:32.025 --> 0:00:53.963
<v A>So, for dedication—out of dedication for the podcast—Patrick has decided, you know, it was hard for us to do the podcast in different time zones. You know, Patrick would have to stay up really late or I'd have to leave work early. And so, out of dedication to you guys. That's right. And for no other reason, Patrick decided to move. Took one for the team. That's right, 2,600 miles to Silicon Valley.

0:00:55.800 --> 0:01:00.966
<v B>So, and this is the big 10. The big 1-0. Congratulations. That's

0:01:00.966 --> 0:01:06.164
<v A>Right. Woo. If I had a streamer, I would blow it. So,

0:01:08.205 --> 0:01:21.486
<v A>There goes. So, what's been up with you, man? There goes our clean rating. No, so, yeah, not too much. Been actually learning a ton of JavaScript and HTML and the whole works. So,

0:01:21.486 --> 0:01:22.465
<v B>How apropos. Yeah,

0:01:22.465 --> 0:01:30.880
<v A>That's right. So, feel pretty prepared to come and nail this podcast. So, what about you? Awesome. So, do you have all your stuff yet or no?

0:01:31.760 --> 0:01:39.500
<v B>No, I still don't have all my stuff yet. Although, I did want to make a corollary to your statement from our previous podcast about moving being like defragging.

0:01:39.580 --> 0:01:39.940
<v A>Okay.

0:01:40.280 --> 0:01:44.420
<v B>Your hard drive? I feel like moving is like reformatting your hard drive.

0:01:46.000 --> 0:02:02.860
<v B>Because I feel like I am getting rid of a ton of stuff that I just decided I don't need anymore. Like, whoa, I didn't even know I still had this. And you kind of get excited. And you're like, wait. If I went, you know, X number of years, in my case, like four years without knowing that I had the thing and never used it in four years, I could probably do without it.

0:02:03.320 --> 0:02:30.500
<v A>Yeah, I had this like weird almost like Buddhist-like revelation because I moved and my stuff was in storage for a while. I want to say like a month or so. And my wife and I realized we really don't need that much stuff. And when our stuff did appear, I mean, of course, you know, we needed like a bed and things like that. Like a lot of this stuff, we just, you know, gave to Salvation Army or something because it was like we just realized you don't need that much to, you know, be content.

0:02:31.440 --> 0:03:07.520
<v B>Yeah, yeah. Yeah, I don't know that we're, you know, getting rid of it just to get down in size. But definitely, you know, a place we're moving into is smaller. So, we got to get rid of some stuff. But it's always hard because there's some amount of things where it's like this has value to me, but it doesn't necessarily have value to other people. Yeah. And so, like you hate just getting rid of it. But so, like I'm giving stuff to my friends and family, you know, you could like sell it to them. But ultimately, you know, the value is really what it has to you to give it to somebody else. Like, you know, trophies from high school. It's like, oh, these are nice. These represent something, but I don't need a hundred of them.

0:03:07.860 --> 0:03:25.686
<v A>You want to hear a funny story? We went to a garage sale, my family and I, one time. This is when I was really young. And this person was selling all of their trophies. And they actually had a family of like, it was like wife and husband. And they had a family of like seven kids that all just graduated. Whoa. Or they didn't all graduate high school, but they were all

0:03:25.686 --> 0:03:27.000
<v B>around that age. They just spent all of them finished.

0:03:27.000 --> 0:03:51.100
<v A>And so, they all had just a ton of, they literally had boxes full of trophies. And we bought all of them for like, I think, you know, $2 or something. And then anytime we did anything, we got a trophy. So, we put duct tape over all of them. So, like one time, I think like my cousin, he was really young. He's a baby. And he had just like got potty trained. And we gave him like a basketball trophy.

0:03:52.960 --> 0:03:58.060
<v B>It was totally awesome. It's like every time you made a free throw on your YMCA team.

0:03:58.400 --> 0:04:14.760
<v A>Yay, here's a trophy. Yeah, that's right. Your first shot. Your first made shot. Yeah. And nothing would ever match. Like I won a spelling bee in fourth grade. And they didn't give us any trophies or anything. But my mom gave me like a bowling trophy.

0:04:16.380 --> 0:04:16.780
<v A>Nice.

0:04:17.180 --> 0:04:23.700
<v B>It was pretty epic. But yeah, you realize. It was even more epic because bowling was the word that won the spelling bee.

0:04:23.700 --> 0:04:40.881
<v A>Oh, that's right. You realize that there are things like that where it's like it has some sentimental value. And then there's almost like you don't want to throw it away. But not really because you care. Like because that's sentimental value. But just you don't you don't want to lose something. I don't know what it is. But

0:04:41.269 --> 0:04:42.315
<v B>Yeah, you can't ever get it back.

0:04:42.400 --> 0:04:57.800
<v A>Yeah, that's right. That's right. And plus, it's like you just like the thing you were doing. So, I got a trophy for playing soccer. I got like a participation award because as you might imagine, you know, Patrick and I have very little athletic ability. And so, for yourself.

0:04:59.720 --> 0:05:02.440
<v A>Except for your weightlifting Olympics. I forgot about that.

0:05:02.560 --> 0:05:03.680
<v B>That's right. That's right.

0:05:03.800 --> 0:05:13.160
<v A>But yeah, so my participation awards, you know, it's just like I like doing that and playing sports as a little kid and stuff. So, I hate to give that stuff up.

0:05:14.300 --> 0:05:29.840
<v B>Yeah. Yeah. And it's hard for me too. I have like a bunch of cool RC remote control airplane type things. Oh, that's right. And it's like because we're moving into a smaller place and not going to have a lot of space, you know, like I'm in debates about what to do with it, you know.

0:05:30.500 --> 0:05:33.860
<v A>If you're going to have to throw them away, you should at least crash them epically.

0:05:36.000 --> 0:06:03.920
<v B>No, that stuff you can typically find people who will, you know, buy it off of you or whatever. Yeah, that's true. That's true. So, all right. Well, anyways, to the news. Yeah. So, the first thing I saw, which is kind of a news slash tip thing that I found, this website, codeacademy.com, opened up recently. And I went and checked it out. I saw some news stories about it. We'll have to do it in one of our podcasts, some of the places we go for our news. That might be interesting.

0:06:04.140 --> 0:06:05.037
<v A>Yeah, definitely. Anyway, so,

0:06:05.290 --> 0:06:50.960
<v B>I saw in a couple of those, this codeacademy.com. And they have actually relevant to today some lessons about JavaScript. I forget how many, about 10, maybe. You know, different lessons kind of walking you through very beginning programming, very interactive, kind of see what you're doing and very well done. Web 2.0-y, you know, very nice. Oh, nice. And then I saw an article on TechCrunch that said that 200,000 people used it and did some number 2.1 million lessons on it in just three days. Oh, man. Which is crazy because this is very niche. And not only is it niche that it's a programming site, but the fact that it's for, like, very beginners. Like, you know, for you and I, it's going to be, like, snooze fest.

0:06:52.820 --> 0:06:56.720
<v B>I don't mean that we're expert programmers. It's sort of like beyond the beginning stage.

0:06:56.740 --> 0:07:00.980
<v A>It's kind of like if someone just told you to bench 200 or something after you did your Olympics.

0:07:01.820 --> 0:07:04.300
<v B>It would be like somebody telling you to bench 15.

0:07:05.100 --> 0:07:06.260
<v A>Yeah, that's right.

0:07:07.520 --> 0:08:11.025
<v B>Okay, anyway. Sorry. So I encourage you guys to check out CodeAcademy.com. And it's also cool that somebody, you know, is teaching others to do programming. And apparently I assume it's some sort of, you know, startup or there's some money motivation there, advertising. I'm not sure what or if it's just non-for-profit. I don't know. But that's kind of encouraging that this guy got that much traction and people signing up and using it. Or it could be a lady. I don't know. But yeah, that's pretty awesome. And you know, I was thinking about that, that there's got to be a pretty big market, not only for learning programming yourself and making yourself more marketable because that's a growing industry. And I can't see any reason why it wouldn't grow even more in the coming years. But also if you want to teach others who want to get into the field of computer science, programming, that kind of stuff, there could be some. It's a win-win, right? You're getting money to do something that you like—teaching others and helping people learn programming, kind of like, you know, something we're doing with this podcast. Although we're not getting money. But if you'd like to donate, let us know. Yeah, that's right. Or just pay us, you know. Yeah, we take

0:08:11.025 --> 0:08:11.970
<v A>checks, cash,

0:08:11.970 --> 0:08:12.940
<v B>money, credit cards.

0:08:13.101 --> 0:08:30.955
<v A>I think that, you know, one of the things that I've always kind of believed is that everyone should learn how to program. Like programming should be something that's taught at a fundamental level. Like every high schooler should know how to program. Because I feel like any job could be made easier with knowledge of programming. You know, and

0:08:30.955 --> 0:08:37.739
<v B>I won't go so far as to say any job, but yeah, a lot of jobs. Even if you're just using Excel. Yeah, and I

0:08:37.739 --> 0:08:43.037
<v A>mean, I'm not even talking about computer programming. But the idea of sort of coming up with, yeah, algorithms are coming

0:08:43.240 --> 0:08:43.965
<v B>up with like

0:08:43.965 --> 0:09:14.155
<v A>a recipe. It's sort of like, I want to do these things. You know, there was a game at Epcot in Walt Disney World in Florida where I remember when I was really young, we went to this. I can't remember what it was called. But it was an area of Epcot where they had like machines from the future, which was like, you know, a 486 DX or something. But they had a game on there where you were, you had a position and there was a sort of a grid. And so you're walking around on this grid

0:09:14.155 --> 0:09:19.032
<v B>world. Oh, yeah. Or you have to program a robot how to move to get to the goal. So you

0:09:19.032 --> 0:09:45.740
<v A>put like 2L, 2D, 2R. And that would go two spaces to the left, two down, two to the right. And so you have to put this really complicated sequence to get you to the goal. And, you know, along the way there's little pitfalls and it would tell you oops. And you'd change your sequence and eventually you'd get it right. And so I'm just talking about programming at that level. Like being able to understand like a sequence of commands and sort of what's going to happen at the end or iteration. And I just feel like any job could benefit, you know, from knowing something like this.

0:09:45.820 --> 0:09:52.760
<v B>Yeah. The algorithmic, the codifying of a set of things and boiling down to unambiguous. Yeah.

0:09:53.560 --> 0:10:19.520
<v A>I agree. Yeah. I mean, like let's say you something to be said for that. Let's say, I mean, there's nothing against janitors. Janitors are awesome people. But a lot of people wouldn't consider janitors programmers. But let's say you excel at being a janitor and all of a sudden you're a manager and you're managing, you know, a team of janitors to clean, you know, an office complex or something. So that, you know, there's a lot of programming there. You have to sort of arrange the schedules. You know, you have to worry about like the overlaps. And people, if it takes them.

0:10:19.960 --> 0:10:21.320
<v B>How frequently should you clean? Yeah.

0:10:21.340 --> 0:10:42.960
<v A>And if it takes them 45 minutes to do like one area and, you know, two hours to do this other area, you know, how can you keep them busy for the whole eight hours? I mean, there's a lot of math, a lot of programming there. And we just, the fact that we don't really teach any programming, you know, it's not compulsory. It's just, I don't know. I think it's a little crazy. Interesting. Yeah.

0:10:43.560 --> 0:10:51.140
<v B>So definitely a space. I mean, I think it would be a benefit if people have ideas or things they want to do there to teach others to be good.

0:10:51.300 --> 0:10:58.900
<v A>Yeah, for sure. So there's all this craziness about the HP touchpads going to $99. And the other day.

0:10:59.020 --> 0:11:04.540
<v B>Well, the craziness is that the HP touchpad is being discontinued. Yeah. Well, and HP is in a lot of financial problems.

0:11:04.660 --> 0:11:30.220
<v A>HP is in a ton of trouble. But that isn't necessary. I mean, people have known that for a while. But I mean, I've never seen anything like this. Like, I mean, when was the last time where some company was in trouble and just ran like a fire sale on all their hardware? Like, even like, you know, when Circuit City closed, I don't know if it's because of regulations or what, but nothing was really discounted very heavily. And in fact, I believe Apple, like, didn't.

0:11:30.320 --> 0:11:33.036
<v B>You could buy it cheaper online than it was in the store. Yeah, even

0:11:33.036 --> 0:11:43.110
<v A>with the store closing sale. So, you know, to see something that's marked at $500 go to $100 is pretty rare. And it causes massive explosion in purchases. So,

0:11:43.110 --> 0:11:47.760
<v B>Did you get yourself one? $100 for a pretty decent tablet seems like a good deal.

0:11:48.100 --> 0:11:53.624
<v A>So it runs WebOS, which, of course, is run by HP. So that's pretty much gone. And I didn't

0:11:53.624 --> 0:11:54.248
<v B>get one. And it's going to

0:11:54.248 --> 0:12:09.199
<v A>be kind of a dead end. Yeah, I didn't get one because I thought, oh, the operating system is not going to be kept up to date. But this news article, HP Touchpads Linux/Android ports on the way, shows that, you know, there's actually going to be a path forward for these touchpads. I'm kind of kicking

0:12:09.199 --> 0:12:56.960
<v B>myself. I'm not getting one. So a couple notes on this, since I made the show notes here, that even now there's been some edits. Some people have offered a bounty. So I think it's up to a couple thousand dollars now to the first person who can get Android on WebOS. Nice. And then some other people, which I haven't seen if it's a fake or not yet. They were saying it's true. But some people bought touchpads that had Android on them. Oh, wow. Out of the box, shrink-wrapped. And they boot to, like, some Qualcomm screen. Oh, weird. So it's like a Qualcomm research center. So there's a lot of speculation about what happened and that they might be a really elaborate fraud. I watched a video. Seemed pretty convincing. These people turning on Android devices and, or turning on touchpads and having it boot to Android. And they claim they got them out of the box that way.

0:12:57.300 --> 0:13:15.580
<v A>Yeah, it's awesome. I mean, you know, the thing about the iPad, and maybe, you know, you own an iPad, right? So, or I guess I should say the thing about the tablet. I can never seem to find a use case for the tablet. Like, that's why, you know, I have some, like, oh, I could put recipes on it. But, I mean, I don't really have a $400 use case. I mean, what do you use your tablet for?

0:13:17.040 --> 0:14:14.100
<v B>$400, it is hard. It is hard. But I use mine definitely when I travel. It's awesome. So, like, I don't have to take my laptop anymore if I'm only traveling over, like, a weekend or, you know, a few days for business or something. For business, I have to have my business laptop. But for personal stuff, I just bring my iPad. It's more than enough to check my email, read my web pages, you know, see the news. It's very, very nice. Also use it, like, if I wake up in the morning early and I'm not ready to get up and get at it yet, I'll take it on my iPad and use it there or at night before going to bed, you know, because it's a much more portable. So, that's nice. I read comics on it, use it to play games. I have books on there. I would like to claim that I read them. But to be honest, it's really distracting to have it do so much else. You find yourself really easily distracted. And it has awesome battery life. So, I mean, it lasts. You could use it probably for six, seven hours doing stuff on it before the battery runs out.

0:14:14.300 --> 0:14:15.000
<v A>Oh, that's pretty awesome.

0:14:15.020 --> 0:14:16.860
<v B>Which a laptop won't do without power.

0:14:17.220 --> 0:14:23.642
<v A>Yeah, I guess it's a smartphone situation all over again. I never thought I would use a smartphone and now I'm kind of addicted to it. Yeah,

0:14:23.642 --> 0:14:40.719
<v B>it's hard. You really got to personalize it to your taste and have your stuff on it and, you know, check Twitter on it, you know, whatever. You got to have one. I used other people's always like, I don't get it. Like, this is silly. But when it's yours and you have it with you, you know, it doesn't make a difference.

0:14:41.040 --> 0:14:43.099
<v A>Do you have a keyboard or how does that work?

0:14:43.819 --> 0:15:15.263
<v B>No, they have an on-screen keyboard. You can get a Bluetooth keyboard for it. My brother has one that he uses with it. I don't tend to create content on it. Oh, that makes sense. It's not really a big deal for me. But he says it works really well. It connects wirelessly. Oh, nice. So it's pretty awesome. So talking about the Twitter, something I saw on Twitter that was pretty interesting was the guy who started or first created Minecraft, the head guy, he goes by his handle Notch. I don't

0:15:15.381 --> 0:15:16.934
<v A>his real name is—it's slipping right now.

0:15:17.020 --> 0:16:05.027
<v B>Oh, I'll look it up. Do you know? Okay. But Notch, and I follow him on Twitter, and he posts stuff about working on Minecraft, which is now a company Mojang. His name is Marcus Person. Marcus Person. Okay. I always want to say Mark Pincus, but that's the guy who runs Zynga. Yeah. So their names are kind of close. Anyways, they're both in the games. So, yeah, Marcus, so Notch, has his Twitter feed, talks about all that stuff. It's pretty cool. You can follow him. He does pretty interesting stuff. And he had the story that he was coming out with a game or had an idea for a game called Scrolls. And there is a company in America, I guess it's worldwide, Bethesda, that is—so they're the people

0:16:05.230 --> 0:16:07.255
<v A>who made Fallout 3, Oblivion, and

0:16:07.255 --> 0:16:13.380
<v B>—So they make Elder Scrolls, which is—Oblivion was one of the Elder Scrolls series, I think.

0:16:13.720 --> 0:16:13.940
<v A>Yeah.

0:16:14.300 --> 0:16:30.900
<v B>And they're coming out with a new one, even Skyrim, I think it's called. Yeah, I'm not into those style of RPGs, but they have this Elder Scrolls with these different titles in this series. And so they found out he was making a game called Scrolls, and they decided to sue him.

0:16:31.217 --> 0:16:34.035
<v A>Yeah, I mean, he has millions of dollars, might as well, right?

0:16:34.160 --> 0:17:34.899
<v B>I have no idea the logic behind it. I don't think a lot of people get confused between Scrolls and Elder Scrolls. Yeah. And the games are not similar in any way from their description. So he's been kind of—he was griping about it. And then one day he gets on and basically says he's going to challenge them that instead of making the lawyers rich on both sides, why don't they just settle this? And he agreed that, you know, he claims he's serious about it, that they'll—and he set up the rules. Basically, they'll play Quake 3, a couple of the guys from his team and him versus a team that they can pick on their end. They'll play several rounds of Deathmatch of Quake 3. And then whoever wins, if he wins, he gets to call his game Scrolls. And he's saying either way, he always will plan to, if it would make it any better, that he'll say that, you know, that they're not associated with, you know, Elder Scrolls, that this is its own thing, no way affiliated with Bethesda. And so he says that if he wins, he'll still do that, but he gets to call his name Scrolls. And if he loses, he'll call it something else.

0:17:35.500 --> 0:17:50.300
<v A>Yeah, I think that's awesome. I think good for him for sort of making it, you know, bringing more publicity to him and his team because that's really what's the only thing that he can gain out of it, you know. So he sort of took, you know, a rotten thing that was offered. He took lemons and made lemonade.

0:17:50.300 --> 0:17:55.120
<v B>In some way, yeah, he got a lot of publicity out of it, that's for sure.

0:17:55.120 --> 0:18:02.040
<v A>Yeah, I mean, people are really, I think it's pretty awesome. So, I mean, I'm sure a lot of people saw that and really kind of said kudos to him, you know.

0:18:03.220 --> 0:18:23.860
<v B>Yeah, but it does bring up how silly some of this stuff has gotten that, you know, or even the Android phones, the Droid. I see at the bottom whenever there was a Droid commercial, it says, you know, basically some note to Lucasfilm LTD, so George Lucas' company, because Droid is a trademark of the Star Wars series.

0:18:24.500 --> 0:18:33.160
<v A>I mean, really the lawsuits just have gotten more and more out of hand. You know, Apple's suing HTC, I believe, and like several other Droid manufacturers.

0:18:33.160 --> 0:18:34.900
<v B>Oh, they're all suing each other at this point.

0:18:34.920 --> 0:18:44.320
<v A>Yeah, I mean, basically, you know, it's sort of like the Cold War, except we've reached, what was that called? Is it Duff? Mutually assured destruction?

0:18:44.560 --> 0:18:45.795
<v B>Yeah, but what's the

0:18:45.795 --> 0:18:51.280
<v A>word for that? I keep wanting to say DEFCON. I think it is DEFCON. DEFCON is where...

0:18:51.280 --> 0:18:52.480
<v B>That's like when you're under threat?

0:18:52.880 --> 0:19:00.020
<v A>Well, DEFCON's a hacking conference, but DEFCON's also the state. So there's a DEFCON level.

0:19:00.160 --> 0:19:01.034
<v B>This is back from the

0:19:01.034 --> 0:19:15.060
<v A>Cold War, yeah. And so if you're at DEFCON level, like, one, then that means basically everyone's launching nukes at each other. And so we're at DEFCON level one right now when it comes to patents and patent litigation. Yeah, it seems that way.

0:19:15.900 --> 0:19:22.060
<v B>And it doesn't help. Nobody's innovating because of this or doing more work. Just lawyers are making more money.

0:19:22.220 --> 0:19:41.584
<v A>Yeah, and the worst part is the people who get hit. Because, you know, huge companies like HTC and Apple and things like that, they basically shrug these lawsuits off. So the people who really get hit hard are the small companies. Like somebody, Lodsis, was suing Angry Birds. Oh, we talked about

0:19:41.584 --> 0:19:42.659
<v B>this. Yeah. All the Apple.

0:19:43.035 --> 0:19:57.280
<v A>They were suing Rovio, the company that makes Angry Birds. And it's like a company like that is probably just five guys in their basement, right? I mean, they can't afford... Oh, Rovio. Oh, it's Rovio. They can't afford to take a lawsuit from a huge company.

0:19:57.500 --> 0:20:02.320
<v B>Well, actually, the Angry Birds developers probably can. Really? By now, yeah.

0:20:02.380 --> 0:20:06.080
<v A>I mean, Angry Birds is big, but I don't think it's like HTC big. You know what I mean?

0:20:06.680 --> 0:20:08.550
<v B>No, yeah, I don't know. But, I mean,

0:20:08.550 --> 0:20:13.107
<v A>Regardless, yeah, a lot of little developers are just getting beat up over these patents. It's just

0:20:13.107 --> 0:20:24.565
<v B>Ridiculous. So, while we're on games... Oh, I guess you were supposed to do this story. That's okay. No worries. So, the new Deus Ex has just come out. Yeah, Deus

0:20:24.565 --> 0:20:26.580
<v A>Ex Human Revolution. Actually, Deus Ex...

0:20:26.580 --> 0:20:27.029
<v B>Have you played?

0:20:27.029 --> 0:20:33.399
<v A>It? Well, no, but Deus Ex 1 goes down in history. It was one of my favorite games of all time.

0:20:34.220 --> 0:20:38.352
<v B>Really? I mean, I played it before, but I didn't ever play it for very long. Yeah,

0:20:38.352 --> 0:21:49.880
<v A>So there's a number of things that make it awesome. One is this whole like philosophical, you know, discussion of consciousness. And, you know, they're sort of walking the boundary between what's conscious and not. There's like this whole philosophical undertone, you know, behind the game. And, actually, depending on your opinion, you know, of like how conscious a robot is, a humanoid robot, and things like that, you can actually change the ending. So, you know, actually, I went back and played it. And I always try and like answer truthfully, you know, unless I've played the game, you know, over again. But this time I went through, answered truthfully, and my opinions as far as, you know, consciousness and robotics and things have changed since I was like 13 or wherever it came out. No, I don't know, maybe like 16. And so I actually had a different ending, you know, and it was just that was like fascinating. Yeah. And it also has a lot of sort of gamey elements. Like, you have different skills. So if you focus on the stealthy skills, then you could do like really cool missions where like, you don't even like, kill anybody. You just use stealth and avoid everyone. If you focus on like, the military skills, then you can shoot rockets and just blow people up. So it really kind of has something for everybody.

0:21:52.129 --> 0:21:54.306
<v A>So I'm really excited to play the new one, the third one, but

0:21:54.306 --> 0:23:24.520
<v B>I haven't done it yet. So it's coming out, and there's this other company. I have not tried it yet. Have you tried it yet, OnLive? No, I've heard of it. I've actually, I didn't believe it, but I've heard really good things about it from people I trust. Yeah, yeah. So I'm thinking I'm going to have to check it out. So basically, OnLive has, and correct me if this is wrong, but the way I understand it is they have servers that basically run games for you. So you've got a very high-end game that takes a lot of processing power, expensive graphics cards, these kinds of things. So, like, Deus Ex or Crisis 2 or, you know, any other game that is really, you know, high-end graphics, that kind of stuff. And they run it on their server. And then they basically, you know, most are kind of like a remote, it amounts to kind of like a remote desktop thing where your controls get fed into the server, the game runs, and then they stream the video back to you, the video and audio. And so you end up not running very much processing on your computer, and it's just network activity. And they even sell now, I think, a little box that handles the, you know, just taking the inputs and displaying the output. So, you know, equivalent of like a Roku box or a Boxy box or a Google TV box or, you know, size of like maybe a, I don't know, really small thing. You can play games on your TV or on a computer screen. And I've heard it works really well. And the nice thing is it's fairly expensive. It's, like, buying the game at full price. And I don't think it's any ongoing expenses. But then they host the game, and you can play it whenever you want.

0:23:24.604 --> 0:23:25.161
<v A>Yeah, I mean,

0:23:25.161 --> 0:23:26.562
<v B>it's pretty awesome. You don't

0:23:26.562 --> 0:23:29.400
<v A>have to shell out $400 for the latest console.

0:23:30.800 --> 0:24:25.179
<v B>Yeah, or a new computer, yeah. And so they were putting codes. The way I understand it is, at least in the beginning shipments, they were putting codes for a free license on OnLive for this Deus Ex if you bought the Deus Ex in a box store. So that's a really great, you know, thing, like, if you buy it and you'll have it. But GameStop is very threatened by online delivery, you know, things like Steam and OnLive and others that are not—people don't have to go to the store and buy a box. They just go online and buy it, and they trust it. And there's all sorts of DRM issues we could get into about why that might not be the best thing. The industry is moving that way, but it's the way it's moving. And so GameStop is very threatened by this, and they're trying to get into digital distribution to counter it. And so all of that swirled up. Basically, they instructed their managers to open the shrink wrap copies of Deus Ex and take out the coupon that had the OnLive code printed on it.

0:24:25.419 --> 0:24:30.060
<v A>That's ridiculous. So I guess they had to, like, re-shrink wrap it then at the store, right?

0:24:30.139 --> 0:24:41.976
<v B>Yeah, I think so. But they sell used games, so I think they have the, you know, plastic and the heat gun to do it. So that's pretty crazy. I don't know how I feel about that. I

0:24:41.976 --> 0:24:49.240
<v A>mean, yeah, it's pretty wild. I mean, I get the impression that things like this happen all the time, but we just found out about this one, you know?

0:24:49.520 --> 0:25:11.780
<v B>Oh, maybe. And it seems like if I were GameStop, like, I don't have a problem with GameStop being opposed to it, but they should have worked with, I don't know who makes Deus Ex, but they should have worked with that company and said, 'Look, we really want the ones that come to us to not have the coupon in it.' And then they could have just done that for them, and then I wouldn't have had a problem with it. I just don't like the fact that they, like, opened it up and removed it.

0:25:12.233 --> 0:25:33.600
<v A>Yeah, they probably didn't know until it was too late or something. But, yeah, I mean, it's pretty shady. I mean, to tamper with the device before giving it to the customers, you know? I mean, the worst part is if, you know, people are going to know that, oh, the game comes with this thing, and so if they buy it and it doesn't come with it, you know, they're going to get upset, like the customers.

0:25:34.480 --> 0:25:49.460
<v B>Yeah, and you're going to drive away your customers because here is, like, a reason to actually go to a box store and buy it and not just download it from, you know, Steam or wherever. And now you go and it's like, 'Oh, I'm getting the same treatment.' Well, forget that. I'm not doing that anymore.

0:25:49.800 --> 0:26:24.740
<v A>Yeah, I think that it's only a matter of time before Steam kind of takes over. It's like, you know, with Portal 3, or sorry, Portal 2. Uh-oh. I think it's... Uh-oh. You heard it here first, guys. Yeah, that's right. Secrets out. I think that, like, if I remember correctly, oh, no, it was backwards. If you bought the PlayStation copy of Portal 2, you also got the Steam copy. But really, that would have been nice to go the other way, where if you bought it on Steam, you also got to download it for the PS3. If they had done that, I think that would have been the beginning of the end for GameSpot, you know, GameStop.

0:26:25.399 --> 0:27:01.026
<v B>Yeah, it could have been. It's hard to say. I mean, like I said, with the DRM, I actually don't necessarily like the Steam thing because... Well, Steam, you don't pay a subscription for, so it's not as bad. But, I mean, if they one day run out of money and stop having it, and if they just turn off the license servers for all of your games six months later, you're not going to be able to play games anymore. Yeah. All the games you bought. Yeah, definitely. And I still have games. I was... When I was packing, I saw games that I had from, you know, before 2000, 1995, 1999. You know, all these awesome old-school games. Playing the XCOM or anything? No, I don't have them that far. Oh,

0:27:01.026 --> 0:27:01.280
<v A>Okay.

0:27:01.280 --> 0:27:21.310
<v B>But, you know, like, maybe the original StarCraft—I don't even know what year that was. Maybe that was in the 2000s. But I have my copies of that. The Diablo II, which that's a little bit newer. But, you know, games like that, which I still have, and I can install them. If those were on some distribution service that had gone away between then and now, I wouldn't be

0:27:21.310 --> 0:27:41.360
<v A>able to get them anymore. Yeah, that's true. It's definitely true. And, I mean, not only do you have to worry about the distribution service going away, but, you know, a lot of older games, you can, like, emulate them with DOSBox, for example. But it's like, they might, you know, the DRM might make it hard to, like, emulate these games and, you know, preserve them.

0:27:41.399 --> 0:28:01.280
<v B>Yeah, I guess I should point out, it's not the fact that you couldn't download the game anymore. Because you could always back that up yourself if you're worried about it. But the games now actively, or some of the Steam ones, actively go out and ping the Steam servers and make sure you're still an authentic user and this and that. And if it doesn't detect it after a certain amount of time, it'll basically lock you out.

0:28:01.460 --> 0:28:12.220
<v A>Yeah, I was playing Thief 3 on Steam. And I guess while I was playing, my internet went out. And at some point, it just kicked me out of the game. It was really frustrating. It's not even a multiplayer game.

0:28:13.120 --> 0:28:20.800
<v B>Hmm. Yeah, that's the part that's kind of disconcerting. Anyway, so I'm not sure that moving to that model is the best.

0:28:21.100 --> 0:28:21.840
<v A>Yeah, good point.

0:28:22.840 --> 0:28:28.962
<v B>So, oh well. Yeah. Time for that part of the show: Tools of the Buy Week. Tools

0:28:28.962 --> 0:28:35.860
<v A>of the Buy Week. So why don't you go first since mine is kind of ham-fisted. It's pretty heavy. Uh-oh.

0:28:36.120 --> 0:30:13.080
<v B>Oh, that's kind of scary. I'm worried now. So mine is, talking about Notch in Minecraft, I've been using this tool to play—now that I've moved, well, even before I moved, I used it—but to play Minecraft with my family. And yes, we're nerds. And the tool is Hamachi. And it used to be a separate service, but now it's part of LogMeIn, which is a company that offers a variety of remote login-type products. And it's not open source, but it works really nice, really well. It's really easy to use. So I kind of, sticking with my sequence of not using open source tools—why Jason uses only open source tools—Hamachi allows you to run a program on your computer which creates basically a second network device, like, you know, your normal Wi-Fi or your Ethernet. But the difference is this one when you connect to it tunnels your traffic over your other connection. And it allows, for instance, if Jason runs a version of Hamachi and I run one, then we log in to—we create a virtual network, you know, name it, have a login and password if we want. And then him and I are on the same what appears to be local network because Hamachi bridges those together. And so if you point a game at an IP address that is serviced by the Hamachi adapter—that's, you know, kind of a virtual adapter—then it'll talk to it and it'll see, 'Hey, Patrick, Jason's over there, you want to play with him?' And, you know, I can say yeah, and we can just play like we're on a LAN even though we're very far apart.

0:30:13.400 --> 0:30:25.580
<v A>Yeah, so let's talk a little bit about—like, we can go into a little bit more detail on Hamachi, just what, so maybe you can explain, well, what are the things that Hamachi solves? Like, why couldn't you just connect to, you say, your brother's computer directly?

0:30:26.300 --> 0:31:13.392
<v B>Yeah, so the idea is that first, if you're going to go onto the internet and connect to something, you have to open up all of your ports for somebody to be able to get to you. And normally, since that's a bad thing—that people can just connect to a server running on your computer and maybe do whatever they want—a lot of people's routers, their ISPs, whatever it will, will block ports, block traffic that's incoming. So you can't really host servers; a lot of things that go against you being able to do that just on your local box. And so if my brother tried to connect to the server running on my computer, he wouldn't even be able to see it. And even if I opened up all that stuff and allowed him to see it on a certain IP address, my IP address might move. So then I have to solve that problem. So you've got this kind of issue after issue after issue. Yeah, like, the way to explain

0:31:13.392 --> 0:32:31.300
<v A>It is, you know, you have, you live in what's like a, what's called an address space. And so you could think of this address space as literally being an address, like an envelope. But the problem is that it's recursive. So what that means is for someone to get to you, they have to send an envelope to your router. And that envelope, your router opens it, you know, it's addressed to your router, so it goes through the internet to there. They see it. They have to open it up. And then there has to be another envelope inside that one that says, 'Hey, send this one to Patrick.' Send this one to, you know, if you're living with your parents, send this one to Patrick's dad or send this one to whoever else is in the same, on the same router. So the problem is that the person from the outside doesn't know that he has to package all these envelopes inside of each other because all he sees is your router. So he'll just send you an envelope with your router's address and the router opens it and says, 'What is this? You know, I'm a router. I don't play Minecraft.' It just throws it away. So what Hamachi does is that, you know, you connect to Hamachi, and then the other guy connects to Hamachi, and then Hamachi does all of this negotiation so that when Patrick's brother tries to connect to his machine, he knows to send these envelopes inside of each other.

0:32:32.060 --> 0:33:18.900
<v B>Yeah, and Hamachi handles the setting up of the connection, but then you connect directly to the other person. Right? So it doesn't, like, all your traffic doesn't have to flow through Hamachi. It flows just directly between me and my brother, but it handles the setting up of that tunnel, as it were. And VPN does the same thing—a Virtual Private Network. There's a lot of tools to do that, but they require a lot of configuration. And because Hamachi has a server in the cloud that handles the arrangements, so we can each connect to the server in the cloud and then the server in the cloud connects us together versus in a normal VPN, you have to run the server somewhere that somebody can get to in order to be able to set up this other connection, which adds just—you got to have a computer on all the time or you configure it. It just becomes kind of a mess.

0:33:19.280 --> 0:33:24.000
<v A>Yep. Yeah, exactly. So this tool is pretty nice if you're trying to solve that problem.

0:33:24.520 --> 0:33:49.400
<v B>It has some other features, too. Like when a person joins, you can see who's on there, you can message them, and it's completely free if you're using it non-commercially. There may be some limit on the number of computers or that kind of thing, but they're reasonably high, so I've never run into a problem where I needed to pay for it, and I don't use it commercially, so it's exactly what I need, and it saves me spending hours and hours trying to get it set up just so I can play my game.

0:33:49.540 --> 0:33:56.360
<v A>Yeah, definitely. Now, Hamachi's awesome. So yeah, that's a really nice tool. That's one that we probably should have mentioned earlier. It's fantastic.

0:33:57.980 --> 0:33:59.965
<v A>So my tool of the BiWeek... All

0:33:59.965 --> 0:34:02.760
<v B>Right, so now that you've said such nice things about my tool...

0:34:04.020 --> 0:34:14.280
<v A>My tool of the BiWeek is Low-Level Virtual Machine, LLVM, and so this tool is pretty amazing, but let me sort of set the stage here.

0:34:15.860 --> 0:35:07.634
<v A>You know, we talked about C++. Actually, we talked about C, and we talked about Java. About C. And we talked about the difference between these two. I mean, with C, you're talking directly to the hardware, directly to the memory, and so if you have an array in C that's of length 10 and you try and access element 11, well, now you're reading something off your operating system or you're reading, you know, just a part of someone else's program. Like, it's at such a low level. In the end, all this stuff turns into electricity, right? So the idea of debugging, of, you know, getting an error and things like that, you know, when it comes down to electricity, it doesn't matter, right? You're just going to get something back. And so that's sort of an oversimplification. But basically, you know, C will let you do just about anything. Java, on the other hand, will throw an exception. Which,

0:35:07.634 --> 0:35:12.620
<v B>Just add a caveat: we haven't actually talked about that yet as one of our episodes.

0:35:12.840 --> 0:35:16.160
<v A>We haven't talked about what? Java yet. We haven't done Java?

0:35:16.920 --> 0:35:26.027
<v B>Nope. I'm almost sure. It's okay. I just checked. Really? Oh, we've done a language of the Virtual Machine though, right? Maybe it's just Python. We've done Python. We've done MATLAB. Okay, let's go.

0:35:26.027 --> 0:35:27.749
<v A>with Python then. I just

0:35:27.749 --> 0:35:28.964
<v B>didn't want people to be confused.

0:35:29.180 --> 0:37:16.069
<v A>Like, oh no, I missed an episode. Wow, we'll definitely have to do Java. That's exciting because I really like Java. So, yeah, so Python, if you have an array of length 10 and you're trying to access element 11, Python's running in a virtual machine, a fake machine. You think of it as like, you know, the memory's fake, the electricity's fake, everything in the machine's emulated. And so, it knows that, you know, element 11, it doesn't exist. That there's only 10 elements and if you tried to go beyond that, now you're in some no man's land. And so, the virtual machine can sort of analyze itself and say, oh, this isn't going to work. And so, it can throw an error, which is much, much better than just letting, giving you some random data, right? I mean, you want, you would rather have an error and be able to go in and fix it than you just get some random data and maybe you don't realize that there's a problem until it's too late. So, what would be, but again, the reason why people use C, as we talked about in the C episode, is that it's extremely fast, really, really fast. So, what you'd like, the ideal thing is if you could compile C like in different ways. So, if you had the regular way where you compile the C straight to the machine code and you have this super fast program, but then another way where you could compile C to a virtual machine and, you know, check for errors. So, maybe you run it on the virtual machine for a while and then once you trust it enough there, then you run it on the machine. So, low-level virtual machine, this is part of what LLVM does is you can compile C code. Actually, you can compile from C, Java, Python, a bunch of languages. It's basically just

0:37:16.069 --> 0:37:18.779
<v B>a definition of a virtual machine, of a machine.

0:37:18.980 --> 0:38:41.520
<v A>Yeah, it's sort of like a super virtual machine. So, you can compile from many languages to this LLVM and you can run in this controlled environment. And, so you can run your app, you know, for like a month under this controlled environment. It might run slower, but you're fine with that. Maybe you don't have a lot of users yet or you, you know, spend extra money for some extra hardware in the cloud or something. And then once you trust that your program's working, then you can run it on the machine code. So, another awesome thing about LLVM is that people have written, I guess, would you call it a compiler or a decompiler? But people have written programs which go from LLVM to another language. So, you can actually go from LLVM to C or you can go from LLVM to Java or LLVM to JavaScript, which is what we'll be talking about later today. So, for example, let's say, let's say you have a lot of Python code and you also have like a bunch of C code and you want them all to sort of play nice together. You could combine, you can compile both of them to LLVM and the LLVM will handle sort of the communication and things like that. There's part of like an LLVM library you can use and then you can decompile that or I guess recompile that to C.

0:38:41.860 --> 0:38:42.900
<v B>Yeah, I would say recompile.

0:38:42.960 --> 0:39:16.000
<v A>Yeah, and now you have a C program. Also, you know, JavaScript is the only language that works in the web browser but you might not want to use JavaScript for, you know, reasons that we'll talk about later in the show. So, you can, you write your code and say Java or Python, compile your code to LLVM and then go from LLVM to JavaScript and now your Python code runs in the web browser. So, there's a bunch of awesome things you can do. I just kind of scratched the surface but definitely you should check out LLVM.

0:39:16.620 --> 0:40:14.120
<v B>Yeah, the other big thing, the nice advantage that LLVM has, which maybe we'll have to talk about it in a show one time because there's a lot here, but there's that, since there's so many kind of front ends, you know, languages that can be compiled to LLVM. And then, it's a common base that once you're in LLVM, people have done a lot of research in academia and for companies, they've written a lot of optimizers for LLVM that say once something's been compiled to that, here's how we optimize it. We don't care where it came from, but once it's in this language, we'll write all these really awesome optimizers, analysis programs, we'll transform it, make it more optimal in some way, but keep the functionality, and then you can compile that to, you know, assembly, to run natively, or to another language or whatever, and you get the benefit that because it's common across all of these languages on the front end, you get the same optimization as opposed to just having that for a single language.

0:40:14.520 --> 0:40:48.000
<v A>Yeah, I mean, one thing that I sort of alluded to but didn't mention completely is you can go from, say, C to LLVM and then to machine code, and that might sound worse because you have this extra step, but because of the reasons Patrick mentioned, it's been shown that it's actually the code that's generated is better. So, going from C to LLVM to machine code, actually, you know, again, your mileage may vary, but often produces better machine, faster machine code than if you went straight from C to machine code.

0:40:48.000 --> 0:41:19.900
<v B>Well, even big C compiler, C++, GCC use an intermediate format. They just don't typically, it's not, other people don't really output it. It just GCC outputs it. So, GCC outputs this intermediate language that's easier to do optimizations on, kind of like they do a first, it's not really just one pass, but they do some passes and output this language, then they use the optimizer on that, and then they put that out to assembly. And so, this is kind of the same idea, but just making it more open and encouraging more people to output that intermediate format.

0:41:20.040 --> 0:42:22.780
<v A>Right, because the guys who work on GCC, you know, making things run fast is their whole life. I mean, if you could make your code run faster, think about all the things that are built on C. Like, we've talked about how Python is written in C. The operating system. That's right. So, so many things are written in C. If you can get even a 1% improvement in C, I mean, you would probably save millions of dollars in electricity and processing power. So, so, you know, the guys who are writing GCC are really into performance. Meanwhile, the guys who are writing Python, they're more into, you know, engineer, I guess, saving time. Right, exactly. They're more into productivity. So, they don't really spend the kind of time that the GCC guys spend on optimization. They want to make something that's flexible and that allows you to develop fast. So, by creating LLVM, we're sort of combining the best of both worlds. It's like the language guys can focus on the language and the compiler guys can focus on LLVM which helps every language.

0:42:24.380 --> 0:42:34.040
<v A>Good tool. Yeah, awesome. So, now let's jump into some JavaScript. JavaScript. So, somebody... All right, so first question I gotta ask. All right.

0:42:34.040 --> 0:42:38.660
<v B>How does JavaScript relate to Java?

0:42:39.060 --> 0:42:43.440
<v A>Okay. So, JavaScript does not in any way relate to Java.

0:42:44.640 --> 0:42:47.579
<v B>What? And this is just... I feel ripped off. I

0:42:47.579 --> 0:42:51.600
<v A>think what it is, I think people in Silicon Valley are just obsessed with coffee.

0:42:54.100 --> 0:43:11.080
<v A>But yeah, JavaScript has nothing to do with Java. So, you know, when we do the Java show, which maybe we'll do... Well, we'll leave a couple of shows in between just because of the name issue. Just because we don't want people to think that there is any relation between JavaScript and Java.

0:43:12.080 --> 0:43:15.400
<v B>I thought there was for the longest time. I thought there was a relation between the two.

0:43:15.400 --> 0:43:23.319
<v A>Yeah, me too. I mean, I never knew what it was, but I always thought there was something. But yeah, there is actually nothing to do between those two.

0:43:23.879 --> 0:44:39.200
<v B>So, the story goes, I guess, and maybe people don't know completely for sure, but Netscape was developing a language to add interactivity to their very early browser. I think Netscape 2, version 2 kind of time range. I don't remember the years, but they were calling it LiveScript. And LiveScript was their name, but Java was really big and had a lot of, or not big at the time, but was new and was gaining popularity. People were really excited about it. And Netscape went to, at that time, Sun, who was developing Java, and said, 'Hey, we would like to be able to use the name JavaScript.' I assume that's what happened. This is the most plausible explanation I've heard. And that they wanted to name it JavaScript because they wanted to be associated with all the popularity of Java. And Sun was willing to do that because they wanted Netscape to have Java applets be able to be run in their browser, and so it was kind of a, what do you call that, a horse trade? Yeah. That, you know, that Java, or LiveScript could become JavaScript, which supposedly, I guess, sounds better. And they would have the rights to name it that. And then Java would be able to have their Java run in the Netscape browser.

0:44:39.480 --> 0:44:39.730
<v A>Oh,

0:44:39.730 --> 0:44:55.100
<v B>man. And so I guess it was a win-win. And then Netscape was big on the idea of being able to be the only ones to be able to call it JavaScript so it could be theirs. And because they got an exclusive license from Sun to do that, they knew nobody else would be able to call their specific thing JavaScript.

0:44:55.880 --> 0:44:57.220
<v A>Oh, what a mess.

0:44:57.880 --> 0:45:17.860
<v B>I guess. That's what I've, so I've heard. But then it kind of got weird because then Netscape wanted to, I guess it was still them at this point, they wanted to get it standardized. And so they took it, tried to find somebody who would standardize that, you know, ISO, who are the other people, the various committees.

0:45:18.120 --> 0:45:20.280
<v A>Oh, W3C, right? Or WC3.

0:45:20.380 --> 0:46:00.280
<v B>Yeah, that's another one. These kind of people to, you know, standardize, give them a standard for JavaScript. And they couldn't get anybody to do it. So the European, the ECMA, decided they would do it. And so they produced their standardized version of JavaScript. But they couldn't call it JavaScript because that was, you know, only Netscape specific. And so they called that ECMA Script. So we don't really have LiveScript around anymore. But you do hear the names JavaScript and ECMA Script, and they kind of mean the same thing. But in reality, we probably should have named the show ECMA Script because it's what, you know, is the thing that everybody runs. But everybody just calls it JavaScript.

0:46:00.540 --> 0:46:04.520
<v A>Yeah, it's hard. Once, you know, you have so much inertia behind a name, it's hard to change it.

0:46:05.280 --> 0:46:05.560
<v B>Yes.

0:46:06.660 --> 0:46:15.220
<v A>Yeah, so, yeah, JavaScript has a pretty muddy history. Yes. But it has several really important uses.

0:46:15.980 --> 0:47:02.100
<v B>It does. Okay, before we move on real quick, most of that came from a lecture I was watching that's pretty interesting that goes with the history and also teaches JavaScript by a guy named Douglas Crockford. Oh, nice. Who I assume works at Yahoo. But we put, we'll put the link in the show notes. But it's Crockford on JavaScript. And he, it's like very, like each episode is like an hour, hour and a half. And I think there's like four or five of them. Wow, that's pretty cool. It's definitely a lot of material. And he goes over all the history and talks a lot about what JavaScript is. So for a much more in-depth description, you can go there. But sorry, yes, the uses of JavaScript. Did you, did you watch any of these? These look pretty awesome. I watched the first one and kind of skipped around because I knew a lot of what he was saying, and then started watching the second one. Somebody told me, it's just long format.

0:47:02.520 --> 0:47:10.040
<v A>Somebody told me that JavaScript was based on Scheme like way back. Like it's, it's a descendant of Scheme. Is that true or is that made up?

0:47:10.320 --> 0:47:23.500
<v B>He did talk about that in there that it was influenced by some of the, so, well, we'll talk about it. But JavaScript does have a lot of, you know, functional programming language to it. And so, yeah, it was influenced in some ways by that, yes.

0:47:23.700 --> 0:47:28.520
<v A>Cool, awesome. So, yeah, what are some of the uses of JavaScript? Why is it so popular?

0:47:29.160 --> 0:47:35.020
<v B>Well, we already talked a little bit about the, you know, kind of main one. It's kind of the language for web browsers.

0:47:35.240 --> 0:47:36.500
<v A>Yep. Client side.

0:47:36.500 --> 0:47:38.335
<v B>Sorry, go ahead. I

0:47:38.335 --> 0:47:40.300
<v A>was going to say client-side web browsers.

0:47:40.540 --> 0:47:46.640
<v B>Yeah, yeah. So, it's the thing that people put in their web browser to, I guess, add interactivity?

0:47:46.840 --> 0:47:52.560
<v A>Yep. Yeah, definitely. So, as we talked about in the HTML episode,

0:47:54.120 --> 0:49:49.133
<v A>you know, the HTML, I guess, the HTML code, we'll say, is called the DOM, the Document Object Model. And so, this is, if you write raw HTML, this is your, you know, you type the body tag and then the, you know, the P tag for a paragraph and all that stuff. So, it's really just a sheet of XML, and that sheet of XML can be thought of as this tree. So, the body is, actually, the HTML tag is the root of the tree, and you have, you know, head and body as the two children, and, of course, head has, like, script, can have script tags. So, you can think of this as, like, as flowing down like a tree. And so, you might want to do programmatic things. Like, you want to scan through this tree. You know, again, you know, HTML is often generated by another language. So, you might want to scan through this tree and count up how many tags you have inside of a particular table. You know, you might want to do some sort of logic or some sort of programming on the DOM, on the HTML that's been rendered. And so, JavaScript is one way to do that. So, for example, you might have a block of HTML that contains records and you might want to have a little pull-down menu that filters the records. So, give me all the records that start with J. Now, give me all the records that start with K. So, you don't want to have a new, have the server generate a new page each time because the client has all those records there. You know, you just want to alter the DOM. You just want to make some of those records invisible. So, that's something that you could do in JavaScript. So, JavaScript can loop through all the elements in this tree and set some of the parameters on them. Set one to visible, set one to invisible, to hidden, et cetera. Also, a lot of HTML5, even though it's called HTML5, you know, the vast majority

0:49:49.160 --> 0:50:20.260
<v A>of it is JavaScript. So, for example, one of the things HTML5 adds is typed arrays. So, if you want, you know, an array of data as we talked about in the C episode, you know, in JavaScript, you can't really do that. You can have sort of an array of objects, but it's not really like a chunk of memory like it is in C. But, with now with HTML5 and typed arrays, you can actually ask for a block of memory. And that's important for many different tasks.

0:50:21.480 --> 0:50:33.160
<v B>Yeah, that's kind of interesting because that's kind of a divergence. JavaScript's thing has been that, you know, there's just one kind of number. Right? There's just one kind of, you know, it was just very, you know, straightforward. Just every number is a double.

0:50:33.400 --> 0:50:33.660
<v A>Yep.

0:50:33.940 --> 0:50:35.740
<v B>Double floating point precision.

0:50:36.040 --> 0:51:16.640
<v A>Oh, no, actually, so in Python, every number is a double, but in JavaScript, every number is a float. I believe, yeah. But yeah, you're right. I mean, you know, in JavaScript, there's basically, there's float, there's object, there's array. This is pre-HTML5. And there's a couple others. I think there's like none or null. I think it's called nothing. And so that's about it. I mean, everything's either, you know, an object, which is a hash table in JavaScript. So everything's either a hash table, an array, a floating-point number, or nothing. So, you know, it's very simple in that respect.

0:51:17.620 --> 0:51:21.080
<v B>Yeah, and I guess that's a strength, but also it can be limiting.

0:51:21.680 --> 0:52:10.700
<v A>Right. I mean, if you need to do some number crunching or something like that, you need just like a block of memory. You know, the compiler, you know, at the lower level, the compiler and the machine, what they're looking for is for you to, you know, again, we're talking about electricity and, you know, memory at a really low level. You want to just access things in order. And so what JavaScript will do is since, if it has an array, but it isn't typed, it doesn't know, you know, that each element's going to be a number. Maybe like the first element of the array is an object, the second element's a hash table, and the third element is a number. So JavaScript can't just, you know, take one chunk of memory and say, here's your array because it doesn't really know what to expect. But HTML5 sort of adds a lot of that because performance for JavaScript has become more important.

0:52:11.700 --> 0:53:47.860
<v B>Mm-hmm. And it's been previously the fact that, you know, we talked about the on the, and we referenced it a little bit earlier when we were talking about Hamachi, but on the client side, so the client being the person running the web browser, sitting at their home, wherever, they're the client, and then they're connecting to a server to get the HTML, the HTML5, the JavaScript, all those things get transferred over to the client, and then the client has to render in their browser, has to draw the, what, you know, ultimately ends up being the image, the thing you interact with, that's the web page, and that's what the client side does, and the JavaScript is the language that is the program that continues to run even once the page is loaded, and the HTML kind of is what gets loaded, it describes how to load it, and then the JavaScript goes in and says, you know, here's how to continue running, and that's on the client side. But on the server, the part that's, you know, either the static HTML, you know, just stays as, like a text file that's HTML that gets served up, or that we talked about programs generate JavaScript, that generate HTML, so those are often other languages like PHP, or Ruby on Rails, or one of the Python web frameworks, or it could be even C or C++, and those run on the server and serve up the HTML and JavaScript and change parts of the JavaScript, parts of the HTML, to do something based on, for instance, the time of day, or what the newest news story is, or what user you've logged in as.

0:53:48.240 --> 0:54:15.040
<v A>Yeah, I mean, you know, a very simple example is if you look at Gmail. You can get new emails on Gmail without the whole page refreshing, and so we'll talk about this a little more later on, but that's JavaScript stepping in and, you know, asking Google, 'Hey, are there any new emails? Are there any new emails? Are there any new emails?' And so, you know, JavaScript gives you the ability to sort of continue processing even after you've loaded the page.

0:54:15.720 --> 0:55:02.100
<v B>But I wouldn't guess that on Google's side that that's JavaScript running on their server because almost always that's something else running on that end. Right? But then, there's this new tool that's gained a lot of popularity, actually. It's kind of interesting, called Node.js. And Node.js is it takes Google's Chrome's JavaScript engine so to get web pages to run really fast, which Chrome has tried to make one of their selling points—well, selling points there is I guess they give it away—but one of the reasons to download Chrome, Google always says, is because it's really fast. And as part of that, they have to figure out the way to make the interpreter that runs the JavaScript engine really, really fast.

0:55:02.160 --> 0:55:30.240
<v A>Yeah, I mean, I remember when, you know, when Gmail first came out, it took like on the order of minutes for it to load, and it actually loaded this like weird JavaScript blob thing that then like expanded or something. And then, you know, after it loaded it the first time, then it was fast, but I mean, it took literally over a minute to load Gmail for the first time on a machine. And now, when you go to Gmail, even for the first time, it's instant.

0:55:31.100 --> 0:57:07.160
<v B>Yeah, and a lot of that's because of the effort that they've put in and others, and then also kind of they've encouraged others and challenged others to put in more work to making this JavaScript engine really, really fast. Right? So, they open sourced that engine. They called it, I think, V8. Yeah, that's right. Reference to an engine, I assume, a fast engine, V8. And they open sourced it. So, this person took that engine runs it on the server and then adds in hooks so that from JavaScript, you can create the server side that serves up web pages and handles people visiting a web page, people logging in, people doing actions, and in JavaScript on the server side. And that's something that's pretty new that it was kind of like very interesting and it's catching on because people it unifies the client-side scripting that people are writing programs to run in the browser in JavaScript, and now they can also write code on the server that runs in JavaScript, and it does all this asynchronously. And so instead of waiting for stuff, you register an event to happen, and then you get a callback. And it is a new and novel way of doing it, but it allows for a lot of parallelism, allows you to run more clients from a given server so you don't have to have another server to handle all the traffic, and it's catching on and it's pretty cool. I don't know that it's the first time that JavaScript's been used on the server side, but it's definitely become probably the most popular way to run JavaScript on the server side.

0:57:07.279 --> 0:57:10.026
<v A>Yeah, for sure. That's pretty awesome. So,

0:57:10.026 --> 0:57:15.880
<v B>What are some of the features of JavaScript? What are some of the things that make it differentiate as a language?

0:57:16.440 --> 0:57:37.100
<v A>Yeah, so JavaScript is, you know, compared to the languages that we have talked about, it's more like Python and less like C, so it's dynamically typed similar to Python. It's got lambda functions, which means you can, you know, a function is basically an object, and you can create functions whenever you want versus...

0:57:37.819 --> 0:57:51.000
<v B>And you don't have to give them names. That's right. So you can pass in, and the functions are first-class citizens, which we've never talked about, but yeah, basically means a function can be an object so you can pass functions as the argument to another function.

0:57:51.420 --> 0:57:56.280
<v A>Right, like imagine if... I'm trying to think of a good example here.

0:57:56.620 --> 0:58:32.400
<v B>But oh, so a callback is a good example. Yeah, yeah. So you want to have a callback. Say, hey, I want you to go get read bytes from a network and instead of waiting here, I want you to call this other function when you're done. Right? And the other function is just going to do something. It's going to blink up make a blinking thing on your web browser, let's say. So a lambda function says instead of calling back this named function, I'm going to just give you the code, not give it a name, just here's the code, just run this code when you finish. Yep. And that's an anonymous function that you pass to it. Yeah, exactly. Because it doesn't have a name.

0:58:33.620 --> 1:00:19.780
<v A>Yeah, so JavaScript has a lambda function, which is super useful. Very cool. But one thing, so JavaScript as you mentioned, it has the there's a V8, which is an interpreter for JavaScript. Internet Explorer has their own interpreter. Firefox has their own—I think it's called SpiderMonkey—so each browser has built in their own interpreter, their own JavaScript interpreter, and each one has its own sort of nuance. Like some have different instructions. I know like for example if you want to find out, you know, you click the mouse and you're writing some JavaScript program that just needs to know where you clicked on the screen—well, in Chrome and in Firefox, you would call this function or this parameter called event dot, which actually sorry, event dot. Yeah, event dot, which tells you which like keystroke or mouse button. So if you clicked the left mouse button, event dot which would return zero. If you click the right mouse button, it would return one, etc. In IE, it's not event dot; which it's something else. I don't even remember. So you have to write all these 'if IE then do event dot whatever it is,' target or something, otherwise event dot,' which, right? And so the language is full of these nuances because there's so many different interpreters. You remember like Python only has the CPython—well, it has a couple others, but CPython completely dominates, right? You know, but in this case you have many browsers and each has a large market share. You know, I think Internet Explorer has like 50% of the users are on that, and the other 50% are spread across Chrome, Firefox, etc. So

1:00:19.780 --> 1:00:23.980
<v B>Well, it's almost like the analogy is that it's different hardware platforms.

1:00:24.038 --> 1:00:24.629
<v A>Yeah, that is.

1:00:24.629 --> 1:00:50.599
<v B>A good analogy. So if you had to run on like an Intel processor and in this case AMD happens to comply with the same standard as Intel, but IBM used to make—I guess they still make Power PCs. All free scale now Power PC chips, Sony has the Cell processor. You know, these are all very different processors, and you need to be able to run on all of them because everybody on the internet has essentially a different machine, a different operating system that they're using. Yep.

1:00:50.940 --> 1:01:47.097
<v A>And so there's several libraries, JavaScript libraries that are designed to sort of save you the trouble of having to do all these 'if IE,' this 'if Mozilla,' that 'if Firefox,' that.' So the most popular one is jQuery. There's another one called Mootools and there's another one called Prototype. I've used that jQuery a lot. I've had a really good success with it. I can't really say much about the other two, but I've heard they're both very good as well. But what they basically do is save you from having to care about what each browser does. One thing to note, and we'll talk about this more in the weaknesses section, but these tools are good, but they're not great. I mean, you know, you'll still have issues. Your code still will run a little bit differently in IE, and so you definitely need to have an environment where you can test all the different browsers. Well.

1:01:47.097 --> 1:02:04.866
<v B>We should say the tools are great. The problem is just really hard. Oh yeah, maybe that's the best way of saying it. Yeah, because I mean these tools are trying really hard. There's a lot of work that goes into them. They give you a lot of help. They make your life a whole lot easier. They take an impossible task and just make it hard. Yeah.

1:02:04.866 --> 1:02:32.900
<v A>And you know another thing is that it changes constantly, like from IE8 to IE9, they'll change a bunch of different function names, and they won't be backwards compatible. And so you know these tools have to stay up to date, but then they also still have to backdate so that someone using IE6 or someone using IE9 or someone using Firefox, they can all see the same get the same experience. And so that is, you know, a really, really hard problem.

1:02:32.900 --> 1:02:34.785
<v B>Yeah, definitely. So,

1:02:35.342 --> 1:02:58.832
<v A>You know writing JavaScript, you know, can be painful. We'll talk about that a little more in the weaknesses too, but many people have written compilers which compile to JavaScript so you can write languages that are I guess a little bit more formal and then run this compiler and generate the JavaScript. So do you have a couple in mind? Yeah.

1:02:59.406 --> 1:03:52.520
<v B>I mean one of the big ones that, you know, kind of—I guess is one people think about is the Google Web Toolkit, which breaks what we said before that Java and JavaScript have nothing to do with each other because this actually allows you to write kind of a certain style of a Java program and then compile that to JavaScript. And Google has actually open sourced that. Yeah, open sourced it and released that so that others can use it. And you can write, you know, they show you how to write it in Java and then you run their program and out comes JavaScript that you can put on your page, and that allows you to build up bigger applications more quickly and not have to worry about kind of the tediousness of writing all the JavaScript, and it also built-in tries to handle a lot of the stuff like jQuery and others will do as far as cross-browser problems.

1:03:52.520 --> 1:04:24.945
<v A>Yeah. I mean, you know, jQuery is sort of limited in the sense that, you know, you're writing JavaScript and you're calling their functions, and they're trying to do whatever they can to sort of deal with these browser issues, but you know ideally what you'd love is to write something else and have it create, you know, separate just completely separate JavaScript files and just have something on top that says 'If you're IE, run this JavaScript file; otherwise run that one,' and do it at that level where you really have the most control. Yeah. So what?

1:04:24.945 --> 1:04:30.615
<v B>About? We talked about LLVM before. I have a feeling we're about to get another talk about that. Yeah.

1:04:30.940 --> 1:04:58.965
<v A>So another one compiler JavaScript is mscripten, and what that does is it takes C++ code, compiles it to LLVM, and then compiles that to JavaScript. That's crazy! And so this is pretty freaking wild, right? Because I mean imagine all the things that have been written in C++, like let me just give an example. Imagine if you worked at Microsoft, you could compile Microsoft Office to JavaScript, like the—

1:04:58.965 --> 1:05:00.960
<v B>entire thing? Oh, not quite. Yeah, no, actually.

1:05:00.960 --> 1:05:17.680
<v A>LLVM has support for translating different things. So, in other words, the what's the drawing thing, the Windows drawing library Paint—no, no, I mean the C routines GDI, I think is that what?

1:05:17.759 --> 1:05:18.389
<v B>It's called?

1:05:18.389 --> 1:05:44.224
<v A>Anyways, the library which you know actually handles like drawing the widgets on the screen and drawing the windows and the framework and all that stuff—MFC. That's what I was thinking of. So they have different libraries. I don't know if they have MFC, but where they've sort of told LLVM sort of how to translate that to JavaScript, and so I wouldn't be surprised if you could actually do this. I wouldn't.

1:05:44.224 --> 1:05:50.400
<v B>Be surprised if you had to put in a fair amount of work and didn't just compile it? Wow, look, it works! I've

1:05:50.400 --> 1:06:22.395
<v A>been able to compile some things. One thing that somebody compiled was there's a library called Bullet, which is a physics engine, and it came with OpenGL samples where you can like move boxes around and throw boxes like in this 3D environment, and he just ran it through this M-Scripten, and it knows to turn the OpenGL calls into WebGL calls, and he had the Bullet physics engine running in browser. It's pretty wild. You should definitely check out some of the demos. Yeah.

1:06:22.960 --> 1:06:36.030
<v B>I'll have to check that out. So since this is LLVM in the middle, does that mean that you can, in theory, use other languages as well? So like Java or Python or anything that can compile to LLVM? Yeah, as a front end?

1:06:36.030 --> 1:06:54.154
<v A>Mean I look, the Inscripten engine takes an LLVM file as a parameter, and I don't think it cares where that file came from. So yeah, you could definitely anything that compiles to LLVM now can run natively in a browser, which is pretty wild. What?

1:06:55.032 --> 1:07:01.900
<v B>If I want to write JavaScript right before going to bed, I might be in my pajamas. Oh.

1:07:02.541 --> 1:07:25.920
<v A>Man, so somebody had an awesome idea. They said what if we basically took the Google Web Toolkit and ported the entire thing to Python? And that's what they did. And so Pyjamas is a Python to JavaScript compiler, and so they try and keep it relatively up to date with the latest Google Web Toolkit.

1:07:25.920 --> 1:07:29.220
<v B>And it's spelled pyjamas. Yeah.

1:07:29.320 --> 1:07:32.055
<v A>Yeah, with a Y. That's right. Pretty awesome.

1:07:32.120 --> 1:07:34.907
<v B>So you can code Pyjamas in your pajamas, maybe.

1:07:35.582 --> 1:07:42.231
<v A>We need to do that. This needs to be a milestone. I'm pretty sure you'd get an achievement for that. Oh, that might be good. Yeah.

1:07:42.920 --> 1:08:48.330
<v B>Another one is reiterating your assertion that people in Silicon Valley are addicted to their coffee is CoffeeScript. So it's a play on Java, which is, you know, coffee to CoffeeScript. And so this is kind of an extension, a growth of JavaScript. It adds some of the features that are trying to come into Java and it kind of makes even more brief syntax and some, I guess what's called syntactic sugar, so things different ways, different notation that you can use that allows you to be more shorthand and doing more powerful things with the language. And it compiles—it's another language that compiles to JavaScript, but it looks a lot like JavaScript. So some of these other things, it would be very hard to write kind of one part in hand-coded JavaScript and one part in C++ to LLVM to JavaScript. You know, that's kind of could get messy versus like the CoffeeScript. It's very easy to sit side by side with handcrafted JavaScript. Yeah.

1:08:48.800 --> 1:10:17.346
<v A>Definitely. And so the last one we have is called Clojure Tools, not to be confused with Clojure, which is a JavaScript extension. Clojure Tools, with an S—well, CLOS Clojure Tools, is it's a language that's very similar to JavaScript but it adds some extra type safety and things like that. It's a statically typed language as opposed to JavaScript, which is dynamically typed. And the idea here is if you're doing something, if you're running like a big project, you have like hundreds of developers, and there's all sorts of stuff going on. You really, dynamically typed languages can become an issue, can become a problem. They create bugs that are hard to find. People can accidentally pass a function into something that expects a variable, and you don't really have any compile-time errors because the system doesn't really know it can't make any assumptions because everything could be any type. So Clojure sort of puts more restrictions on JavaScript with the idea being that you're going to use this for sort of an enterprise application that you can use the extra time to make something that's more robust and less likely to fail. And Clojure code compiles into JavaScript. Nice.

1:10:19.160 --> 1:10:21.278
<v A>Nice. Yeah. So what are—oh, go ahead. We're...

1:10:21.278 --> 1:10:25.311
<v B>going to ask the same thing: What are the strengths of JavaScript? Yes.

1:10:26.940 --> 1:10:43.502
<v B>So we talked about the fact that all the different browsers have JavaScript, and we complained that they were different between them all. But the nice thing is that if you write in JavaScript, you know that the browser is going to have some support for it. Yeah.

1:10:43.679 --> 1:11:32.170
<v A>I mean, just to explain this like, you know, more detail, like with a just to put a contrast on this. You know, if you write your code in C, it's going to compile down to machine code which of course your machine can understand because every machine has a machine code interpreter—that is the CPU. You know, if you use something like Python, you know, the person on the other end, so the person who's running your code, the customer needs to have Python installed or, you know, you can do some crazy hacks to sort of inject the Python virtual machine onto their computer without them installing it. But I mean, those are hacks. But the thing about JavaScript is that everybody has the JavaScript interpreter. You don't have to tell them to go out and download it; it's already on the machine. Nice.

1:11:32.170 --> 1:11:37.200
<v B>Like Flash, which you know doesn't come by default on a lot of installs.

1:11:37.200 --> 1:12:37.740
<v A>Yep. Yep. So another strength is JavaScript. Now, JavaScript has something called JavaScript Object Notation, or JSON. And you know JSON is actually used—it's similar to XML. It's a file format that's used in many languages but it's particularly amenable to JavaScript because JSON consists of the basic primitives that JavaScript consists of. As I mentioned before, something's either an array, an object, a floating-point number, or nothing. And JSON—JSON something is also one of those four things. So you can seamlessly go between objects in JavaScript and this JSON format. So you can say take your HTML DOM, which is a JavaScript object, convert it to JSON, and then send it to somebody else. Then he can convert it from JSON to a JavaScript object and continue manipulating it.

1:12:37.740 --> 1:13:25.100
<v B>Nice. Yeah. So there's also the ability to—JavaScript helps you not have to refresh a whole page like back in the day everybody used to do whenever you would click something, pull down a menu and select something, the whole page would refresh. And so things couldn't update once they were there; they were there. You couldn't get new news stories or new tweets to just pop up into your web page. You would have to reload to see them. If you want a new mail, you had to click the refresh button. And so AJAX—Asynchronous JavaScript and XML—did I get it right?—has added that ability which was for the JavaScript to keep running and like JSON talked about earlier kind of pull the server and say, 'Hey, do you got anything new for me?' And then act on it when something new does arrive.

1:13:25.100 --> 1:14:43.769
<v A>That's right. So going back to the Gmail example, there's a JavaScript thread which is constantly running in the background and constantly querying Google and saying, 'Hey, do you have any new mail?' And so how it's doing that? It's actually making a request. So in other words, there's a website that you can go to—a real website in your browser—and it would either return like just it would either be blank or it would have a bunch of JSON in it which is like pretty unintelligible, you know, to humans. But JavaScript is constantly going to this website as if it was a real person typing in this URL, and whenever it gets something, whenever there's something to display, it's taking that data and saying, 'What is this?' Oh, it's a new email, and then putting it on your screen. So JavaScript is able to pretend like it's a person and make additional requests and then put the results of those requests on the screen without refreshing the page. Yep. So yeah. Another—oh, go ahead. No, we keep doing this. We're just, you know, ever since Patrick moved to the Valley, we've just been on sync. I think that's what it is. I think you have...

1:14:43.780 --> 1:14:50.282
<v B>to move back now. We just shorten that delay—just enough that now we can interrupt each other. Fantastic. So,

1:14:52.120 --> 1:16:36.055
<v A>JavaScript. You know, the people who designed JavaScript, they knew that well tabbed browsers weren't around, but you know multiple browser windows were around, and people knew that you would have more than one website open at a time. And so, and they also knew that websites had to be responsive, and that was key to the user experience. I mean, if the server is busy doing something and your browser locks up—I mean, that's a really bad user experience. You know, often, you know, if you're using Photoshop and you're doing some really complicated tasks, and so you just get the bar that slowly goes across the screen, that's okay because you expect that. Doing some crazy Fourier transform or doing some Magic Eraser or something in Photoshop is going to take a while until you expect that. But on the internet, you know, the expectation is that things would be instant or as close to instant as possible. And so, to sort of obfuscate all of the time that goes into making requests, waiting for the server, JavaScript is asynchronous, which we mentioned back in the Objective-C episode. It's designed for you to be able to say, 'Hey, I need some data, but I don't want to wait for it. Whenever you have it, let me know, but in the meantime, I'm going to keep running.' And so JavaScript is designed from the ground up to be asynchronous, and that's one of its biggest strengths. That's one of the reasons why Node.js is so popular. The server could get a request from a client and say, 'Hey, go process this, but I don't want to wait for that. I have more clients that I need to talk to.' And so asynchronous languages actually make for great web servers, but they also—they make for great anything. So some of

1:16:37.034 --> 1:17:03.440
<v B>the issues we already alluded to this one many, many times, but the fact that JavaScript doesn't have a standard implementation and exact definition across all the browsers. So you've got to handle that somehow, either by doing kind of if statements in your code all over or using a library that tries to handle it for you or handle it for you. And that's an issue that's hopefully will get better one day, but I'm not going to hold my breath.

1:17:03.440 --> 1:17:51.182
<v A>Yeah, I mean even today if you look at websites in Internet Explorer and you look at them in Chrome or Firefox, you'll see different. There's either a different visual style or there's some different functionality. It's just it's close to impossible, or at least it's extremely difficult to get things to behave the same. And that's why you end up with some really crazy hacks, like I saw one hack where they got a rounded rectangle by creating a bunch of like really tiny, like one-pixel high rectangles and they just by layering a bunch of these, like a cake, they were able to create sort of like this rounded shape on the top and the bottom of the rectangle. And so it's just you get these crazy hacks because people

1:17:51.182 --> 1:17:56.970
<v B>do crazy stuff like that, though, because it makes their website stand out different than everybody else's, right?

1:17:56.970 --> 1:18:34.059
<v A>and you know, you think about the process of a website. Is you have an artist who's using something like Photoshop where he can do whatever he wants with those pixels, and he comes up with a mock of like this is how I want it to look, this is how this is my vision, and this is sort of the best user experience. And he kind of has the expectation that you can sort of make this a reality. And so often, you know, the programmer has the burden of sort of taking this image that someone made in Photoshop and creating a website that sort of conforms to this image. And so in trying to accomplish that, yeah, you end up with some really crazy stuff.

1:18:34.059 --> 1:19:25.598
<v B>Another thing is that it can be hard with some of this stuff that you're basically going to a website downloading some code and running it on your computer. Yep, but that's exactly what hackers want to be able to do. Yeah, let's have you download code and run it on your computer because in most of the time when that happens, it's a win for the hacker. They win that once code is executing on your computer, they can make that code be whatever they want, and they win. But the JavaScript challenge is you got to be able to do that but limit it. And so you can't let it do which kind of will play into our next point, but that you can't let it do certain things because else people would make it do bad things. So you have to very much limit what it has access to, what it's allowed to do, what it's not allowed to do, how it can behave, right?

1:19:25.598 --> 1:20:46.560
<v A>Like just to put it in perspective, HTML5 adds local files to JavaScript. So up until now you haven't been able to create a file on that on the client's computer. So think about that. I mean, you know, the very first thing you learn when you learn a language is reading and writing to a file, like one of the very first things is, you know, you create a file 'hello world dot text,' and you read all the lines from it or something like that. But you know up until now you haven't been able to create or delete files in JavaScript, and it's because of what Patrick's saying, you know, someone else is running code on your computer. And so if you go to some malicious website, maybe they create a ton of files or they read your whole hard drive or something like that. So now with HTML5 there is—I believe, you know, you can first of all you can't access the hard drive; you can only access like one folder on the drive. And then in that folder I think you can only create five megabytes worth of files per session. So, you know, they have all these restrictions now, and browsers have become more sophisticated so that you can do things like that. But but yeah, you can't—there's a lot of things that you can't do in JavaScript because of that reason. Yep. So what are some of the things you can't do in JavaScript? Do you know any? You have any in mind?

1:20:46.560 --> 1:20:51.677
<v B>Anything you can't do? Yeah, you can't access a microphone. Yeah.

1:20:51.863 --> 1:21:00.621
<v A>I mean that's I think that's huge, right? I mean look at what was I thinking there's so for

1:21:00.621 --> 1:21:07.169
<v B>Instance Skype. Skype can't run in just a website; they'd have to use Flash. Yeah, like Google Hangouts and do all this other weird stuff.

1:21:07.169 --> 1:21:18.576
<v A>Google Hangouts is sort of a thing where you can chat with different people online, but to do that, you have to download and install and run a plugin. You know, they couldn't do it in JavaScript.

1:21:19.487 --> 1:21:35.603
<v B>Yeah, you can't right now. You can't like use a webcam. Yep. Use somebody's graphics processor, which you can't use it directly, but in theory somebody else could detect what you're doing and decide to run that code on the GPU if they wanted, right?

1:21:35.789 --> 1:22:05.387
<v A>So there is, and to be completely fair, there's WebGL which doesn't let you write code like to access the GPU, but does let you, you know, draw triangles and things like that using the GPU. So, you know, HTML5 has unlimited GPU accessibility, but yeah, and the browser also will do things like use the GPU to help rescale pictures and things like that, but that's sort of outside of control that you have as a JavaScript.

1:22:05.387 --> 1:22:07.480
<v B>You don't know whether or not that's going to happen. Yeah, exactly.

1:22:07.480 --> 1:22:22.262
<v A>So yeah, I mean really, you know, if you have some kind of custom hardware—if it's a webcam, a microphone, you know pretty much anything, I mean the volume on your speakers, I don't know. I'm just looking around. You have pretty much no hardware my.

1:22:22.262 --> 1:22:23.055
<v B>TV. Yeah.

1:22:23.190 --> 1:22:27.494
<v A>Let me know my USB-powered robot that cleans the floor. You keep.

1:22:27.494 --> 1:22:28.500
<v B>An airplane. Yeah.

1:22:28.500 --> 1:22:42.580
<v A>Your RC plane. You know, JavaScript can't control any of these, and this is because you don't want to go to some website like CrazyJoe.com and then all of a sudden, you know your printer starts printing, right? So so um so yeah.

1:22:42.580 --> 1:22:45.837
<v B>Well, it depends on what it's printing. If it's printing something awesome, maybe I do have.

1:22:45.837 --> 1:22:49.195
<v A>It's a coupon to Crazy Joe's. Yeah, I'd want that all.

1:22:49.195 --> 1:22:59.489
<v B>Right. All right, man. Well, I think that was good. That was good. Good talk about JavaScript. Congratulations on making it through 10 episodes, man. Pat yourself on the back.

1:22:59.489 --> 1:23:15.368
<v A>Yeah, you too, man. Definitely. This is a milestone. I think that every episode has been really—has been really awesome, and I hope that the people out there yeah feel the same way we do that we've really been able to sort of deliver a lot of content with some good flavor. Yeah.

1:23:16.127 --> 1:23:50.299
<v B>I've definitely enjoyed doing all of these and hearing from you guys out there and saying that you know you enjoy the show as well. And that's definitely encouraging, and it keeps us doing this and excited about doing it. We have a lot of friends now on our Google Plus account of Programming Throwdown. I see every so often. I keep seeing people in there doing stuff. We're getting some a couple more iTunes reviews. We've gotten. So that's pretty awesome. Yep. Keep doing that. Keep up that work. Help us increase our ranking on iTunes. Yeah.

1:23:50.384 --> 1:24:19.982
<v A>So just so everybody knows, there's we have a blog, programmingthrowdown.blogspot.com. We also have an email address: programmingthrowdown@gmail.com, so you can email us any suggestions for new languages that you want to see or particular topics, or just give us comments and feedback. We're also on iTunes; you can rate us on iTunes, and we're now on Google Plus, so add us to your circles.

1:24:20.522 --> 1:24:38.039
<v B>That's cool. Also, we should mention that—oh, I completely just lost my train of thought. Oh, we need to make sure we are on the Android Marketplace as well, or whatever the Android download. Too. We need to do that. Somebody mentioned that to me, one of our fans.

1:24:38.039 --> 1:24:39.524
<v A>Talking about Android download, there's...

1:24:40.266 --> 1:24:55.774
<v B>They said that there's an Android podcast. Oh, like Catcher? Oh, I didn't know that. Yeah. Oh yeah, we'll learn something new every day. This person—one of the fans was telling me that they tried to find us on their Android phone and whatever app they were using, they couldn't find us on it. So, oh.

1:24:55.774 --> 1:24:57.074
<v A>Yeah, we'll have to check into that.

1:24:57.411 --> 1:24:58.440
<v B>Okay, anyway. Sorry. Yeah.

1:24:58.440 --> 1:24:59.940
<v A>Well, you'll find us on there.

1:25:00.145 --> 1:25:01.022
<v B>Too, once...

1:25:01.022 --> 1:25:02.001
<v A>We fix it.

1:25:02.035 --> 1:25:02.406
<v B>All.

1:25:04.419 --> 1:25:08.835
<v B>Right. Well, thanks for listening in and, like always, make sure to leave us some feedback. Yeah.

1:25:08.835 --> 1:25:35.980
<v A>Definitely have a good one, guys and gals. 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 you.

