A computer science student can write good mathematics – a comparison of mathematics and computer programs

(This post is taken from my previous webpage)

Table: A comparison of writing mathematics and programs

Comparison of writing mathematics and programs
Programs Mathematics
Variable definition Use after definition Use after definition, or use with immediate explanation
Variable name Multiple characters, straightforward meaning for easy debugging Single character with different fonts and cases, uniform styles for easy reading
Variable semantics Expressing program logic, can be simple types or objects As simple as possible, e.g. real number, vector, set, ...
Functions/Equations Flow of clauses, such as if, for, and functions Composition of simple operations, such as min, max, sum, and product
Grammar Check Compiler Self
Emphasis Efficiency and clearness Clearness