Now that you have learned the basics of how a computer works and how computer programs interact with the operating system and the computer hardware, lets start writing some code. For those of you who have already written some programs this may seem like a very simplistic start to this class but I think its very important to start at the bottom and work your way up.
As you read in how computers work the CPU interprets instructions. Those instructions can come from the operating system (a computer program that runs the computer) or by software running on the computer (a program perhaps that you have written or even written by Microsoft). There are different categories of programs we can write and run on our computer and we will be learning all the different ways in this class.
Let's start out with the simplest of all programming languages the markup language. You have certainly seen the product of this language. In fact, you are looking at it right now :-). Hypertext Markup Language or HTML is actually a programming language that was developed when computers weren't very powerful and internet speeds were a fraction of what they are today. It was developed so that a simple text file can be used to display all the diverse web pages we see every day. Initially, the Internet was very slow and bland. The only thing on it was text and the only formatting (if you can call it that) was a blue font and underline for a hyperlink. Certainly a far cry from today's web pages. Well, everything changed in the early 90's with a browser called Mosaic which was used to display pictures, colors, sound....wow! It was big. The problem was that the bandwidth (modem speed) was still very slow. HTML was developed to display all that rich content with a very small text file. The html code it interpreted by the browser, line by line and displayed in the browser window. How does it interpret it? Well, the built in interpreter changes the instructions into assembly/machine language (the language that the CPU understands) and the page is displayed.
Your first program:
1. Open Notepad (Start, Programs, Accessories, Notepad)
2. Type the following: <H1>Hello World!</H1>
3. Save the file by naming it firstProgram.htm. Make sure you
remember where you saved it. Also change the "Save as Type" setting from
Text to All Files. If you don't do this last step you will end up with
notepad adding .txt to the end of your file and it will not display correctly in
the browser..
4. Open your Browser (Internet Explorer or FireFox). Click on File, Open,
Browse. Browse to the file you saved and open it in the browser.
You should see
Okay, there you go, you are now a computer programmer! We will be using more html in the next section of this course so you will need to know how it works. To assist you I have the following assignment. Why, you are wondering, are we starting with html? For a couple of reasons. First, because it is a programming language that is easy to learn and master. Secondly, creating a web page allows you to hone your debugging skills. Debugging is how we fix errors (bugs) in our code. Interesting that the word "bug" in a computer program comes from the 1950s when a computer wasn't working correctly. They found that a moth had flown into the wiring causing a short in the system. It was a bug and that's why we hunt for "bugs" in our code.