Apple Swift - right and wrong

Apple's new programming language is a giant leap forward. But will that be enough?

When Apple announced its new programming language Swift, a instantly jumped up my chair and applauded. After all I am a fan of delicious languages and I always enjoy discussions about language design and implementations. Also the Apple team took some ideas of former Apple employee Bret Victor quite seriously. They integrated a playground, which is an exact copy of the demo Bret Victor has shown in its famous inventing on principle talk.

Now I don't want to talk about the specific syntax of Swift, or any of the framework's integrated function. I am still convinced, that Swift fulfills a lot of its promises. I don't know how it can be that much faster than Objective-C, however, it might due to the lack of pointers and therefore much more streamlined optimization capability.

What I know is that Swift has been influenced by JavaScript and C#. It also considered some aspects from functional programming. And that is a point where I think that Swift may have a flaw in its design. I think that C# is still the language with the best design. It is really consistent and it is quite obvious what you should and what you should not do. Then there is JavaScript. A famous comparison looks as follows:


Personally I don't see much of a problem here. A good programmer instantly recognizes what might be useful and realizes what might lead to undefined behavior, unwanted overhead or inconsistent outcome. But, we would live in a great work if only good programmers existed. It should be no surprise that most programmers are not good. Not even close. Therefore most JavaScript code is garbage. Luckily we today have an amazing amount of great frameworks. Problem solved!

With Swift I see the following problem: The language is multi-paradigm, however, while it tries to minimize clutter (compared to Objective-C, nearly everything), it may be too short handed for writing really useful code. Time will tell, but I fear that the authors wanted too much. I would welcome a language that drives developers in one path, while minimizing syntax and descriptions. However, it seems that such a language does not exist. There is always a drawback. And usually the drawback lies in big projects. That was (and still is) the issue with JavaScript. And that might be the Achilles' heel of Swift.

So should we all learn Swift? If it overcomes its potential problems? In my opinion. Not at all! Why? While Microsoft is trying to convince developers about its programming language and tools (and does a pretty good job there), Apple still tries to capture developers in their eco system. A smart dev would not make a bet on this. On the PC market Linux / Windows is much more flexible and bigger. On the Smartphone / tablet market Android is also in a better shape.

What could be a winning move? Finally freeing Swift from the Apple platform. But this is unlikely to happen. While Microsoft is already changing its course, Apple is currently stuck in invincibility mode. This is a dangerous time, as no real innovations can be found. Dictionary enhanced keyboard? 4 years too late. Swipe keyboard? Also too late. Widgets? Come on. A better programming language than Objective-C? Why did anyone learn Objective-C anyway?

Let's see how Swift develops. I would really love to learn this, but I feel like I do not want to place such a bet.

Created .


Sharing is caring!