Thoughts on Swift
The buzz about Swift has only slightly started to die down, so I thought I’d put a few of my thoughts about it down on Glowdot. My thoughts are less about the language itself, but the adoption of new technologies in general, and what I feel it all means in my industry.
When I first sat down to write my first native iOS app, back in 2008, the first hurdle was getting a grip on Objective-C. I wrote my first C program back in 1993 (a Unix text-based chess game, naturally) and since that time, leading up to the mobile revolution, I had been coding primarily for Windows platforms (desktop and mobile) in C++, and in various other C-style languages, particularly C# and PHP. Objective-C is really, at its core, just a different way of extending the C language, but it still presented a roadblock as it was my first encounter with the language. I won’t say the language itself wasn’t mature, because I’m sure it was even if it was considerably new to me, but the real problem was that I wasn’t mature as an Objective-C developer. Not only was I learning a new platform, and a new SDK, and a completely new way of building application UI — the Apple was quite a bit different from the win32 or .NET way of doing things — but I was learning a new language at the same time. It really did feel, in those early days, like I was asked to write software for some piece of alien technology that fell out of the sky.
And I wasn’t alone. Suddenly a lot of developers were eager to code for this new device, and a lot of them had not coded for Apple products in the past. We were all in the same boat. Consequently, if anyone remembers, many, many, many iOS apps in the early days were weird, buggy, crashy messes. I lamented loudly, in blog posts since deleted, that Apple made a really odd choice forcing us all into using this language that the majority of us were unfamiliar with.
Since that time, several other options based on languages in wider use (and by that I mean, used for development on non-Apple devices) have emerged. mono.NET for example, or Unity, or even several of the HTML/JavaScript based cross-platform development tools. Xamarin is a recent option that we like so much we’re offering it here at Glowdot. Still, nothing really beats native development with the tools and languages the controller of the platform offers and supports. Not only is Apple behind Objective-C, the community is overwhelmingly pro- Objective-C now, which means working through the inevitable issues (via Google and Stack Overflow) is much easier. Not to mention the countless libraries and UI components that emerged over the last few years build in Objective-C.
Still, I hoped, in 2008, as I did in 2014, Apple would get behind a more “common” language for iOS eventually. While I understand that C# might not be a logical option for Apple (even though it would be my ideal language of choice for developing on iOS), there are other options that don’t require learning a new platform and a new language for newcomers to iOS.
Apple recently unveiled Swift, and while I haven’t looked at the language much yet, my first reaction was a big “why?” From what I understand so far, Swift was developed to work around many of the issues with Objective-C — primarily speed (which I didn’t know was an issue), and “safeness” (which I definitely knew was an issue). Better (as in: automatic) memory management, overflow-safe and auto-initialized variables — all great things. But things that exist in other languages people already know, and don’t have to learn from scratch.
I’ve been in the game long enough to turn a cautious eye to new and exciting technologies and languages. Google unveiled a new language a few years ago, although I don’t know anyone who uses it. No judgement about the language, I simply don’t know any serious users of it yet although they might be out there. I can say the same about several other new and exciting and much-blogged-about languages — Haskell, D, honestly the list is huge. In the real world, whatever that means, I most often see the same languages I’ve seen for 10+ years: C/C++, PHP, C#, Java. Python is the only language I can think of which I originally scratched my head over which now seems to be in fairly common use. Ruby, actually, is another. But those languages had to find their audience and mature a bit before they came into common use.
And apparently Swift is no exception. The language is still in active development, from what I understand, and programmers are already having fun breaking it. I’m looking forward to digging into Swift in the upcoming months, but for now I’ll be watching from the sidelines to see where it goes.
Side note: I certainly don’t want to appear as if I frown on new tools and technologies. Indeed, I got into this business because I love playing with and learning new things. This industry is full of people like me, though, and often that leads to a feedback loop of excitement about new technologies. After 20 years developing software in multiple languages on multiple platforms, I reserve the right to be a little hesitant to jump on bandwagons.
No Comments