Don’t bother with Swift for iOS development

来源:互联网 时间:1970-01-01

Swiftwas introduced over a year ago and I still remember watching the announcement with mixed feelings. I was excited by the simplicity and the apparent power of Apple’s new programming language, but I was also slightly dismayed. Don’t we have enough programming languages already? After watching the announcement, I’ve decided to wait and see how it evolves, not as a programming language, as it was undeniably superior to most from inception, but how it might expand beyond iOS.

After more than a year, I still can’t see the value in it.

A couple years back, I was attending a fireside chat with Matt Mullenweg, CEO of Automatticand creator of WordPress. During the Q&A session, I asked Mullenweg what programming language he thinks developers should focus on. His immediate response startled me: “Don’t bother with PHP!” he said. An unexpected statement, considering WordPress (his life’s work) is powered almost exclusively by PHP. He went on: “In the years to come, for WordPress, PHP will become nothing more than a thin layer that interacts with our database. I believe developers should embrace Javascript instead with all its vices, as it’s slowly becoming the most important programming language for the web”.

Mullenweg’s response helped validate my own assumptions. These days, almost all the software we use is web-based, which makes our beloved low-level programming languages less important than they’ve used to be. Meanwhile, Javascript is not only leading the charge on the web, but it’s becoming prominent in the most important space of them all: Cross-platform mobile development.

Admittedly, Javascript in itself is not a great programming language. In fact, calling it a programming language might be an overstatement. But that’s okay! A revamp of the language is already in the works,and besides, frameworks such as AngularJS, Backbone, React and NodeJS, makes programming in Javascript as powerful and enjoyable as any other language out there, which makes it perfectly suitable for cross-platform mobile development.

The days of exclusively targeting a single mobile platform are gone—unless the decision to do so is driven by business requirements. Mobile developers are expected to build apps that run on multiple platforms and an ever-growing variety of screen sizes. Considering the vast architectural differences between Android and iOS, writing native apps for each platform is unsustainable.Even Facebook recognise this by investing hefty resources in their very own React Native—a cross-platform mobile development framework. And guess what programming language it uses?

It’s clear that cross-platform mobile development frameworks are the future, it’s also clear that the preferred programming language for these frameworks is Javascript, but surprisingly enough, most newbies still prefer to learn Swift and focus on iOS which currently represents 20% of the mobile market. Why would anyone limit themselves to a smaller piece of their potential target audience? If you’re a beginner, my advice to you would be: Start with Javascript and learn everything you can about web and cross-platform mobile development. Personally, I much rather spend my days with all-too-tangled Javascript as it’s much more likely to be of use to me in the future and expand my apps reach today.

Do you think Swift is the future of mobile development? Ping me on Twitterand tell me why! I’d love to hear your thoughts.