In an attempt to relearn everything about iOS, Swift and ObjC. I’ve had to go back to the complete basics. I’ve been coding so much in Dart and Flutter lately that I’ve lost touch with reality. It’s been a while since I coded on this blog and I realise that I need to make a determined effort everyday.
This post is mostly theoretically. So if you’re a lazy programmer and looking to just find a quick fix. You won’t find it here.

So Clean Code. What is it and why is it so important? I’m obviously referring to a series of books written by Robert C. Martin. A legend in his own right. Clean Code is a dedication of professional craftmanship each coder should strive towards.

As a professional programmer we should each strive for optimal clean code on a continual basis. It’s a daily mission of self dedication and improvement.

How do we get to a point of where we can feel comfortable about our product our customers use?

The answer by Bob is craftmanship. In his books he states.

There are two parts to learning craftsmanship: knowledge and work. You must gain the knowledge of principles, patterns, practices, and heuristics that a craftsman knows, and you must also grind that knowledge into your fingers, eyes, and gut by working hard and practicing.

Learning to write clean code is hard work. So since I think I’m not afraid of hard work. I’m going to attempt to write some of the code samples Bob has in his book into Swift and ObjC samples. It’s going to be tough and if you decide to stay and bear with me it will be worth it.

The swift language is extensive. I remember the days when I used to try and read all the documentation in an evening. It never worked out and I would try and try again. But I still have and inkling that I will succeed and understand everything in those docs.

Learning Swift and ObjC is hard work. But that’s not all what about the Language Reference. Then there are best practices and iOS Api’s. What’s more RxSwift, Combine and SwiftUI. This may all seem incredibly overwhelming. But if you stick with me we will get there.

What does it take to be a clean coder

  1. It requires reading an immensely huge amount of code.
  2. It requires struggling with and questioning all that code.
  3. iOS Developers are renowned for being perfectionists. It’s not hard to understand why. With a beautiful UI comes the pain of understanding all the nitty gritty and complex features that go with it.
  4. This is not a blog series you will finish in a week or two. it will take time.

To gain any value from this series of clean code on Swift. You will need to battle through the upcoming blog posts on decisions we make in the case studies. It will be tiring. But trust me it will be worth it.

If you take the time to work through the case studies and think like the many before you. So that the knowledge will be ground into your gut, fingers and heart.