Wikijunior:Programming for Kids/What is Programming?

From Wikibooks, open books for an open world
< Wikijunior:Programming for Kids
Jump to: navigation, search
Wikijunior:Programming for Kids
What is Programming? Knowing Your Problem

We know you're very excited to learn programming! What exactly is programming, though?

How do computers work?[edit]

IPO Diagram.svg

Computers are essentially a system that receives input, processes the data, and outputs the processed inputs. Inputs to a computer system are known as data (singular: datum), and the outputs are known as information.

In order to process data, a computer must receive instructions or commands. However, it would be unfeasible to make the user input commands for everything. Even something as simple as saving a document or opening a browser takes thousands or even millions of lines of code. In response to this problem, stored programs have been invented.

Ada Lovelace

A stored program is a series of instructions stored in a computer's memory. When the program is used, the computer will then fetch each instruction from the stored program and execute it. This process was conceptualised by mathematician Charles Babbage and later implemented by Ada Lovelace, who is Lord Byron's daughter.

High-level programming languages compile to low-level programming languages.

What are high-level and low-level programming languages?[edit]

A low-level programming language is one that is understood by the computer. They include machine code and assembly language, both of which instruct computer hardware components to carry out instructions directly. However, low-level programming languages are difficult to learn and time-consuming to code.

A high-level programming language solves this problem by creating a way for programmers to communicate with the computer easily. High-level programming languages have gentler learning curves and can be very powerful. Good examples of high-level programming languages include C, Java, Smalltalk, PASCAL, Visual Basic and Python. These languages are usually compiled, or converted into low-level programming languages so that they can be executed directly. However, some programming languages are designed to be interpreted by another computer application, such as JavaScript, which is interpreted by web browsers, and PHP, which is interpreted by web servers.

Some high-level programming languages are designed for a specific purpose. JavaScript is for creating dynamic web pages, while ActionScript is responsible for Flash applications. Others are designed for general purpose. For example, Java can create a large number of programs ranging from games to physics simulations, from simple console programs to large-scale commercial software.

What is programming really like?[edit]

Programming is a form of problem-solving. It involves locating your problem, analysing it, designing a framework for the solution, writing the actual code for it, testing your algorithm, and, finally, writing a documentation for it. In this book, we will go through the process one by one. Let's start!