Author

Fibonacci, the Golden Ratio & Memoization

Let’s begin by defining the two key topics which will be explored in this article: Firstly, the Fibonacci Sequence is a series of numbers where a given number is found by adding up the two numbers preceding it. The sequence reveals something about the deep laws of the universe, and as such it appears in many places in nature, including things like plants... » read more

Big-O Notation (Part II)

In this article, we continue to explore Big-O, which is a notation we use to describe algorithmic efficiency. If you haven’t read part one, you might like to read that part first. In the last article we talked about where Big-O notation came from, and what notation we might expect to discover for an efficient... » read more

Big-O Notation (Part I)

History of the Notation Big O Notation is a shared representation (a language if you like) used in computer science to describe how long an algorithm could take to run, and indeed the likely storage or space requirements involved. It “is used to classify algorithms according to how their running time or space requirements grow as the... » read more

Closures in Swift

Closures are “are self-contained blocks of functionality [or chunks of code] that can be passed around and used in your code. Closures in Swift are similar to blocks in C and Objective-C and to lambdas in other programming languages.” (See my previous article on Blocks in Objective-C for more details). In Swift, functions are actually just a special case of... » read more

Using Blocks (Obj C)

Blocks are a C-Based language-level feature found in C, Objective-C, and C++ and they define self-contained units of work (Objective-C borrows the name “Block” from SmallTalk, a language in it’s DNA). Blocks are like anonymous functions (lambda abstractions) in that they combine data with related behavior, but they can also have optional binding to stack/heap variables. For a deeper... » read more

Polymorphism (in Swift)

What is Polymorphism? … To begin to understand this concept, it’s helpful to know that the word polymorphism comes from the Greek meaning many shapes (or forms).  In the context of Object-Oriented Programming, this means the provision of a single interface to entities of different types.   The interface provided by the objects is the same, but what’s... » read more