An Introduction to Programming
Created | Updated Mar 5, 2015
This is an introduction to the concept of programming, but to start with we
are going to see what programming actually is.
What is Programming?
When your programming your basically trying to tell a computer what you
want it to do. This isn't as easy as it sounds, it is basically like trying
to tell a very logical Alien who knows no English how to make a cup of tea, when they have no
starting concept of tea, cups, sugar, milk, water, kettles, their arms,
hands or eyes. But so long as you explain clearly and methodically what to do, what things are
and how they work you can get the cup of tea. But if you are unclear or ambiguous you could end up with a
kitchen awash with tepid water and possibly a dead Alien.
What is Programming for?
Literally
Good question! Well look at it this way, it's for explaining to
the computer what you want to use it for, and how to do it.
In other words, programming is used to explain to a computer in terms
it understands, exactly what you want it to do, to what variable and the nature of the variable.
In terms of the tea making Alien, Programming is used to define
the following:
1) What data is involved and what the data is. [ Variables]
(e.g. cup, kettle, water, tea, sugar, milk, visual input, arm, hand)
2) What is the process of the program, in other words, what series of
events happens (i.e. what series of instructions to execute), in what case, and in what order. [ IF statements, programming Loops,
Variable Manipulation]
(e.g. Put water in Kettle, Turn on Kettle, put tea in cup, put sugar in
cup, when water boiled put in cup, add milk, remove tea )
Use
Now use of programming is different, there are a couple of things it can
be mainly used for:
1) Programming is used to apply the strengths of computing to problems in the real world, so inevitably,
it requires the converting of aspects of the real world into logical concepts and proceedures.
This is not as hard as it sounds!
The following is a program in natural language:
[STEP 1] The postman goes to the gate of each house.
[STEP 2] If there is a letter for the house he goes to the door and posts the letter through the letter box.
[STEP 3] If there is no letter for the house, he goes to the next house.
[STEP 4] This continues until there are no more letters for the street.
This in fact displays 2 of the main concepts in programming IF statements and Loops.
2) To apply computers to unreal or theoretical problems, or appllications. This can effectively
be looked at as everything else, or as whatever you can think of to apply a computer to.
Why are there Programming Languages? Why can't it be written in natural language?
There is a good reason for this, computers deal with data in a fundemental way, move it here,
move it there, add 2 to it, that sort of thing. And so it would take alot of complex and unneccesery
code to explain to it the meaning of the English language, or any language for that matter.
So programming languages are a bridge between human language and thought, and what happens in the
artificial "mind"esq construct of the computer. The programming language has to be understandable
to the programmer, but after the compiler has turned it into computer
code1 it must be as small as possible to run2 effectively.
High Level Languages [Closer to Human Language than Computer Language]
The C Programming LanguageThe Java Programming Language
Low Level Languages [Closer to Computer Language than Human Language]
Assembly LanguageWhat is Programming used for?
Well it depends on what people want to use it for, but it can be used for the following examples, but really the uses are only limited by developers imagination:
- To Create Systems to Deal with Repetitive Tasks
- To Create Systems to help Organise Company Data
- To Create Expert Systems(e.g. Diagnosis Programs, computerised researchers, etc)
- Amusement, in fact there is a mind boggeling amount of computing used for amusement, from web sites,
the internet, arcade games, VR consoles, Web Radio, TV, Games Consoles. and simulators of all varieties. - Applications, now by this I mean tools and resources, for example Word Processors, and the whole H2G2 site.
- Invisables, this is rather a blanket term, it covers everything that doesn't say "Hello! I'm a Computer", it
includes things you might expect (e.g. Video Recorders, Robots) and some things you wouldn't (e.g. Washing machines,
fridges, and even pens [in the case of digital voice recording pens]). Now although these all include programming,
mainly compiled onto chips and wired into an electronic circuit. Now these programs stetch from very simple (e.g.
Keep the fridge cold) to mind bogglingly complex (e.g. work out the 3D location of an object, based on a pattern
identifier working from images from 2 differently positioned camera, and then move a robotic arm to meet the object).
actually performs its function.