Computer Programming

From Canonica AI

Introduction

Computer programming is the process of designing and building an executable computer program to accomplish a specific computing result or to perform a specific task. Programming involves tasks such as analysis, generating algorithms, profiling algorithms' accuracy and resource consumption, and the implementation of algorithms in a chosen programming language (commonly referred to as coding). The source code of a program is written in one or more languages that are intelligible to programmers, rather than machine code, which is directly executable by the central processing unit.

A person typing on a keyboard with lines of code on the computer screen.
A person typing on a keyboard with lines of code on the computer screen.

History of Computer Programming

The earliest known programmable machine that preceded the invention of the digital computer was the automatic flute player described by the Greek engineer Hero in the 1st century AD. In the 1800s, Ada Lovelace is credited with writing the world's first machine algorithm for an early computing machine that existed only on paper. However, the first computer programmer is generally recognized to be a woman named Grace Murray Hopper, who wrote the first compiler in 1952.

An ancient computing machine with gears and levers.
An ancient computing machine with gears and levers.

Programming Languages

A programming language is a formal language comprising a set of instructions that produce various kinds of output. Programming languages are used in computer programming to implement algorithms. There are many programming languages: Python, Java, C++, JavaScript, and Ruby are just a few examples.

Several books with titles of different programming languages.
Several books with titles of different programming languages.

High-Level Languages

High-level languages are designed to be easy to read and understand. They abstract away the complexities of the computer's hardware, giving them a high level of abstraction. Examples of high-level languages include Python, Ruby, and JavaScript.

Low-Level Languages

Low-level languages are closer to the hardware level. They offer more control over the computer's memory and processing, but this comes at the cost of being more complex and difficult to read and write. Examples of low-level languages include Assembly and C++.

Programming Paradigms

A programming paradigm is a style, or “way,” of programming. Some languages are designed to support one paradigm (like Python, which is heavily designed around object-oriented programming), while other programming languages support multiple paradigms (like JavaScript, which is both object-oriented and functional).

A collage of different programming paradigms.
A collage of different programming paradigms.

Procedural Programming

Procedural programming is a programming paradigm, derived from structured programming, based on the concept of the procedure call. Procedures, also known as routines, subroutines, or functions (not to be confused with mathematical functions, but similar to those used in functional programming), simply contain a series of computational steps to be carried out.

Object-Oriented Programming

Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code: data in the form of fields (often known as attributes or properties), and code, in the form of procedures (often known as methods).

Functional Programming

Functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that map values to other values, rather than a sequence of imperative statements which update the running state of the program.

Coding Practices

Good coding practices are a set of informal rules that the software development community has learned over time which can help improve the quality of software. Many of these practices are adopted by the professional software development community, while some are considered to be bad or even harmful.

A checklist of good coding practices.
A checklist of good coding practices.

Code Review

Code review is a software quality assurance activity in which one or several people check a program mainly by viewing and reading parts of its source code, and they do so after implementation or as an interruption of implementation.

Debugging

Debugging is the process of finding and resolving defects or problems within a computer program that prevent correct operation of computer software or a system.

Testing

Software testing is an investigation conducted to provide stakeholders with information about the quality of the software product or service under test. Software testing can also provide an objective, independent view of the software to allow the business to appreciate and understand the risks of software implementation.

See Also