Welcome to web applications for everybody. I'd like to take this first lecture to talk a little bit about the core technologies and the people who built some of these core technologies. Of course, every one of these requires a group of people but I have some cool interviews that I'd like you to take a look at. Not so much because I want you to memorize what they say but I also want you to kind of understand the kind of people that made these things and how technology is made by people, we're people and people make technology. Nothing's perfect. Everything is kind of a set of compromises and a set of choices and so there's no magic to all this. If you say, Well, there's a kind of funky or flawed, it's funky or flawed often because it wants to be like that or it's, naturally, someone made a choice. And so, we'll talk about the web server. We're going to talk about the PHP programming language, SQL, the language you talk to databases, how we talk inside the browser using Javascript and JQuery which is like a library that makes Java client-side coding so much easier. And then how we send data back and forth between the browser and the server using a protocol called JSON. The kind of the foundation of everything we're going to do is the Apache Web Server. It's an open source project, it was part of the 1992, 93, 94 project at NCSA, the National Center for Supercomputing Applications, that was part of the Mosaic. And the Mosaic was a browser, a client, and the Apache Web Server was the HTTPD, which stands for Hyper Text Transfer Protocol Daemon. Daemon was the thing that was always there so the client could talk to it. When the Mosaic Project kind of went down at NCSA, it was open source and a bunch of people picked it up and Brian Behlendorf was one of those people. Apache stands for, depending on your interpretation, Apache like very patchy web server because they kept patching this thing and that created the Apache open source foundation as the first product. It's open source, it's written in this programming language called C which is a very low-level and powerful programming language that really underpins lots of the technologies that we use. This is sort of a slide where I talk a little bit about the history of all these programming languages. C is an interesting programming language because in 1972, it's the programming language that was used to write Unix, was used to write Linux, was used to write Python. If you look at Python itself, Python is written in C. Prior to C, in the beginning, we tend to do lots of calculations. We saw computers as really fast calculators and so a lot of the things we did was either write very simple machine language programs or Fortran programs that really were trying to use it as a fast calculator. Some time in the 15, 20 years, between the 1950s and 1970s, we realized that computers were going to be used for things like email and social networking, sending text and there was a whole bunch of fancy text languages that were built but none of them really were a combination of text-savvy languages and super fast languages. The first language that I recall that was both really good with text and good with numbers and really fast and suitable for writing systems kinds of programs was this language called C. And a lot of us fell in love with it, it was a very succinct programming language. It uses curly braces for if statements and for statements. It uses this fork syntax with the two semi-colons in the middle. If you've seen Java or Javascript or C++ or Objective C or C Sharp, you've seen this language because all of these languages at the top here, the kind of system-y programming languages, take their very much cues. Javascript is kind of on the gray area between fun languages and system programming languages. But they all took their cues from the C language which was used to write, like I said, Linux and Unix and even Python is written in C, so Python was written in C. In addition to the sort of system-y languages, there's a whole series of easy-to-use languages and Perl was this language that stands for something Report Language and it was about sort of handling simple data stuff and Perl was really an inspiration for Python. But Python was written in C and so C Python took a lot of inspiration from C. I hope, by now, that you know the Python language and the PHP language which is another of the languages we're going to learn in this series of classes. It's also written in PHP, it took a lot of inspiration from C. PHP is written in C and takes a lot of inspiration from it but it also takes a lot of inspiration from Perl and, to a lesser degree, probably inspiration from Python. And this bottom set of languages, these are really simpler programming languages that have simpler primitives that are easier to use. Javascript kind of lives in the middle. Javascript is increasingly both a system programming language and kind of a lightweight fun language and we'll use it in some ways for both things. Javascript is a very interesting language. I prefer not to teach Javascript as the first language because it's so sort of beautiful, elegant, and powerful. I mean, it's easy to find a little bit of code and stick it in your web page and have it work but to truly understand Javascript, it's probably better for it to be your third or fourth language that you learn. And if you've learned Python and PHP and SQL, HTML and CSS and then you finally learn Javascript, to me, that's the right order. And that's the order that we're going to do in this class. But I still want to introduce you, then, to some of the folks who've built these basic technologies. PHP language is a programming language that is a templating language that's merged into HTML pages. It's like you've got HTML and then code and HTML and code and HTML and code and so it's very easy to add little tiny bits of dynamic calculations and dynamic code to part of a web page. Some of the web page comes from code that runs and has print statements in it and then some of the web page just comes from the HTML. PHP was created by a fellow named Rasmus Lerdorf. Now, thousands of people maintain it is a large open source project. Rasmus was not a trained computer scientist. I encourage you to watch his video, he'll honestly tell you that he's more interested in practical, easy-to-use stuff than he is about building the world's greatest programming language. Now, PHP is from the 80s and so it's almost 20 some years old and so it's gotten more elegant as time has passed. PHP 5 and PHP 7 are much more elegant than PHP 1 and PHP 2. But the idea is to get you, as the programmer building a web application, productive as soon as possible. He was having trouble in the mid-1990s because he was writing all of his web pages in C and C is very very very hard. Take a look at it and Rasmus is a fun guy and PHP is very much a reflection of his early approach to building it. SQL, I hope by now, perhaps you've seen a little bit of SQL. SQL is a glorious and beautiful language. SQL basically takes a very complex problem, that's how to optimally store data in memory of the computer and on the disk of a computer and get things next to each other that are likely to be pulled up at the same time. Joins and Inserts and Selects and Updates and Deletes. And databases themselves are like super complex. I mean, you could have 20 careers with PhDs in all 20 of them and you still wouldn't know enough to know all the stuff that database applications are capable of doing. But, we have this thing called SQL, where all that complexity is beautifully abstracted for us. And we just say, I would like to do this and you magically figure it out. So, that magic figured out is full of PhDs in computer science. But, we don't have to worry about that. SQL is such a beautiful language. The birth story of SQL is a little different than the other languages. In the 60s, all the database vendors, IBM and Oracle and Sybase and companies that don't even exist, were fighting over the marketplace. And they all had a different view of how databases should be built and they did. And, each one would have their PhDs in computer science, they would build different databases. And they would build different languages to talk to those databases. And then, the US government in the form of the National Institute of Standards and Technology NIST, said, look, we're tired of arguing with you about which is the best database. And, what we need is a standard language to talk to any database. You can implement them any way you want. Go ahead. And so, they said, hey you industry people, you get together and you develop a standard. And SQL was that standard. And Elizabeth Fong, I did an interview with her. I went to visit her at NIST, and she talks about how this happened. And it was kind of a magical thing, because all these vendors got together and produced something beautiful. And it was an abstraction. in that it really wasn't a direct implementation. The language didn't directly implement any of the vendors databases but it was a way to talk to any of them, in a very beautiful abstraction. So, it turns out to be a very very beautiful language and I think you'll agree once we get talking to it. So, after we're done in the server, we're going to start playing in the in the browser, in the client. And so JavaScript is like this C-like programming language and it has curly braces et cetera, et cetera. But, its early design was to be done inside of a web browser or web page. And, so it actually has these predefined constants like document and window, that allow it to mess with your browser. So, you're watching your browser page. And JavaScript is sneaking around and fiddling with the page and doing things and you're seeing those changes through what's called the document object model or the window. Where things that's how you can be in a page and a new thing pops up. A little red bot, that's all done with JavaScript. And so JavaScript is really cool. It was in 1995, Brendan Eich was the inventor of this. It was at the Mozilla Foundation or the Netscape project. And I encourage you to take a look at Brendan's video. Brendan is very different than Rasmus, in that Brendan is even smarter than a computer scientist. Brendan is a physicist, which we good computer scientists look up to physicists. Because physicists are so smart, they know a lot of math. Brendan really saw JavaScript as his chance, in a very hurry without really telling anybody, building what he considered truly the most beautiful programming language that humanity had ever seen. That's how high of a goal he had for it. And he's just smart enough that he'd seen so many languages, he had things he liked about them and he took that C-like language from Java, the C-like syntax from Java, and built a very beautiful language. And when I get to telling you about like how Azure and PHP compares with object oriented JavaScript. I'll totally geek out about it, because I like look how elegant this is. You're like just show me the syntax. So, what I'm saying is JavaScript is a beautiful language and that's why JavaScript keeps increasing in popularity. You may be working in an organization that uses JavaScript in the server, in addition to in the browser, using a framework called Node.js or other JavaScript frameworks. So, take a look at the JavaScript interview. It's really I think quite cool. And again, sense the personality of these people. Now, JavaScript is this beautiful programming language and it talks to the browsers through this thing called the DOM, the document object model. And they standardized JavaScript very quickly. So, JavaScript is all the same but they didn't standardize the document object model. The things that JavaScript does to change what's going on in the browser. Okay. And so, the problem was, is if you had Internet Explorer 6 or Internet Explorer 8 or Chrome or Firefox, they all were different. Not JavaScript, but how JavaScript did things in the browser. And so jQuerry was a portability layer that was built by John Resig. And it was a very elegant and portable way, to do things in the document object model. And so, John is like 10 years after all these other folks in that he is trying to make it easier for us to do. So, a lot of people these days just assume, jQuery is JavaScript because it's a better way to talk to the document object model. And, it's a really great way to do stuff and it keeps our code in the browser much shorter. And so I encourage you to take a look at John Resig. And so, the last thing we're going to talk about is what's called JSON, JavaScript object notation. And that is basically the format of data that once you have really smart browser code and really smart server code and the code, instead of the page but the code behind the page wants to talk to the server on your behalf, and start sending things without even you doing anything. You'll just be like and it'll send something. Like, go check to see if there's any new messages. Go check to see if there's any new messages. Well the new messages come back in a format called JSON. And this video that I have Douglas Crockford, who doesn't credit himself as the inventor of JSON. He is the discoverer of JSON. And, that's because it was actually part of JavaScript. He just took part of the JavaScript language and created a protocol that then capture or captured that and then we use that for a lot of different things. And so, I encourage you to take a look at these videos when you have some time. They're not essential. You're not going to learn JSON from watching a Douglas Crockford video or Liz Fong's not going to be able to teach you SQL. But, I think it helps you to understand that all these things are the creation of people. And, with people working together to come up with something. And, there's all kind of compromises and it's all very interesting stuff. And you may ultimately end up writing with Node or Ruby on Rails. Or who knows what you're going to write your web applications. But, at the end of the day, everything is something that we people have created and then we people, use and use from each other.