kai-qu / notation

Collection of quotes on notation design & how it affects thought.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Programming

roblogic opened this issue · comments

Computer programming languages are notations that codify (pseudo) English into machine instructions.

"...programming is an attempt to compensate for the strictly limited size of our skulls. The people who are best at programming are the people who realize how small their brains are. They are humble."
--Steve McConnell, Code Complete

Ada

Ada was originally designed for the United States Department of Defense (DoD) from 1977 to 1983 to supersede over 450 programming languages used by the DoD at that time. Ada was named after Ada Lovelace (1815–1852), who has been credited with being the first computer programmer.

ASM, or Assembly language

An assembly language, often abbreviated asm, is any low-level programming language, in which there is a very strong (but often not one-to-one) correspondence between the assembly program statements and the architecture's machine code instructions. Each assembly language is specific to a particular computer architecture.

A program written in assembly language consists of a series of mnemonic processor instructions and meta-statements (known variously as directives, pseudo-instructions and pseudo-ops), comments and data. Assembly language instructions usually consist of an opcode mnemonic followed by a list of data, arguments or parameters.[7] These are translated by an assembler into machine language instructions that can be loaded into memory and executed.

For example, the instruction below tells an x86/IA-32 processor to move an immediate 8-bit value into a register. The binary code for this instruction is 10110 followed by a 3-bit identifier for which register to use. The identifier for the AL register is 000, so the following machine code loads the AL register with the data 01100001.

10110000 01100001

This binary computer code can be made more human-readable by expressing it in hexadecimal as follows.

B0 61

Here, B0 means 'Move a copy of the following value into AL', and 61 is a hexadecimal representation of the value 01100001, which is 97 in decimal. Assembly language for the 8086 family provides the mnemonic MOV (an abbreviation of move) for instructions such as this, so the machine code above can be written as follows in assembly language, complete with an explanatory comment if required, after the semicolon. This is much easier to read and to remember.

MOV AL, 61h       ; Load AL with 97 decimal (61 hex)

BASIC

http://time.com/69316/basic/

In June 1964 [BASIC] became generally available to Dartmouth students, initially on 11 Teletype machines. The first version of BASIC had 14 commands, all with straightforward names and syntax that made sense:

  • PRINT output text and numbers to the Teletype (and, later on, displayed it on the screens of time-sharing terminals and PCs);
  • LET told the computer to perform calculations and assign the result to a variable, in statements such as LET C = (A*2.5)+B;
  • IF and THEN let the program determine if a statement was true, vital for anything involving decision-making;
  • FOR and NEXT let a program run in loops;
  • GOTO let a program branch to another numbered line within itself;
  • END, which was required in Dartmouth BASIC, told the computer that it had reached the program’s conclusion.

C

C (/siː/, as in the letter c) is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations. By design, C provides constructs that map efficiently to typical machine instructions, and therefore it has found lasting use in applications that had formerly been coded in assembly language, including operating systems, as well as various application software for computers ranging from supercomputers to embedded systems.

Many later languages have borrowed directly or indirectly from C, including C++, C#, Unix's C shell, D, Go, Java, JavaScript, Limbo, LPC, Objective-C, Perl, PHP, Python, Rust, Swift, and Verilog (hardware description language)[5]. These languages have drawn many of their control structures and other basic features from C. Most of them (with Python being the most dramatic exception) are also very syntactically similar to C in general, and they tend to combine the recognizable expression and statement syntax of C with underlying type systems, data models, and semantics that can be radically different. Source: Wikipedia

In 1978, Brian Kernighan and Dennis Ritchie published the first edition of The C Programming Language, hailed in Byte magazine as "the definitive work on the C language. Don't read any further until you have this book!"

Critiques

Edsger Dijkstra (1930-2002), complained: “It is practically impossible to teach good programming to students that have had a prior exposure to BASIC, ... As potential programmers they are mentally mutilated beyond hope of regeneration.” Dijkstra wrote a famous paper decrying the GOTO command: “Go To Statement Considered Harmful.”

Dijkstra also directed his ire at FORTRAN (an “infantile disorder”), PL/1 (“fatal disease”) and COBOL (“criminal offense”)

In terms of efficient notation, Donnie Berkholz's paper: Programming Languages Ranked by Expressiveness lists 11 top tier languages in order of expressiveness (Perl, Python, Objective-C, Shell script, Ruby, PHP, Java, C++, C#, C, Javascript), none of which are as expressive as some second tier languages (CoffeeScript, Clojure, Haskell)

A classic essay on programming as an engineering discipline:
http://www.cs.nott.ac.uk/~pszcah/G51ISS/Documents/NoSilverBullet.html

On learning: Teach Yourself Programming in Ten Years