Wednesday, September 21, 2016

Two Years Later...

So nearly two years later, I've stuck with it. I am not a Swift expert, but I no longer use Objective-C. I have written a small app in Swift. And rewrote my much larger app in 100% Swift. Plus also written a few small test/demo apps.

Here's a recap on my original observations:

Out of Date Information - This remains an issue. But seems to burn me less lately. I've learned to always look in the newly integrated doc viewer first. Some, but not all, StackOverflow posts get updated to match Swift3. The mailing list is always current. I make sure if I ask a question on SO, that I make it clear I'm doing Swift3.

Replacing one Legacy with Another - Apple's aggressive integration makes this a lot less than I expected. The fact that most APIs follow the Swift naming conventions instead of being obviously converted from keyword style naming makes it seem less legacy already. The aggressive attitude of replacing oft used types with bridged variants also makes it seem legacy (e.g. Date replacing NSDate). My apps need no @objc qualifiers, so the need to have legacy rubbed in my face is obviously disappearing quickly.

Head Turning Paradigm - The human brain can adapt to some things pretty quickly. This appears to have been one. In fact, I actually prefer the "type post cedes" rather than "type precedes" pattern. I still do quite a bit of C, so it's not just me moving on. I have to do both approaches regularly, and I actually like this. I've even begun to use the optional typing in Python which follows the same notation.

:, :, and : - This has turned out to not bother me much. I don't really notice it in fact. The dictionary thing never shows up much. The tools quickly correct me if I get a dictionary/array mismatched. The other two uses just seem natural now. It still can seem a lot of typing (especially now that default first arguments have been deprecated), but the auto completer keeps me from noticing how much I spell things out.

Wrap, Unwrap, Ugh - Doesn't bother me at all anymore. Especially once I figured out how to extend Optional with ifNil and ifNotNil methods. Sometimes I get a bit tired of nested if let... statements.

Refactoring - Still miss this a lot. But lets face it, I don't have much refactoring support in my C or Python stuff.

At two years in, I like Swift. As an older more polyglotted developer, I don't love it like I did other systems in my younger more idealistic years, but it works for me. I often think "this is like a C++ that I can handle." I still detest C++. If I have to choose between Java and Swift, I'd take Swift in a heartbeat. In fact, I even have a slight preference for Swift over Python.

1 comment:

  1. Hello.

    Could you please elaborate a little more about why you perefer Swift3 over Python?

    Thank you,

    Ladislav Lenart