Transcript from the "Node Overview" Lesson
>> Will Sentance: Let's start off with seeing what it actually is to open a web application. What does that even mean? What's that even look like? Well, let's get started. Let's suppose we have in our audience, three of our audience members. Let's suppose we have Michael, and Michael is going to open his Mac and he opens his Mac, and it's going to load up at twitter.com slash Michael.
[00:00:34] There we go. Okay Michael's tweets, open it in the web browser, here's our little Chrome web browser. Okay, then we're going to have I don't know, we have Rich. Excellent Rich in our audience as well we'll have Rich. I'm opening up Richard's Linux Richard runs a Linux he opens up Linux and Linux.
[00:00:55] He opens up Linux and. He also loads up Twitter, but he wants to go to the tweets about, about Node. About Node.js, there is is. And then, let's have, we'll have, Zep. And let's see, Zep opens his phone, and Zep's phone opens up, there it is. And he also opens up the web browser, and he opens up twitter.com, here, just the home page.
[00:01:26] These are web applications. They need code to run, that's the three languages we're gonna have run at this point. To open Twitter, and they need data to load up when that code runs. Zep what is the three, oddly we have to write three languages to load web apps.
[00:01:47] What's the three languages we need Zep?
>> Speaker 2: HTML
>> Will Sentance: HTML
>> Speaker 2: CSS
>> Will Sentance: CSS
>> Speaker 3: Data from the server.
>> Will Sentance: Yeah, but specifically for Twitter, we're probably gonna have some tweets.
>> Speaker 3: Tweets.
>> Will Sentance: Yeah, we're gonna have some tweets, we're gonna have some images, maybe some videos.
[00:02:49] This is our data, this here is our code that we need to load up. But hold on, where's all this data and code coming from. So we're going to start with the absolute fundamentals here. We're diving into the absolute fundamentals but from this we're going to build up to a grand vision of building out Node applications.
[00:03:13] And we saw gaps in fundamentals. Where does this code and data come from Zep?
>> Speaker 2: A server.
>> Will Sentance: A server.
>> Speaker 2: Another computer.
>> Will Sentance: He gave the answer, a server which is nothing but another computer. Here it is another computer connected to the internet always on, always connected and ready to receive a message sent out by Michael's Mac.
[00:04:07] I need the Node.js tweets, that's what Rich needs. And Zep he needs the homepage with all the tweets on it. Sends a message to Twitter's headquarters where there is a computer connected to the internet, nothing more than that. But one that's able to received messages saying hey I need, specifically Rich's tweets, Michael's tweets, Michael's tweets.
[00:04:49] What do I do Michael in order to, you know in most intuitive most kind of grounded sense Michael. What do I do to on that computer to tell it as a developer to look at the message and send something back. What do I write?
>> Speaker 3: Code.
>> Will Sentance: Code, good job Michael exactly.
[00:05:08] I write code. I write code on this computer to introspect that means look into this message and see what it says is asking for and decide what's to send back. But folk here's the problem. Where's this message arrive on my computer?. It arrives people on well effectively on a network card.
[00:05:32] It arrives in my network. This is going to be interesting. What languages might I want to write to control that? Well, well first, what languages can I write to command to make instructions to this computer. Rich, what other languages can I write, in general?
>> Speaker 2: PHP
>> Will Sentance: PHP, sure, PHP exactly.
[00:05:59] Java. Shout out some more.
>> Speaker 2: Ruby
>> Will Sentance: Ruby. Every person shouted Ruby, remarkable.
>> Speaker 2: C
>> Speaker 2: [LAUGH]
>> Will Sentance: And actually by the way, let me just hint there if this computer is known as a server, it's going to receive messages and serve back like a server in a restaurant serve up data and code to send back to these folk here.
[00:06:32] These are known as our clients. Clients, just like in an advertising agency, you, as a client, you're asking the advertising agency, you're the advertising agency clients, you're asking them, hey, do you have the latest assets, the latest videos, the latest images you worked on, you're demanding for them.
[00:06:52] Well, that's what we're doing here, we're demanding of the server to serve them back. Okay, our dream would be that we could use our computer's internal networking ability, it's ability to receive a message. Because that message Is arriving here on the network. That we could somehow use the computer's internal networking ability to look at the inbound message intercept it and decide what to send back.
[00:07:22] Actually folk, there's a whole bunch of internal features of our computer we want to use. Let's just remind ourselves a second there, servers are the behind the scenes of all web applications, they're where we store permanently our coding data, they're always on and ready to receive messages over the internet from users requesting, they call it requesting, asking for that code and data.
[00:07:49] How's the computer to know what to send back? We write, Michael?
>> Speaker 3: Code.
[00:08:18] So I guess I also will need to write code to get those files, the HTML, .HTML file, these are files that get sent of code. Pre-written code that we're gonna send back so Michael can load up his tweets. We're going to have to I guess access file storage as well.
[00:08:56] We watch Hard Parts Part One, Hard Parts and New Hard Parts. Hard Parts OOP, we all watched it, right? Hm-mm. It also has some really wonderful design decisions that are going to actually make, in theory using these features, really clean experience. But there's a bit of an issue here.
[00:10:08] The little message comes in, it lands somehow on the network feature, the network card in some sense. What language would allow us to access and look at that message?
>> Speaker 4: C++?
[00:12:32] That will give us access to C++ features that give us access to the computer's internals. Now that might feel like well, what do we need to know about those C++ features? If we're going to understand and write the code, do we need to know about them. We definitely need to know about them.