Choose Your Teacher Wisely

Choose Your Teacher Wisely

The vast number of tutorials and courses about software development is a blessing for anyone interested in building software. And this is no less true for anyone interested in Swift development. Getting started with Swift development is easy and it doesn't need to cost a fortune. But, as many of us have discovered, there's a downside to this wealth of information. In this chapter, I'd like to highlight three problems that I frequently face and hear about from my students and readers.

Information Overload

When I started learning Cocoa development in 2006, there were only a handful of books available. Aaron Hillegass' book Cocoa Programming for (Mac) OS X was the unofficial golden standard.

Cocoa Programming for Mac OS X

But, with the introduction of the iPhone in 2007 and the release of the official SDK in 2008, that number increased substantially. There are many books available from traditional publishers, such as Apress and O'Reilly, but many developers, including yours truly, have chosen the path of self-publishing, bypassing traditional publishers.

It has never been easier to publish a book or a course. Book and courses are available at any price point, including free. Unfortunately, this has made it more challenging for developers to decide which path to choose to learn the topic they're interested in. Each day new tutorials, videos, and courses are published. It's challenging. That's for sure.

The blessing of having so much free information at your fingertips is more often than not a curse for developers that want to learn Cocoa and Swift development. Not only is the amount of information overwhelming, there doesn't seem to be a clear path to follow. It's difficult to see the forest for the trees. Don't stop here, though. There's hope.

Who to Trust

Every developer that writes about Cocoa and Swift development does this with the best of intentions. They want to help people learn something new or solve a problem they're having. It's fantastic to see how many of us take the time to write a tutorial or produce a video to help others. It's one of the key ingredients of the thriving Cocoa and Swift communities.

Despite the author's good intentions, though, what they're teaching may be incorrect or ignore good practices. If you're new to a subject, then you may not be able to spot these mistakes. The title of this chapter is very telling. It's become more important than ever to choose your teacher wisely. While I don't believe that people are intentionally putting out bad content or incorrect information, it's up to you, the student, to filter the good from the bad.

A few weeks ago, I was looking for a solution to customize the color of the clear button of a UITextField instance. It turns out that the tint color of a UITextField doesn't affect the clear button. The issue I was having is that the clear button is nearly invisible in a dark user interface.

During my search for an answer, I stumbled upon several Stack Overflow entries that recommended digging into the view hierarchy of the text field, looking for the clear button, and modifying its tint color. As I mention elsewhere in this book, this is a bad practice. If the API doesn't allow for this type of customization, you file a bug and implement a custom solution. That's the only correct solution. Your clever workaround will inevitably break when Apple makes changes to the internals of the UITextField class. Respect the SDK. Always.

The answers that suggested digging into the view hierarchy of the text field were upvoted because, at that time, it solved the problem. Unfortunately, this creates a bigger problem. Every inexperienced developer that read one of these answers is made to believe that this is a viable solution, that this is fine. Instead of spotting the risk of the solution, they wrongly believe that they've picked up a good practice they can adopt in other, similar situations.

If I need to pick up a new framework or API, I rely on the people I have come to trust over time. These are very often people that have built up authority in the community over several years or people like Aaron Hillegass, Marcus Zarra, and Jeff LaMarche that have been around since the very early days of the platform.

Focus, Focus, Focus

I used to follow a slew of developers on social media. I wanted to know what they were learning, what they had to share, and which techniques and lessons I could adopt in my own projects. About a year ago, I stopped doing this because it was too overwhelming. There's so much to learn. The platforms and the Swift language evolve so quickly that it's hard to keep your focus if you don't protect it ferociously.

There are countless talks about almost any topic you can imagine, but it can leave you with more questions than you started with. This may be different for you, but focus has been the cure for me. As I write elsewhere in this book, attention has become so important in today's busy world that having the skill to focus obsessively is a skill every developer should learn to master.

I don't believe in the concept of a genius. It's true that some people are more gifted than others, but, in the end, developers that excel in what they do are those who can focus and commit to something. You don't master Swift by reading a few chapters in Apple's language guide. That's a good start, but it's a process that continues and never stops. That's the beauty of it. No? Didn't you become a developer because the sky's the limit?

That's also why I often ask developers what goals they have for the coming months or years. What I'm actually asking them is what their focus is. What are they trying to accomplish? Ambitious people have a clear focus, very often a singular one. Let me ask you then, "What is your focus?"

Never Stop Learning

The mobile space is still very young, relatively speaking, and it evolves at an incredible pace. With Apple and Google heavily investing in their platforms, the speed with which mobile platforms evolve requires developers to focus and learn non-stop.

In 2015, Apple introduced no less than two new platforms, tvOS and watchOS. While developers familiar with iOS won't have a hard time getting up to speed with Apple's brand new SDKs, there are many, many APIs and paradigms to become familiar with. It's understandable if you feel a little overwhelmed as a mobile developer. That's fine and it's fine to admit that.

If you decide to become a developer, regardless of the platform you write software for, you need to accept and become comfortable with the fact that learning on a daily basis is part of the job.

For the past few years, Apple has released a new version of its operating systems every year, introducing new technologies we need to become familiar with. The Swift project continues to evolve at a fast pace. At the time of writing, Swift 4 is just around the corner and with it come new features, bug fixes, and numerous improvements.

Are you ready to dive in head first? If Apple announces a slew of new APIs next year, will that scare you or will it excite you? Do you have the motivation to not only continue learning but also push the envelope. Using an API is one thing, pushing it to its boundaries and beyond is where it's at.

If you like programming, but prefer to stick with what you know, then mobile development may not be the best choice. If learning is in your blood and the mere thought of WWDC or Google I/O gives you goosebumps, then being a mobile developer is the best job in the world.