Next, we're going to talk about program development. This is kind of a complicated topic to talk about right at the beginning. But we talk about it at the beginning, because every student writes a HelloWorld program. But the actual process they used to get that program into existence and running is completely different for lots and lots of students, many, many different ways how to actually get the program running. And so what I want to do to answer the inevitable questions that we get about, which way to develop a program is more appropriate. I want to put this in a little bit of historical context and also a little bit of understanding of the process of developing any program. So just taking a high level view, program development in most programming languages is kind of a three step process with some feedback. So the first thing you do is edit your program. You create it by typing text on your computers keyboard and eventually you get a text file like HelloWorld.java. Then the second you do is compile the program, that's translating it from this text format to an executable file suitable for the computer. We use a program called the Java compiler and that creates a thing called Java bytecode file, which is called HelloWorld.class. And will be saved on your computer in the same file as HelloWorld.java, and that's the one the computer's going to run. Now, sometimes there'll be a mistake in what you typed, like you looked at the example of leaving off the republic and so forth. That's the compiler telling you that's not really a legal Java program. And you have to go back to step one to fix it and then recompile it. You want to keep doing that until you have a legal Java program that the compiler can turn into a bytecode file like HelloWorld.class. And then the third step is you run your program. And then that's using another part of the Java system called the Java runtime, that we invoke from the command line by just typing Java and then the program name. And the result of that is that gives the bytecode to the Java machine or the virtual machine that's working on your computer. And the end result is your program's output. Now again, maybe your program isn't doing exactly what it thought it was doing and there might be a mistake. If there's a mistake in the program then you have to go back to step one to fix it. In this case, you've got a legal Java program, but it's doing a wrong thing. So we'll have to go back and change the text file and then recompile it. And then run it again to see if there's no mistakes. So it's a little three step process with feedback where usually you edit, compile and run. And if there's ever a mistake, you have to go back and edit again, that's program development. Now this isn't so unusual, any creative process has this kind of refinement and development. So this is like music, they compose it and rehearse it and play it, and you have the same type of feedback. Any kind of creative process is going to have the same thing. Maybe there's a few more steps, but it's the same basic idea. But with programming, there's a big difference because we can use the computer to help get this done. The computer can help us find mistakes. And so what we talk about in this process is the idea of a program development environment, that software that we use for editing, compiling, and running programs. Now well there's a lot of different ways to think about program development environments, but I want to talk about two time-tested options. One of them called using virtual programs, and that's an approach that works for many different languages and systems. It's very effective even for beginners and it's very simple and concise. And there's another approach called the integrated development environment, which is often specific to a particular language or family of languages. Sometimes it's useful for beginners, and it gives a variety of useful tools. Most of you use one of these two approaches to get your first program going and we'll use them for later programs. So I want to talk in a little detail about both in a historical context and then compare and contrast them. So this is an extremely short history, and again, historical context is really useful in computer science because one thing is we're always using old software. A great deal of the software that's part of our computational infrastructure was written decades ago. It's surprising and a bit scary, but it's true. Not only software, often new computers emulate old computers, so that the old software can run. So we have to know about the old hardware and the old software. And a lot of the concepts in the designs that were developed five or six decades ago are really good, and we depend on them all the time. So that's true for program development. So in the beginning of the first computers, people developed programs just using switches and lights and the front panel of the computer. And we'll talk about that in the second part of this course. Without much delay, different types of input output devices like punched cards came into existence, and that a different way of interacting with computers. The people used for quite sometime in the 60s and the 70s. Before long there was the idea of the a terminal connected to a computer and I'll talk a liitle bit about each one of these on a slide, closer to what I talked about with the virtual terminal. We've an editor, a compiler, a one time terminal, it's kind of what we use. And then well, actualy, we use a virtual terminal on a laptop and I'll talk about that. And then there's integrated devleopment environment. And pretty much since the mid 70s, these two approaches that I'm going to talk about have really been in widespread use. So just a slide on each one of those. Somewhere around 1970, this is an example of a PDP-8 computer. In the heart of the computer is the little panel in the middle there, that I've blown up here. And the feature, this was for significant amount of program development was interacted with a computer using the switches at the bottom and the lights at the top. That was effective, but a pretty incovenient way to program, but people definetly program that way, we'll see a lot of detail on that in the second part of the course. The first thing that happens is people say, well, this is too inconvenient. We need better input output devices, and one thing that worked for a long time was punch cards for input and then line printer for output. So you had a machine that looked kind of like a keyboard, but for every line of your program, it would create a punched card. And so your program would be a physical deck of punched cards. You'd get a box, the box would hold 2,000 cards, so a good sized program is a 2,000 line program. And you'd actually write with a magic marker on the cards, the different parts of the program. And then there's a huge computer that everybody shared, and over on the right is a card reader. Operator would put the cards in there, and then your program would be in the computer and then it would print out the result on a line printer. So maybe your parents or even your grandparents, when they learned how to program in college, they used punch cards and the line printer, they can tell you about it. Before very long what we wind up useing say in the late 70s and 80s, even a little bit into the 90s was terminals that connected to a big computer. So you didn't have to go to the computer center, you could sit and you had your own keyboard for input and your own display for output. If you wanted to print, you had to maybe fool around a little bit, but the thing was that there were many users could share the same computer. So a small organization could have one computer and then everybody could have a terminal in their office that they could use to create the text that made up their program. And then to invoke the compiler and the editor, but all kind of sharing the same computer. And that was a welcome development becuase it got everybody computing in their offices. Now with personal computers nowadays what we do is use virtual terminals. But a virtual terminal just means that we're using the old software that was developed for those terminal devices. So what the key strokes mean and the output that it gives to the computer in a terminal window, your computer is precisely the same as those physical BT100 terminals that was one that was widely used. So this is just what my screen usually looks like when I'm programming. There's a virtual terminal for the editor. And then I have a different virtual terminal that I use to compile, run, and examine the output. I usually also have a virtual TV set, maybe with a Red Sox game on it. No virtual TV set, virtual terminal you get the idea. So I can type javac HelloWorld.java in a virtual terminal. And then I can type java HelloWorld to run it. And then I can see the output. So really, this whole set up, which is on my personal computer, is using old software in a convenient way. But it's a fine way to edit, compile, and run programs. Many, many professional programmers work in this way. You can have multiple programs [COUGH] displayed on a big screen. And you're going to have multiple virtual terminals going to run them in different context and so forth. But this basic idea has held up at least since the 1980s and plenty of people still use it. Another idea is this idea of an customized application for developing a program in a particular language, so called integrated development environment. This is one called DrJava and there's other integrated development environments that are appropriate for Java program. One of the down sides of integrated development in environments that I'll talk about is that they come and go like languages come and go. Whereas virtual terminals use the same environment for many, many different languages. So anyway, it's got a button in there. It's an application for developing Java programs, so it's got a button for compiling, a button for run. And then it's got a command line where you can also see the output. So this is just a different approach to developing programs. So what are the pros and cons of these two different approaches? Well, as I mentioned, virtual terminals works with any language. You can be doing things, controlling the computer without programming in Java. You can be programming in some other language or working other commands or deleting and moving around files, and many, many other things in your virtual terminal. So as I mentioned, lots of professionals us virtual terminals for program development and other ways to control the computer. It really has withstood the test of time. If you've got something that's been in continuous use since 1970, it's probably good for something. Now the thing about integrated development environment, some people feel it's, you've got language specific tools that make it a little easier, a little more convenient to develop your program. You have line numbers, you have color highlighting and other things like that. People do create system independent integrated environments, so new computer comes along, you use the same enivornment at least in theory. Although as I have mentioned, they come and go. And these types of systems are used by professionals particularly to create a huge programs. And also, they've got a lot of error chechking and hints, some other things like that, they can be helpful for beginners. So the problem with virtual terminals is that if you have a huge program or reading a long program, lots of different modules. You might need the help of something that understands something about the programming language that you're writing in and so the IDE would be better. And you're dealing with a bunch of independent applications, the terminal, the editor, the Java runtime and so forth. So anytime any one of those changes, you have to deal with it. And maybe people feel that maybe you're working at too low a level when you do the virtual terminal. So for innovative development environment, for HelloWorld, there's really a lot of machinery to fire up for short programs. And when you're learning first couple of years, you're basically writing short programs. It might be kind of overkill, it's a huge application that has to be learned and maintained if there's a new version of your operating system, the application, and these are complicated applications. So it might be problems as time wears on, with integrated development environment. And a lot of times, it's specific to the language, new version of the language comes out that IDE might not get job. Or you move to a new version of your system, your old IDE might not work and those type of problems are definitely there. So because there are so simple and consice and prescice, we talk about terminals mostly in the lectures and in the book. because there's too much information if we were to show a program in IDE. For assignments, a lot of people are going to recommend that you use IDEs. Although you'll find plenty of programmers and bosses that'll say, just use virtual terminals, you'll be fine. So those are the tradeoffs. We have many students that use both either system and that's the story on program development. So one of the lessons that every computer's got a program development and actually multiple. Let us go through the cycle of editing, compiling, and running. Using virtual terminals, using integrated development environments have worked for both of them. They've worked for decades all the way from the first personal computers like the Xerox Alto, the Apple Macintosh, all the way up to today's computers.