Sometimes carpetbaggers have something to sell
February 19, 2015
Swift 1.2 dropped, and features several big improvements. I've been playing with Swift since day one, and I'm more hopeful about it than ever. I also almost became [gasp] functional programming curious. It passed.
Gone are the optional-checking pyramids of doom.
if let a = foo(), b = bar(), c = baz() {
doSomething(a,b,c)
}
Doing in one line what was taking an open ended number of nested if/let statements is so much better. And incremental builds, wonderful; I cannot believe we did without for so long.
Some things though are still not quite ready:
-
syntax stability. There have been some big changes over the last few versions. The nil coalescing operator, array syntax, how to check options (twice)… Each time the change was for the better, but I'm not convinced there aren't any breaking changes coming down the pipe, & that's pretty much the definition of beta software.
-
until very recently the stability of the tools left a lot to be desired. Xcode crashed with grim regularity. The new beta's better, but it's still crashing.
-
the language has suffered from the slows in debug mode - so far so good with that one. Strings & arrays & any kind of regex, they were all the main offenders for me previously, it's better but it's too early to tell. I'm hopeful. The combination of better optional unwrapping checks and quicker string manipulation may mean it's time to tackle the JSON problem yet again. That's where the slowness really showed for me.
All up things Swift-ish are improving at an amazing pace, we're not there yet (where there = programming Nirvana), but it's not even been a year.
The other problems I have have to do with the size & age of the Swift community, at least as much as they have to do with anything Apple's done.
-
there's a lack of a standard ways of doing things, even basic things like error handling. Too much standardisation can make things boring, but things are a bit open ended right now. Error handling, that's an essential.
-
and lastly, and this may not be a problem for you, there's the problem of the functional programming carpetbaggers. I think functional programming is arse, YMMV. Occasionally I get interested, but then it's monad this & functor that. These are the same guys who tried to convince everyone they needed to study maths to work with computers back in the day. Swift allows & has benefited from a small amount of functional programming, but all things in moderation. The carpetbaggers, with their functional programming solution in search of a problem, ready to pounce on any opportunity to extol the virtues of their custom infix operators & their obfuscated code, they are all over Swift.
Both of these issues will be solved by the more widespread adoption of the language - competing solutions created & some common ground adopted, & the influence of the functionalistas diluted back to their usual (tiny, tiny, easy to ignore) level. They'll lose interest soon enough when Swift isn't functionally pure enough for them any way.
Map functions are kind of cool. Sometimes. In limited circumstances. (Stop!)
I am glad I leapt onboard on day one. I have enjoyed the ride immensely. There have been a few dark evenings where the annoyances piled up, but never enough for me to doubt my move. Swift is great, if you haven't, you should try it.