(Ken Struys' Blog)

web-developer, serious schemer

The Their, There and They're of Programming

Programming languages was my thing in University. I would look up every language I could find. I constantly asked myself why one language was different from another? Why do people have different opinions about how we should express solutions to problems? From COBOL to Java to Clojure, I’ve seen at least syntax and understand at least one reason why the language is/was needed.

I’ve tried my best to learn how to explain the differences between languages and programming concepts in general. I’ve noticed that a large number of programmers get terminology wrong or use very different words interchangeably. Do I think people are stupid for messing these up? No. Do I think people should at least try to get things right? DEFINITELY! Here the common ones I’ve heard. If you’ve heard some other ones, please add to the list.

Bracket, Brace, Parenthesis

[ - Bracket

{ - Brace

( - Parenthesis

High Order vs. First Class Function

High Order Function - Functions that either take one or more functions as input or return a function.

First Class Function - Functions are first class values. New Functions can be created at runtime, passed to functions and returned from functions.

Declaring vs. Instantiating vs. Initializing

Declaring - Where the definition of a function or variable appears. Often languages require declaration to associate strict types with variables.

Instantiating - Where the memory is allocated for a value/structure.

Initializing - Where values are associated to a variable/structure.

Override vs. Overload

Just because they start with the same letter doesn't mean they're the same thing. I'm actually shocked how many people double take when identifying these.

Override - A means of overriding the association between and name and a function. In OOP this usually comes in the form of a child class re-implementing a parent’s function.

Overload - Allows programmers to have multiple functions of the same name. The responsibility of resolution is on the compiler (or interpreter). The conflict is usually resolved by parameter type or arity of the function.

Instance variable vs. Member variable vs. Property

Member Variable - A variable associated with a specific class.

Instance Variable - A instance of a member variable, each object instance has their own copy of it’s instance variables.

Property - Read and written like instance/member variables, but property reads and writes are (usually) translated to get and set method calls.

Parameter vs. Argument

Parameter - Variables (not values) defined in the definition of a function.

Argument - The values/references passed to the function at runtime.

Lexical vs. Dynamic Scope

Lexical Scope - Also called static scoping, it's scoping that can be determined by static program text. Lexical Scoping is independent from the runtime call stack. When looking up a value associated to a variable you look in the local function, then you search in the function in which that function was defined, and then in the function in that function was defined, etc.

Dynamic Scope - Dynamic Scoping is very different, conceptually there is a stack at runtime for each identifier. When an identifier is declared it is put on it's appropriate stack and is removed when it has left it's scope. When looking up a value associated to a variable you look in the local function, then you search in the function that called that function, then you search in the function that called that function, etc.

Syntax vs. Semantics

Syntax - The grammar provided by a language. Syntax of a language describes what the terms and structure you write the terms in the language.

Semantics - The meaning behind the syntax. For example "=" could mean equality in one language and assignment in another, the language's semantics describe the meaning.

Object vs. Class

Class - This is the definition of an Object. It describes what the Object will contain and how it will behave.

Object - An instantiations of a particular Class.