Pseudocode
Variable affectations
Section titled “Variable affectations”You could describe variable affectation in different ways.
int a = 1int a := 1let int a = 1int a <- 1No type
Section titled “No type”a = 1a := 1let a = 1a <- 1Functions
Section titled “Functions”As long as the function name, return statement and parameters are clear, you’re fine.
def incr n return n + 1or
let incr(n) = n + 1or
function incr (n) return n + 1are all quite clear, so you may use them. Try not to be ambiguous with a variable affectation
Remarks
Section titled “Remarks”Pseudocode is by definition informal. This topic is meant to describe ways to translate language-specific code into something everyone with a programming background can understand.
Pseudocode is an important way to describe an algorithm and is more neutral than giving a langugage-specific implementation. Wikipedia often uses some form of pseudocode when describing an algorithm
Some things, like if-else type conditions are quite easy to write down informally. But other things, js-style callbacks for instance, may be hard to turn into pseudocode for some people.
This is why these examples may prove useful