Open main menu

Wikibooks β


Computer Programming

5,088 bytes removed, 14 years ago
Programming Concept Map
==The WikiTextBook on Computer Programming==
Draft 1: The main focus here is to get the concept structure right for now.
==Programming Concepts==
===The scope===
All programming languages share general concepts since they are all roughly designed to manipulate the same device.
Computer programming is the art of writing useful, maintainable, and extensible instructions which can be interpreted by a computing system to perform a hopefully meaningful task that makes life and work more enjoyable and productive for the users of the computing system. Programming a computer can be done in one of several different languages, ranging from machine code to high level langauges.
===Choosing a programming language===
The general trade off between languages is speed vs ease of coding. Writing in machine code, usually through an [[programming:Assembly|assembly language]] but conceivably through a hex editor, can result in the creation of the fastest and most compact program possible, but only if you want to donate years of your life span to creating the program, assuming it will be moderatly complex and you will not be calling code from other higher languages (which you must do if you write a windows program). Assembly language has very exact [[programming:syntax|syntax]] that gets as little done as possible per command, since each command generally corresponds to one or two processor [[programming:opcodes|opcodes]]. High level languages generally have commands that can correspond to dozens of [[programming:opcodes|opcodes]] which can greatly speed up coding, but you have to depend on a compiler to figure how to turn those commands into the fastest running set of opcodes. They tend to do a good job, depending upon the compiler, but they don't do a perfect job, so it will be a little slower. Generally but not always, the easier it is to code, the slower your program will be compiled.
===The popular programming languages===
The most used programming languages are probably C or C++. They are both very similar so if you learn one, you can easily learn the other, but C has a more exact syntax and is faster while C++ allows for more flexibility but will compile more slowly. The difference in speed today isn't very great but it is still an issue, but since the two languages can be mixed on most compilers that isn't a problem.
The second most used are probably Java or Basic. C and C++ compile into an executable that is run directly by the processor. Java and Basic are normally interpreted, so they do not run directly by the processor and for that reason are inherently slow, although several techniques have been used to improve their performance considerably.
Java can be run on many systems relatively unchanged, but the price paid for it is speed. It is slow, but since it can be run on anything it can be used on webpages. Its [[programming:structure|structure]] and [[programming:syntax|syntax]] is similar to C++ so if you know C++ you can easily learn Java.
Basic (or Visual Basic or QBasic) is very easy to program with. It is also slow, but it is still used for many things today in Windows programming just because it is easy.
Assembly is not used that much today, but learning it will greatly help you understand how a computer works and how to better structure high level code. Plus, if you really need speed on a couple often used routines in your program, you can and should use assembly to write them.
Another distinction must be made between [[programming:scripting|scripting]] languages and [[programming:highlevel|very-high-level]] languages and other languages. Scripting languages, like [[programming:Perl|Perl]], [[programming:Python|Python]] and [[programming:Ruby|Ruby]] are interpreted languages that have been designed for speed and ease of coding in performing short tasks, often offering elastic syntax and allowing to shrink complex tasks in just a dozen lines of code. They have been successfully implemented to solve day-to-day problems and not to build up complex, monolithic applications, although there are exceptions (Python-based applications like MayaVi or Zope are a notable example).
[[Currently in Programming|What's New?]]
[[Concepts in Programming|Concepts]]
[[Assembly in Programming|Assembly]]
[[C in Programming|C]]
[[Cpp in Programming|C++]]
[[Java in Programming|Java]]
[[Basic in Programming|Basic]]
[[D in Programming|D]]
[[Delphi in Programming|Delphi]]
[[Pascal in Programming|Pascal]]
[[Python in Programming|Python/Jython]]
[[PHP in Programming|PHP]]
[[Perl in Programming|Perl]]
[[Lisp in Programming|Lisp/Scheme]]
[[Prolog in Programming|Prolog]]
[[Ruby in Programming|Ruby]]
[[SQL in Programming|SQL]]
General Algorithms and Techniques
[[AI in Programming|AI]]
[[Applications in Programming|Applications]]
[[Database Programming in Programming|Databases]]
[[Drivers in Programming|Drivers]]
[[Games in Programming|Games]]
[[2D in Games in Programming|2D]]
[[3D in Games in Programming|3D]]
[[Side Scrolling in Games in Programming|Side Scrolling]]
[[Networks in Programming|Internet & Networking]]
[[Multimedia in Programming|Multimedia]]
[[OS in Programming|OS]]
[[OS Programming in Programming|OS Programming]]
[[DOS Programming in Programming|DOS]]
[[Linux Programming in Programming|Linux]]
[[MacOS Programming in Programming|MacOS]]
[[Windows Programming in Programming|Windows]]
Popular Libraries
[[Allegro in Programming|Allegro]]
[[DirectX in Programming|DirectX]]
[[FreeType in Programming|FreeType2]]
[[IJG in Programming|IJG JPEG Library]]
[[LibPng in Programming|LibPng]]
[[OpenGL in Programming|OpenGL]]
Format Reference
[[RTF in Programming|Rich Text Format]]
[[Programming Authors|Authors]]<br>
[[Programming Authoring Tools|Authoring Tools]]<br>
[[Programming Authoring Guidelines|Authoring Guidelines]]
'''Old: Will be Deleted Very Soon after old stuff (not much) has been transfered'''<br>
[[Computer programming|Main Table of Contents]]<br>
'''Soon deletion of the old pages will be requested'''
[[Programming Authors|Authors]]
[[programming:current|What's New?]]
General Algorithms and Techniques
[[programming:Side Scrolling|Side Scrolling]]
[[programming:networks|Internet & Networking]]
[[programming:Programming an OS|Programming an OS]]
Popular Libraries
[[programming:IJG JPEG Library|IJG JPEG Library]]
Format Reference
[[programming:RTF|Rich Text Format]]
Concept Map
[[programming:Tools|Authoring Tools]]<br>
[[Variables in Programming|Variables]]
[[programming:Guidelines|Authoring Guidelines]]
[[Variable Types in Programming|Types]]
[[Variable Arrays in Programming|Arrays]]
[[Control Statements in Programming|Program Flow]]
[[Control Statement if in Programming|if]]
[[Control Statement for in Programming|for]]
[[Control Statement break in Programming|break]]
[[Control Statement do...while in Programming|do...while]]
[[Control Statement while in Programming|while]]
[[Control Statement goto in Programming|goto]]
[[Control Statement forever in Programming|forever]]
[[Control Statement switch in Programming|switch]]
[[Control Statement contracts and assert in Programming|contracts and assert]]
[[Math in Programming|Mathematical Calculations]]
[[Basic Arithmetic in Programming|Basic Arithmetic]] (note: add, subtract, divide, multiply)
[[Advanced Arithmetic in Programming|Advanced Arithmetic]] (note: exp, roots, sin, cos, ...)
[[Math Reference in Programming|Math Reference]] (note: links to tables with precidences, operators, and math functions listed)
[[Procedures and Functions in Programming|Procedures and Functions]]
[[Function Overloading in Programming|Overloading]]
[[Structured Programming|Programming Structure and Style]]
[[String Manipulation in Programming|String Manipulation]]
[[Input and Output in Programming|Input and Output]]
[[Console Input and Output in Programming|Console]]
[[File Input and Output in Programming|Files]]
[[Memory Management in Programming|Memory Management]]
[[Stack Memory in Programming|Stack]]
[[Heap Memory in Programming|Heap]]
[[Registers in Programming|Registers]]
[[Cache Memory in Programming|Cache]]
[[Errors in Programming|Error Catching]]
[[Object Orientation in Programming|Object Oriented Programming]]
[[Language Overloading and Extensions in Programming|Language Overloading and Extensions]]
[[Operator Overloading in Programming|Operators]]
[[Libaries in Programming|Libraries]]
[[Combining Languages in Programming|Combining Languages]]