Basic Programming Concepts: continued
Computers can only understand ‘yes’ and ‘no’ – without the help of software/programs. If we go into a little more nerd detail, we see that computers actually see ‘yes’ and ‘no’ as 1 and 0. Once again we can say that programs are sets of written instructions telling computers what to do.
Because of how stupid computers really are, programmers (a.k.a.: nerds) over the years have written programs that make it much easier for us to ‘talk’ to computers. One of these programs that make our lives easier is the web browser.
I hope that this basic explanation of programming clears things up a little for all of you reading.
Ok, that is a lot of abstract information to take in, let’s look at something a little more concrete.
Are HTML and CSS programming?
We know by now that HTML and CSS are used to build web pages. This is a question that comes up from time to time; since HTML and CSS are essentially just lots of code that is used to tell the browser what to display (HTML) and how to display it (CSS), isn’t it programming? The answer is ‘NO’, and this is why:
This is of course a simplification of the situation but it essentially covers it. It can get confusing because in the world of the Internet there can be a ‘gray’ area where without using programming you can get the browser to do something on its own. An example of this is the META tag ‘refresh’. This tag allows you to tell the web page to reload itself or to load an entirely new page after a specified number of seconds or minutes. Here’s what the META tag ‘refresh ‘ looks like:
<meta http-equiv='refresh' content='3; URL=http://www.killersites.com'>
This tag tells the browser to load the page: http://www.killersites.com after 3 seconds.
Some people will get a little confused and say that since the META tag code is telling the browser to do something, it is programming. Right? Wrong!! The reason that it is not programming is because there is no decision being made. No matter what else may happen (as long as they stay on the page for at least 3 seconds) the page will automatically load the website in the Meta tag (in this case: http://www.killersites.com ).
To make this example act like it was truly programmed, you would have to be able to (for example) control if the browser would reload the page or some other page depending on, say, what the user did on the page.
An easy example: say you had a box on your web page where the user could enter in a number, and depending on the number entered, the browser would load a particular page.
This shows how programming allows you to make decisions based on as many possibilities you want.
A final point
This is just the first part of this series, in the second part I will slowly introduce you to more concepts that will give you the foundation you need to get into some real programming. With just a little patience, in no time, you all will be programming!