Swift - A friend or a foe?

From time to time I see discussions on Twitter about how bad Swift is as a programming language. Much like anything, there are going to be opinions on every single thing one can have an opinion on. This blog post being case and point :) But when I see a large number of opinions pop up, it feels like they’re not rooted with all of the facts.

Note: This post is not an attack against Ken. I admire Ken’s work, and I enjoyed reading Creative Selection. I loved it. I used his tweet to share the views of experienced folks about Swift given his talent and experience make his voice one that resonates with many.

But before laying down why such a view is controversial and in my opinion an invalid one, I want to focus on an essential part of this conversation.

Experienced/Principle engineers share most of these discussions and tweets—understandably so. Once you’ve had enough experience working with other technology, you know what works most efficiently versus not. So while I share this, it’s important to understand,part of growth in any field is understanding what works best for you and to get the job done in a secure, fast but efficient way.

Through my own experience and growth, I happen to be one of the people that strongly disagree with the opinions against Swift. These are the main reasons people believe Swift is bad and my take on them.

Swift isn’t a newbie dev-friendly language

Swift isn’t a newbie dev-friendly language, and it’s a difficult language to learn and understand at first.

I see this argument a lot during conversations. Since the release of Swift, many new developers, both young and old alike, started to learn how to code because of this language. After having some conversations with many WWDC scholarship applicants and winners, the main reason they choose Swift as their first programming language: Its syntax. It helps to learn basic programming concepts and remove that feeling of being overwhelmed that happens all too often for newbie programmers.

When you start to learn how to code you usually pick a language with an easy to understand syntax. The objc-c syntax isn’t like that.

The number of developers ages 10 to 16 years old are applying for a WWDC scholarship every year keeps growing, and it will continue to do so. That in itself is telling.

Swift isn’t more stable now than it was years ago

It’s not worth it to invest in Swift because the language’s changing every six months, so the code I may write today it will become irrelevant soon.

When I was migrating the Iris codebase from Swift 2.0 to 3.0 it was a painful task, and it took me a couple of days to get it right. It wasn’t just me who experienced such difficulties. After discussing it with other engineers such as Kamilah Taylor she had similar if not worse experiences while she was migrating Linkedin’s codebase.

That was the case a couple of years ago. After migrating a couple of OSS libraries to Swift 4.2, the statement couldn’t be more inaccurate today. Much like our codebases, the language itself needs time to evolve. But because of such comments, many people (especially those new to programming) are scared to dive into Swift.

So it’s about time we change that narrative.

A steep learning curve for experienced programmers

In general but especially as we get older and more experienced, we stick to what we know. We depend on what works. The problem is that as professionals, it can end up biting us in the ass. Many people rarely try to learn something new, despite the ease to do so and the “new things” ability to help save time and money. One of the many things I learned from Cat Noone is:

You’re a beginner; keep that mindset even when you’re at a mastery level.

  • Cat Noone

Having this mindset helped me being curious and open-minded all of these years while testing new technologies, techniques among other things.

The point I try to make is that many people new to programming are open to new ideas, they’re eager to learn. One could argue they also have the time and energy. My bigger concern is that these experienced programmers are role models. So what ends up happening is that by sharing such absolute views about Swift or any framework/programming language (or anything really), folks are getting discouraged trying things out, and that’s not ok.

What Swift did was change the entry point into development and help more people learn how to code. It made programming accessible to more folks. Yes, Swift isn’t perfect, but what is perfect anyway?! I agree with many developers; Swift has a long way to go. I believe the team and the community is working hard to improve it every single day. But saying that Swift is “bad” or “that it has been a year’s long sideway for Apple” isn’t accurate or fair. Swift is here to stay. At the end of the day Swift is just a tool in your toolbox.

I would love to discuss this topic since I’m thinking about it a lot lately. What do you think about Swift? How Swift helped you in your programming journey? Feel free to message me or mention me at Twitter.

This project is maintained by agisilaos