Things I don’t like in Swift – nil and Any

Introduction

We all know what Swift is and what improvements it brings into the iOS development world. Besides its powerful protocol oriented design and memory safety, it has some kind of flows which are ugly, in my honest opinion. Today’s talk is about “nil”.

Nil

First, what is nil? It’s just null as in other programming languages. But most other languages treat nulls as special values rather than an absence of the them. There’s a great talk about this, check it out here: NULL: The worst mistake of computer science? (2015).

But Swift isn’t that most other languages. It has special kind of optional values that can tell if there is a value.
Continue reading Things I don’t like in Swift – nil and Any