Flux rss

Program structure

Programming languagesAPI / Framework

How does a computer program work?

A program's behaviour depends on the type of language used to write the program.

Nonetheless, almost all programming languages are based upon the same principle:
The program consists of a set of commands that the computer must execute. The computer executes the commands as it reads the file (from top to bottom) until it reaches a command (often referred to as a branch command) which tells the computer to go to a specific location in the program. In a way it resembles a treasure hunt where the computer must follow the clues and execute commands until it reaches the end of the program and is stopped.

The concept of variables

Variables are used in most languages, where a name is associated with content. For example, we can call a variable "dummy" and assign it the value 8.

Data types

Some languages allow you to associate any data type to a variable (either a whole number or a character), such a language is called a non-typed language.
As can be seen in the chapter data representation, the type of data sets the number of bytes that the data is coded in, i.e. the amount of memory that this data takes up as well as the format in which it is represented.
For this reason evolved languages (C, Java) are typed languages, meaning that a variable is not only associated with a name but also a data type, which should be specified when declaring the variable, i.e. when the variable name is written for the first time you must specify in the compiler the type of data this variable will contain (the method of declaring the variable depends on the language used).

Syntax

Programming languages require strict syntax, you cannot simply write things as you wish.

Thus, some languages are case sensitive, meaning that a name written in lower case is not considered to be the equivalent of the same name written in upper case. So the variable "Dummy" is different to the variable "dummy".

Variable names usually require a maximum length (depending on the language) and a certain character set, where the following characters are generally used:

abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1234567890_ 

So a space (" ") is therefore considered a different type of character, called a special character. It is therefore not very common for a language to allow the use of special characters in variable names!

Reserved words

In most languages there are a handful of words that may not be used as variable names, these are called reserved words. These are specified in the chapter corresponding to the specific language.

Constants

A constant is data type whose value cannot be modified. These are generally defined at the beginning of the program. The value of the constant may be of any type permitted by the programming language.

Comments

It is useful when writing a program to be able to add lines of text that the compiler does not treat as code. These lines of text are usually preceded (or enclosed) by special commands which tell the compiler to ignore them.

Comments are used to clarify how the program is written by explaining parts of the code. Comments are useful if another person is trying to understand how the program works by reading the source file, or even, if the person who wrote the program is reading the source file again some years after having originally written the code.

Last update on Thursday October 16, 2008 02:43:20 PM.

This document entitled « Program structure » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.

Results for Program structure

Download Primitive Disk Indexer To stock and/or to safeguard data on his hard disk or of detachable disks is good means to lose nothing. But when they pile up, it is rather difficult to meet there. Primitive Disk Indexer is a program allowing to safeguard the structure of your... en.kioskea.net/telecharger/telecharger-626-primitive-disk-indexer
Databases - Introduction A database (abbreviated DB) is an entity in which data can be stored in a structured manner, with as little redundancy as possible. Different programs and different users must be able to use this data. Therefore, the concept of a database is... en.kioskea.net/bdd/bddintro.php3
[Pascal language] Recursion within a Bubble Sort [Pascal language] Recursion within a Bubble Sort Pascal is a stable, efficient and block-structured programming language. The "type" of variables used in Pascal language is made up of its semantic nature and its range of values, and can be... en.kioskea.net/faq/sujet-880-pascal-language-recursion-within-a-bubble-sort

Results for Program structure

Nintendo DS Homebrews and ProgrammingNintendo DS Homebrews and Programming *SLOT-1 and SLOT-2 devices *System Files *Homebrew Games and Tools *Nintendo DS programming Nintendo DS homebrew is a software that has been developed by a group of home users and uses... en.kioskea.net/faq/sujet-237-nintendo-ds-homebrews-and-programming
The Add/Remove Programs icon is missing in Control PanelThe Add/Remove Programs icon is missing in Control Panel When trying to add a program on your computer system, you suddenly noticed that the specific icon is missing. This can be due to Appwiz.cpl missing or damaged. This applet... en.kioskea.net/faq/sujet-465-the-add-remove-programs-icon-is-missing-in-control-panel
A freeware is an open-source programA freeware is an open-source program Myth: a freeware is an open-source program Links: Myth: a freeware is an open-source program Truth: A freeware is a program or software on which the author has a copyright on and has decided to... en.kioskea.net/faq/sujet-383-a-freeware-is-an-open-source-program

Results for Program structure

Remove program listing from right click menu.Hello, I would like to remove an option from the list of programs that show up in the right click/open with/choose default programs/other programs. Running Vista. I know there is no real reason for this other than being REALLY OCD! If anyone can help ... en.kioskea.net/forum/affich-10500-remove-program-listing-from-right-click-menu
Install volume control programmeHello, install volume control programme, This command is showing when trying to bring the symbol in taskbar through control panel en.kioskea.net/forum/affich-21662-install-volume-control-programme

Results for Program structure

Download ProgDVBThe broadcasting of program in numerical is more and more fashionable since the appearance of connection high - debit side. ProgDVB is a program intended to look at chains TV and to listen to stations radio on your computer.It supports DVB-S... en.kioskea.net/telecharger/telecharger-722-progdvb
Download The Money ProgramThe Money Program is a software of financial management conceived for a particular usage. Easy and powerful, it allows to make a monitoring and an analysis of the movement of silver. Application allows a recording of regular transactions from several... en.kioskea.net/telecharger/telecharger-1192-the-money-program
Download Star Bill of Lading ProgramStar Bill of Lading Program is a billing software. Easy and rapid application provides a fully customizable and configurable. Simply fill out the forms manually and the invoice is ready. In addition, the bill may include the following information: the... en.kioskea.net/telecharger/telecharger-1419-star-bill-of-lading-program

Results for Program structure

Microsoft sues over brand in Dutch programme curbing kids on InternetMicrosoft offices in Herndon, Virginia. Microsoft is suing a company run by a Dutch mother because it had started using a Microsoft domain title in computer programmes aimed at curbing children's use of the Internet. Software company Microsoft... en.kioskea.net/actualites/microsoft-sues-over-brand-in-dutch-programme-curbing-kids-on-internet-10303-actualite.php3

Results for Program structure

Programming languages - Introduction A "programming language" is a language designed to describe a set of consecutive actions to be executed by a computer. A programming language is therefore a practical way for us (humans) to give instructions to a computer. On the other hand, the... en.kioskea.net/langages/langages.php3
Introduction to object-oriented programming - Encapsulation Encapsulation is a way of organising data and methods into a structure by concealing the the way the object is implemented, i.e. preventing access to data by any means other than those specified. Encapsulation therefore guarantees the integrity of... en.kioskea.net/poo/encapsul.php3
Programming languages - Characteristics There are many programming languages, each corresponding to specific needs (formula calculus, character string processing, real-time, etc.) with each having specific characteristics and functionalities. Therefore, the choice of programming language... en.kioskea.net/langages/langage-caracteristiques.php3