You are on page 1of 12

Computer programming - Wikipedia, the free enc...

http://en.wikipedia.org/wiki/Computer_programming

Computer programming
From Wikipedia, the free encyclopedia

Computer programming (often shortened to programming, scripting, or coding) is the process of designing, writing, testing, debugging, and maintaining the source code of computer programs. This source code is written in one or more programming languages (such as C++, C#, Java, Python, Smalltalk, etc.). The purpose of programming is to create a set of instructions that computers use to perform specic operations or to exhibit desired behaviors. The process of writing source code often requires expertise in many dierent subjects, including knowledge of the application domain, specialized algorithms and formal logic. Within software engineering, programming (the implementation) is regarded as one phase in a software development process. There is an ongoing debate on the extent to which the writing of programs is an [1] art form, a craft, or an engineering discipline. In general, good programming is considered to be the measured application of all three, with the goal of producing an ecient and evolvable software solution (the criteria for "ecient" and "evolvable" vary considerably). The discipline diers from many other technical professions in that programmers, in general, do not need to be licensed or pass any standardized (or governmentally regulated) certication tests in order to call themselves "programmers" or even "software engineers." Because the discipline covers many areas, which may or may not include critical applications, it is debatable whether licensing is required for the profession as a whole. In most cases, the discipline is self-governed by the entities which require the programming, and sometimes very strict environments are dened (e.g. United States Air Force use of AdaCore and security clearance). However, representing oneself as a "Professional Software Engineer" without a license from an accredited institution is illegal in many parts of the world. Another ongoing debate is the extent to which the programming language used in writing computer programs aects the form that the nal program takes. This [2] debate is analogous to that surrounding the SapirWhorf hypothesis in linguistics and cognitive science, which postulates that a particular spoken language's nature inuences the habitual thought of its speakers. Dierent language patterns yield dierent patterns of thought. This idea challenges the possibility of representing the world perfectly with language, because it acknowledges that the mechanisms of any language condition the thoughts of its speaker community.

Contents
1 of 12 03/27/2013 09:50 PM

Computer programming - Wikipedia, the free enc...

http://en.wikipedia.org/wiki/Computer_programming

1 History 2 Modern programming 2.1 Quality requirements 2.2 Readability of source code 2.3 Algorithmic complexity 2.4 Methodologies 2.5 Measuring language usage 2.6 Debugging 3 Programming languages 4 Programmers 5 See also 6 References 7 Further reading 8 External links

History
See also: History of programming languages Ancient cultures had no conception of computing beyond simple arithmetic. The only mechanical device that existed for numerical computation at the beginning of human history was the abacus, invented in Sumeria circa 2500 BC. Later, the Antikythera mechanism, invented some time around 100 BC in ancient Greece, was the rst mechanical calculator utilizing gears of various [3] sizes and conguration to perform calculations, which tracked the metonic cycle still used in lunarto-solar calendars, and which is consistent for [4] calculating the dates of the Olympiads. The Kurdish medieval scientist Al-Jazari built programmable Automata in 1206 AD. One system employed in these devices was the use of pegs and cams placed into a wooden drum at specic locations, which would sequentially trigger levers that in turn operated percussion instruments. The output of this device was a small drummer playing [5][6] The various rhythms and drum patterns. Jacquard Loom, which Joseph Marie Jacquard developed in 1801, uses a series of pasteboard

Ada Lovelace created the rst algorithm designed for processing by a computer and is usually recognized as history's rst computer programmer.

2 of 12

03/27/2013 09:50 PM

Computer programming - Wikipedia, the free enc...

http://en.wikipedia.org/wiki/Computer_programming

cards with holes punched in them. The hole pattern represented the pattern that the loom had to follow in weaving cloth. The loom could produce entirely dierent weaves using dierent sets of cards. Charles Babbage adopted the use of punched cards around 1830 to control his Analytical Engine. The rst computer program was written for the Analytical Engine by mathematician Ada Lovelace to calculate [7] a sequence of Bernoulli numbers. The synthesis of numerical calculation, predetermined operation and output, along with a way to organize and input instructions in a manner relatively easy for humans to conceive and produce, led to the modern development of computer programming. Development of computer programming accelerated through the Industrial Revolution. In the 1880s, Herman Hollerith invented the recording of data on a medium that could then be read by a machine. Prior uses of machine readable media, above, had been for lists of instructions (not data) to drive programmed machines such as Jacquard looms and mechanized musical instruments. "After some initial trials with paper [8] tape, he settled on punched cards..." To process these punched cards, rst known as "Hollerith cards" he invented the keypunch, sorter, and [9] tabulator unit record machines. These inventions were the foundation of the data processing industry. In 1896 he founded the Tabulating Machine Company (which later became the core of Data and instructions were IBM). The addition of a control panel (plugboard) once stored on external to his 1906 Type I Tabulator allowed it to do punched cards, which were dierent jobs without having to be physically kept in order and arranged in rebuilt. By the late 1940s, there were several unit program decks. record calculators, such as the IBM 602 and IBM 604, whose control panels specied a sequence (list) of operations and thus were programmable machines. The invention of the von Neumann architecture allowed computer programs to be stored in computer memory. Early programs had to be painstakingly crafted using the instructions (elementary operations) of the particular machine, often in binary notation. Every model of computer would likely use dierent instructions (machine language) to do the same task. Later, assembly languages were developed that let the programmer specify each instruction in a text format, entering abbreviations for each operation code instead of a number and specifying addresses in symbolic form (e.g., ADD X, TOTAL). Entering a program in assembly language is usually more convenient, faster, and less prone to human error than using machine language, but because an assembly language is little more than a dierent notation for a machine language, any two machines with dierent instruction sets also have dierent assembly languages.

3 of 12

03/27/2013 09:50 PM

Computer programming - Wikipedia, the free enc...

http://en.wikipedia.org/wiki/Computer_programming

Some of the earliest computer programmers were women during World War II. According to Dr. Sadie Plant, programming is essentially feminine-not simply because women, from Ada Lovelace to Grace Hopper, were the rst programmers, but because of the historical and theoretical ties between programming and what Freud called the quintessentially feminine invention of weaving, between female sexuality as mimicry and the mimicry grounding Turing's vision of computers as universal machines. Women, Plant argues, have not merely had a minor part to play in the emergence of digital machines...Theirs is not a subsidiary role which needs to be rescued for posterity, a small supplement whose inclusion would set the existing records straight...Hardware, software, wetware-before their beginnings and beyond their ends, women have been the simulators, assemblers, [10] and programmers of the digital machines. In 1954, FORTRAN was invented; it was the rst high level programming language to have a functional implementation, as opposed to just a [11][12] (A high-level language is, in design on paper. very general terms, any programming language that allows the programmer to write programs in terms that are more abstract than assembly language instructions, i.e. at a level of abstraction "higher" than that of an assembly language.) It allowed programmers to specify calculations by Wired control panel for an entering a formula directly (e.g. IBM 402 Accounting Y = X*2 + 5*X + 9). The program text, or source, Machine. is converted into machine instructions using a special program called a compiler, which translates the FORTRAN program into machine language. In fact, the name FORTRAN stands for "Formula Translation". Many other languages were developed, including some for commercial programming, such as COBOL. Programs were mostly still entered using punched cards or paper tape. (See computer programming in the punch card era). By the late 1960s, data storage devices and computer terminals became inexpensive enough that programs could be created by typing directly into the computers. Text editors were developed that allowed changes and corrections to be made much more easily than with punched cards. (Usually, an error in punching a card meant that the card had to be discarded and a new one punched to replace it.) As time has progressed, computers have made giant leaps in the area of processing power. This has brought about newer programming languages that are more abstracted from the underlying hardware. Popular programming languages of the modern era include ActionScript, C++, C#, Haskell, HTML with PHP , Java, JavaScript, Objective-C, Perl, Python, Ruby, Smalltalk, SQL, Visual Basic, and [13] Although these high-level languages usually incur greater dozens more. overhead, the increase in speed of modern computers has made the use of these

4 of 12

03/27/2013 09:50 PM

Computer programming - Wikipedia, the free enc...

http://en.wikipedia.org/wiki/Computer_programming

Modern programming languages like C++ are exponentially more powerful than their predecessors.

languages much more practical than in the past. These increasingly abstracted languages typically are easier to learn and allow the programmer to develop applications much more eciently and with less source code. However, high-level languages are still impractical for a few programs, such as those where low-level hardware control is necessary or where maximum processing speed is vital. Computer programming has become a popular career in the developed world, particularly in the United States, Europe, and Japan. Due to the high labor cost of programmers in these countries, some forms of programming have been increasingly subject to oshore outsourcing (importing software and services from other countries, usually at a lower wage), making programming career decisions in developed countries more complicated, while increasing economic opportunities for programmers in less developed areas, particularly China and India.

Modern programming
Quality requirements
Whatever the approach to software development may be, the nal program must satisfy some fundamental properties. The following properties are among the most relevant: Reliability: how often the results of a program are correct. This depends on conceptual correctness of algorithms, and minimization of programming mistakes, such as mistakes in resource management (e.g., buer overows and race conditions) and logic errors (such as division by zero or o-by-one errors). Robustness: how well a program anticipates problems not due to programmer error. This includes situations such as incorrect, inappropriate or corrupt data, unavailability of needed resources such as memory, operating system services and network connections, and user error. Usability: the ergonomics of a program: the ease with which a person can use the program for its intended purpose, or in some cases even unanticipated purposes. Such issues can make or break its success even regardless of other issues. This involves a wide range of textual, graphical and sometimes hardware elements that improve the clarity, intuitiveness, cohesiveness and completeness of a program's user interface. Portability: the range of computer hardware and operating system platforms on which the source code of a program can be compiled/interpreted and run. This depends on dierences in the

5 of 12

03/27/2013 09:50 PM

Computer programming - Wikipedia, the free enc...

http://en.wikipedia.org/wiki/Computer_programming

programming facilities provided by the dierent platforms, including hardware and operating system resources, expected behaviour of the hardware and operating system, and availability of platform specic compilers (and sometimes libraries) for the language of the source code. Maintainability: the ease with which a program can be modied by its present or future developers in order to make improvements or customizations, x bugs and security holes, or adapt it to new environments. Good practices during initial development make the dierence in this regard. This quality may not be directly apparent to the end user but it can signicantly aect the fate of a program over the long term. Eciency/performance: the amount of system resources a program consumes (processor time, memory space, slow devices such as disks, network bandwidth and to some extent even user interaction): the less, the better. This also includes correct disposal of some resources, such as cleaning up temporary les and lack of memory leaks.

Readability of source code


In computer programming, readability refers to the ease with which a human reader can comprehend the purpose, control ow, and operation of source code. It aects the aspects of quality above, including portability, usability and most importantly maintainability. Readability is important because programmers spend the majority of their time reading, trying to understand and modifying existing source code, rather than writing new source code. Unreadable code often leads to bugs, ineciencies, and [14] found that a few simple readability transformations duplicated code. A study made code shorter and drastically reduced the time to understand it. Following a consistent programming style often helps readability. However, readability is more than just programming style. Many factors, having little or nothing to do with the ability of the computer to eciently compile and execute [15] Some of these factors include: the code, contribute to readability. Dierent indentation styles (whitespace) Comments Decomposition Naming conventions for objects (such as variables, classes, procedures, etc.) Various visual programming languages have also been developed with the intent to resolve readability concerns by adopting non-traditional approaches to code structure and display.

Algorithmic complexity

6 of 12

03/27/2013 09:50 PM

Computer programming - Wikipedia, the free enc...

http://en.wikipedia.org/wiki/Computer_programming

The academic eld and the engineering practice of computer programming are both largely concerned with discovering and implementing the most ecient algorithms for a given class of problem. For this purpose, algorithms are classied into orders using so-called Big O notation, which expresses resource use, such as execution time or memory consumption, in terms of the size of an input. Expert programmers are familiar with a variety of well-established algorithms and their respective complexities and use this knowledge to choose algorithms that are best suited to the circumstances.

Methodologies
The rst step in most formal software development processes is requirements analysis, followed by testing to determine value modeling, implementation, and failure elimination (debugging). There exist a lot of diering approaches for each of those tasks. One approach popular for requirements analysis is Use Case analysis. Nowadays many programmers use forms of Agile software development where the various stages of formal software development are more integrated together into short cycles that take a few weeks rather than years. There are many approaches to the Software development process. Popular modeling techniques include Object-Oriented Analysis and Design (OOAD) and Model-Driven Architecture (MDA). The Unied Modeling Language (UML) is a notation used for both the OOAD and MDA. A similar technique used for database design is Entity-Relationship Modeling (ER Modeling). Implementation techniques include imperative languages (object-oriented or procedural), functional languages, and logic languages.

Measuring language usage


It is very dicult to determine what are the most popular of modern programming languages. Some languages are very popular for particular kinds of applications (e.g., COBOL is still strong in the corporate data [citation needed] , often on large mainframes, FORTRAN in engineering center applications, scripting languages in Web development, and C in embedded applications), while some languages are regularly used to write many dierent kinds of applications. Also many applications use a mix of several languages in their construction and use. New languages are generally designed around the syntax of a previous language with new functionality added (for example C++ adds object-orientedness to C, and Java adds memory management and bytecode to C++). Methods of measuring programming language popularity include: counting the

7 of 12

03/27/2013 09:50 PM

Computer programming - Wikipedia, the free enc...

http://en.wikipedia.org/wiki/Computer_programming

number of job advertisements that mention the language,[16] the number of books sold and courses teaching the language (this overestimates the importance of newer languages), and estimates of the number of existing lines of code written in the language (this underestimates the number of users of business languages such as COBOL).

Debugging
Debugging, is a very important task in the software development process since having defects in a program can have signicant consequences for its users. Some languages are more prone to some kinds of faults because their specication does not require compilers to perform as much checking as other languages. Use of a static code analysis tool can help detect some possible problems. Debugging is often done with IDEs like Eclipse, Kdevelop, NetBeans, Code::Blocks, and Visual Studio. Standalone debuggers like gdb are also used, and these often provide less of a visual environment, usually using a command line.
The bug from 1947 which is at the origin of a popular (but incorrect) etymology for the common term for a software defect.

Programming languages
Main articles: Programming language and List of programming languages Dierent programming languages support dierent styles of programming (called programming paradigms). The choice of language used is subject to many considerations, such as company policy, suitability to task, availability of third-party packages, or individual preference. Ideally, the programming language best suited for the task at hand will be selected. Trade-os from this ideal involve nding enough programmers who know the language to build a team, the availability of compilers for that language, and the eciency with which programs written in a given language execute. Languages form an approximate spectrum from "low-level" to "high-level"; "low-level" languages are typically more machine-oriented and faster to execute, whereas "high-level" languages are more abstract and easier to use but execute less quickly. It is usually easier to code in "high-level" languages than in "low-level" ones. Allen Downey, in his book How To Think Like A Computer Scientist, writes: The details look dierent in dierent languages, but a few basic instructions appear in just about every language:

8 of 12

03/27/2013 09:50 PM

Computer programming - Wikipedia, the free enc...

http://en.wikipedia.org/wiki/Computer_programming

input: Gather data from the keyboard, a le, or some other device. output: Display data on the screen or send data to a le or other device. arithmetic: Perform basic arithmetical operations like addition and multiplication. conditional execution: Check for certain conditions and execute the appropriate sequence of statements. repetition: Perform some action repeatedly, usually with some variation. Many computer languages provide a mechanism to call functions provided by libraries such as in a .so. Provided the functions in a library follow the appropriate run time conventions (e.g., method of passing arguments), then these functions may be written in any other language.

Programmers
Main article: Programmer See also: Software developer and Software engineer Computer programmers are those who write computer software. Their jobs usually involve: Coding Compilation Debugging Documentation Integration Maintenance Requirements analysis Software architecture Software testing Specication

See also
Main article: Outline of computer programming ACCU Association for Computing Machinery computer networking computer programming in the punch card era computer science

9 of 12

03/27/2013 09:50 PM

Computer programming - Wikipedia, the free enc...

http://en.wikipedia.org/wiki/Computer_programming

computing Hello world program Institution of Analysts and Programmers programming paradigms software engineering system programming The Art of Computer Programming

References
1. ^ Paul Graham (2003). Hackers and Painters (http://www.paulgraham.com /hp.html) . Retrieved 2006-08-22. 2. ^ Kenneth E. Iverson, the originator of the APL programming language, believed that the SapirWhorf hypothesis applied to computer languages (without actually mentioning the hypothesis by name). His Turing award lecture, "Notation as a tool of thought", was devoted to this theme, arguing that more powerful notations aided thinking about computer algorithms. Iverson K.E.,"Notation as a tool of thought (http://elliscave.com/APL_J/tool.pdf) ", Communications of the ACM, 23: 444-465 (August 1980). 3. ^ "Ancient Greek Computer's Inner Workings Deciphered (http://news.nationalgeographic.com /news/2006/11/061129-ancientgreece.html) ". National Geographic News. November 29, 2006. 4. ^ Freeth, Tony; Jones, Alexander; Steele, John M.; Bitsakis, Yanis (July 31, 2008). "Calendars with Olympiad display and eclipse prediction on the Antikythera Mechanism" (http://www.nature.com/nature/journal /v454/n7204/full/nature07130.html) . Nature 454 (7204): 614617. doi:10.1038/nature07130 (http://dx.doi.org /10.1038%2Fnature07130) . PMID 18668103
10 of 12

5.

6.

7.

8.

9.

10.

11.

(//www.ncbi.nlm.nih.gov/pubmed /18668103) . ^ A 13th Century Programmable Robot (http://www.shef.ac.uk/marcoms /eview/articles58/robot.html) , University of Sheeld ^ Fowler, Charles B. (October 1967). "The Museum of Music: A History of Mechanical Instruments". Music Educators Journal (Music Educators Journal, Vol. 54, No. 2) 54 (2): 4549. doi:10.2307/3391092 (http://dx.doi.org /10.2307%2F3391092) . JSTOR 3391092 (http://www.jstor.org /stable/3391092) ^ Fuegi, J.; Francis, J. (2003). "Lovelace & babbage and the creation of the 1843 'notes'". IEEE Annals of the History of Computing 25 (4): 16. doi:10.1109/MAHC.2003.1253887 (http://dx.doi.org /10.1109%2FMAHC.2003.1253887) . ^ "Columbia University Computing History - Herman Hollerith" (http://www.columbia.edu/acis/history /hollerith.html) . Columbia.edu. http://www.columbia.edu/acis/history /hollerith.html. Retrieved 2010-04-25. ^ U.S. Census Bureau: The Hollerith Machine (http://www.census.gov /history/www/innovations/technology /the_hollerith_tabulator.html) ^ Chun, Wendy. "On Software, or the Persistence of Visual Knowledge." Grey Room 18. Boston: 2004, pgs. 34-35 ^ 12:10 p.m. ET (2007-03-20).
03/27/2013 09:50 PM

Computer programming - Wikipedia, the free enc...

http://en.wikipedia.org/wiki/Computer_programming

"Fortran creator John Backus dies Tech and gadgets- msnbc.com" (http://www.msnbc.msn.com /id/17704662/) . MSNBC. http://www.msnbc.msn.com /id/17704662/. Retrieved 2010-04-25. 12. ^ "CSC-302 99S : Class 02: A Brief History of Programming Languages" (http://www.math.grin.edu/~rebelsky /Courses/CS302/99S/Outlines /outline.02.html) . Math.grin.edu. http://www.math.grin.edu/~rebelsky /Courses/CS302/99S/Outlines /outline.02.html. Retrieved 2010-04-25. 13. ^

14. ^ James L. Elsho , Michael Marcotty, Improving computer program readability to aid modication, Communications of the ACM, v.25 n.8, p.512-521, Aug 1982. 15. ^ Multiple (wiki). "Readability". Docforge. http://docforge.com /wiki/Readability. Retrieved 2010-01-30. 16. ^ Survey of Job advertisements mentioning a given language (http://www.computerweekly.com /Articles/2007/09/11/226631 /sslcomputer-weekly-it-salary-surveynance-boom-drives-it-job.htm)

Further reading
A.K. Hartmann, Practical Guide to Computer Simulations (http://www.worldscibooks.com/physics/6988.html) , Singapore: World Scientic (2009) A. Hunt, D. Thomas, and W. Cunningham, The Pragmatic Programmer. From Journeyman to Master, Amsterdam: Addison-Wesley Longman (1999) Brian W. Kernighan, The Practice of Programming, Pearson (1999) Weinberg, Gerald M., The Psychology of Computer Programming, New York: Van Nostrand Reinhold

External links
Software engineering (http://www.dmoz.org/Computers/Software /Software_Engineering//) at the Open Directory Project Programming Wikia (http://programming.wikia.com/wiki/Main_Page) How to Think Like a Computer Scientist (http://openbookproject.net/thinkcs) - by Jerey Elkner, Allen B. Downey and Chris Meyers Retrieved from "http://en.wikipedia.org /w/index.php?title=Computer_programming&oldid=547284093" Categories: Computer programming This page was last modied on 27 March 2013 at 16:01. Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.

11 of 12

03/27/2013 09:50 PM

Computer programming - Wikipedia, the free enc...

http://en.wikipedia.org/wiki/Computer_programming

Wikipedia is a registered trademark of the Wikimedia Foundation, Inc., a non-prot organization.

12 of 12

03/27/2013 09:50 PM

You might also like