What is this?
Let’s
assume that you have no programming experience at all, but have used computers
(by now, that’s just about everyone).
So, why do you want to learn about programming? Are you being forced to because of a class
you’re enrolled in, are you having problems communicating with a geek, are you
looking to impress a friend, or do just want to try something completely
different? Whatever your reason, we’ll
start off with a basic explanation of computer programming and discuss some of
the ways that programs are used.
You can find multiple definitions for the word program, the one we’ll use here is this
A program is a planned
sequence of events or structured activities.
Now
that we know what computer programming is, the next question is, why do it? Well I’m not going to get into an explanation
of computers and what they’re good for, but let’s just say that a computer is a
machine that can be used to carry out instructions that perform computations,
control a device, process information, etc. – the list is only limited by our
imaginations. Simply know this boys and
girls, computers and computer programs
make the world a better place! So, this is how it goes – you write a computer program that has the instructions you
want performed, load the program on a computer, tell the computer to execute
the program, and that’s pretty much it.
Sounds pretty simple, eh? It
really is that simple, at least conceptually.
Let’s say that you want to write a program to display on your computer
screen a welcome message and the current time, like this
Hello, World!
The current time is 2012-12-21 12:00:00 PST
You know what you want the computer to do, so you just put those instructions in the program and that's it, right? But wait a minute, how do you write it so that the computer will do what you want it to do? I mean, how do you write a
program so that the computer will understand and carry out your instructions? This is where computer-programming languages become important.
Programming Languages: An Overview
Programming
languages have been around for a long time.
Some of the earliest were used for things like player pianos and textile
machines (specifically, piano roles are programs for player pianos). A computer programming language is used to
create inst ructions for the activities you want a computer to perform. So if a programming language was based on a natural language (say English), the
simple program we mentioned above might have the following instructions:
- Display the message
“Hello, World!”
- Display the current date
and time.
If
a computer could execute these instructions “as-is”
– in other words it understood English – you could just create a new file, type
in these instructions, and tell the computer to process the file (i.e. execute the program). On your monitor you would then see the
welcome message followed by the current date and time! Unfortunately, computer programs (at least the
vast majority in use today and the ones we’ll discuss here) are not written in
natural languages; they are written in artificial
programming languages. This is because
computers don’t understand English, they understand the language of computers,
which is to say they live in the land of bits, bytes, registers, instruction
sets, and numerous other things incomprehensible to people who don’t inhabit
the world of Geek! So, in order to write
a computer program you have to learn a new language!
Programming for Everyone is designed to give the reader an introduction to computer programming. The book is
written for a very general audience and focuses on providing you
with a detailed understanding of the basic concepts. It's also
great for programmers who want to learn about other programming
areas (e.g. logic programming, computer graphics, games, etc.) they
may not have experience in. Whatever your age or background, Programming for Everyone will help you to understand computer programming!
No comments:
Post a Comment