Swift 4 years look back

swift2

Hello everybody,

When I wrote this post on Jun 22, 2018, Swift was 4 years old. In a few weeks earlier, Swift 4.2 was presented in WWDC 2018 and planned to ship with XCode 10 later on.

At the very first time, I was an Objective-C developer. I felt good with Objective-C. It was King, was number one. But Apple suddenly announced Swift to the public in WWDC 2014.

There were many concerns and questions in my mind. There were enough programming languages in the world why invented one more? What purpose was it?

Overall, Swift syntax is very similar to some popular programming languages which I have learned. In term of the language feature:

  • imitates a bit Java with final class.
  • mimic a bit Javascript with the way it declares variable
  • mimic a bit C# with {get set} plus { willSet didSet}, an optional type with a bit smarter.

Likely Swift grabs most things which it thinks are the best feature of those languages.

If you have been Objective-C developer already, don’t worry. Because Swift remains some similar concepts in Objective-C like

  • Category vs. Extension
  • Interface vs. Class (with access modifiers available to enforce restricted OOP encapsulation)
  • Block vs. Closure

Swift also comes up with its specialties like tuple, extension default implementation, protocol-oriented programming, etc. You might need to spend more time to learn more about this later.

Unfortunately, those things in early days didn’t make Swift a superstar on the sky. It was a start but not a bright start.

The very first instance of Swift was tough to use. Besides, It showed unstable issues, slow compilation, crashing XCode often. It was embarrassing compared to Objective-C. However, most of the iOS developers felt promise on Swift, most of the article talked it up. There was massive support at that time.

One year later, in 2015, Swift 2 was rolled out. Developers could develop and distribute their Swift-based apps.

From bottom line, Swift 2 was not something elegant, robust, efficient as it was said.
On syntax, it was still not mature and especially unnatural on defining methods, closures, tuple.
There were some iOS frameworks were ported to Swift, but the use of Swift was still annoying because of Swift auto-correct suggestion in XCode not so well-functional. This way made writing Swift likes hell. My colleagues and I got a lot of trouble and difficulties when just declaring a UIViewController’s subclass because of the required and convenient keywords in defining initializers (still got this issue until Swift 3).
Besides that, It consistently showed a lot of unstable problems with XCode.  It re-compiled very frequently everytime when the code was modified. It usually caused XCode crashing, losing syntax coloring, losing syntax detection and code navigation usually broke down. Objective-C was King. lol

In late 2015, Swift turned to open source. However, I didn’t care at all. Working with Objective-C was great. Swift was still unreliable, that might be one of the reasons why it released its source. My two cents.

In late 2016, I turned to Swift. I got an opportunity to take participate in developing an enterprise project which used Swift ( Swift 2.2 if I remember correctly).
My first thought, Why not Objective-C? Second thought, those guys were too optimistic when went with Swift. Their idea was a new app, a new platform, hi-end technologies.

On the contrary, my problem was how to become familiar with Swift as fast as possible. It took me a few days on language syntax, and a couple of months to become more knowledgeable. In early days, I still somehow got issues with Swift. Day after day, I got more tips and tricks on swift, had more fun, coding became natural sense.

In later year, 2017, Swift 3 came out. It was mature enough. Syntax was flexible. Declaring method or block can be more semantic than ever. It was functional well with XCode. The compilation was improved a lot. More efficient, faster than before. It had fewer crashes, fewer defects. Some more languages features were added. No more complains. Although String, Array, Collection manipulations were still stuck in some cases. I was satisfied.

In 2018, My project was migrated to Swift 4. With many features added made Swift become more robust, reliable and convenient. Swift and XCode were a couple, performed outstandingly.

Swift has been being used widely, I obviously have seen that. There are a lot of contributions from developers across the world. They have submitted many proposals to make Swift more robust, efficiency day by day. The Swift team is also working hard gradually add up new things.

The biggest milestone of Swift is turning to an open source. Swift also gradually uncovers its shadow projects one by one on Github community and its own page. Anybody can look into Swift and figure out what under the hood. This benefits developers across the world.

Swift has supported linux platforms like Ubuntu, Fedora, Debian (raspberry pi). This is a big movement which prepares for the future foundation of back-end ecosystems. The recently checked-in projects obviously show that goal. Check out Swift-nio, Swift-nio-extras, Swift-nio-ssl, Swift-nio-http2, Swift-protobuf, Swift-Package-Manager, foundationdb,… I hope you see something

The relevant docker has been checked in. Some back-end software has been developed and available. I know some names like IBM-kitura, Vapor, Perfect. Swift head-end developer, will it be your next career path?

In recently visiting Swift GitHub, I figure out that Swift core library has been able to run on Android devices which belongs to Armv7a family. Wow, What is Apple going to do? I don’t know. Cross-platform mobile development? Sound great. Check out SCADE, it’s doing exactly what I thought.

SCADE_SWIFT_Cross_Platforms
SCADE.io

Swift is very promising. Apple lets the door opened widely. What will be next?

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s