So, my last post was a little nasty. Written like a conservative populist, which politically I’m not, but I admit I had my reservations about learning Swift then, and I stand by that opinion at that time. I’ll be brief this time. I’ve now had a chance to really do some work with Swift and I have to say overall I quite like it, and never expected that to happen so quickly. Why the change of heart, you might ask?
- I guess I don’t like learning from books, but I like learning by doing. I find a lot of tutorials out there on the internet kind of superficial and boring. I joined a project where there was already enough Swift code but not too much. I had the opportunity to contribute based on some code I could already work from.
- I really do like a lot of the features, such as enums (and being able to use string types)
- The syntax is pretty good. It does make for readable, type-safe code.
- I’m surprised at how quickly one can just start writing useful code
- Since Swift 3, there really is no reason to say no to it. Previously it all felt “too new” and not finished. The compiler warnings were a total disaster. For a strictly typed language, having poor compiler warnings was the most discouraging aspect to it. (Hence the rant about German bureaucrats who aren’t helpful but just say no)
- I’m sure other reasons here as well
Now, it’s not like I’ve become blindly religious. Sometimes I don’t like to the strictly typed language, but I suspect my frustration comes from the typical approach of “well, in Objective-C, I could just…” and not yet knowing the equivalent approach in Swift.
But all in all, I think it’s pretty easy to get up and running and to start writing Swift code that is useful and readable. I’ve seen some library code that tells me I still have a lot to learn, but for now I think it’s kind of a “no turning back” situation.
I’ve already basically done all the types of things I’ve done in objective-C, and find that I really didn’t use KVO that much anymore anyway, so I don’t miss it.
I thought I’d just round off that last angry post with something nice.