• 0

What do we think of Swift?


Question

Has anybody played with Swift yet? What do you think about it?

 

This past year I've been doing mostly Android development and haven't done much iOS. However, I've been reading the Swift reference ebook and I've been watching the WWDC session videos, and boy do I wish that I could be using Swift instead of Java 6/7. I've started down the functional programming rabbit hole lately and Java just isn't enjoyable anymore. The verbosity is grating on the soul.

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

As a long time ObjC developer i think its great, a real improvement. As much as i love ObjC its great to have something new and shiny to learn and boost productivity with.

  • Like 2
Link to comment
Share on other sites

  • 0

Swift looks to be like a slightly different version of C# (I haven't actually tried it yet) and if it is, that's a good thing. Java is really a terrible language to program in, and google doesn't make it any easier with their terrible dev tools.

Link to comment
Share on other sites

  • 0

It does bring much-needed new features and seems surprisingly well-designed, with type inference throughout, ML-style "let" immutable bindings and first-class support for treating functions as values. However, I was disappointed to see that it still relies on automatic reference counting as a garbage collection mechanism, as ARC is error-prone (it leaks cycles - great care has to be taken to avoid them) and doesn't scale well in a highly multithreaded application (as reference counts are shared resources that require locking to update). 

 

I'm also still not sold on the idea of using a language that practically only runs on Apple platforms when cross-platform alternatives offering access to the same native capabilities and excellent performance exist, i.e. Xamarin. If I were to do any iOS development I'd probably be using F# or maybe C#.

Link to comment
Share on other sites

  • 0

I've started down the functional programming rabbit hole lately and Java just isn't enjoyable anymore. The verbosity is grating on the soul.

I share the sentiment wholeheartedly. Have you tried Scala?

Link to comment
Share on other sites

  • 0

I share the sentiment wholeheartedly. Have you tried Scala?

 

Yes, I'm currently doing the Functional Programming in Scala course on Coursera. I'm enjoying being a newbie at programming all over again. I should have looked into FP a long time ago. It's making me a better programmer at OO too, and is more useful than all the time that I've put into learning <the framework du jour> in the past.

 

My first reaction when I saw Swift was that it looked a lot like Scala. Having looked into Swift more, I now think that sits somewhere between C# and Scala on the functional scale. However, while Scala can be quite intimidating to newcomers, I find Swift very easy to pick up.

Link to comment
Share on other sites

  • 0

Yes, I'm currently doing the Functional Programming in Scala course on Coursera. I'm enjoying being a newbie at programming all over again. I should have looked into FP a long time ago. It's making me a better programmer at OO too, and is more useful than all the time that I've put into learning <the framework du jour> in the past.

If you like Scala you'll love F#.

Link to comment
Share on other sites

  • 0

Swift looks to be like a slightly different version of C# (I haven't actually tried it yet) and if it is, that's a good thing.

 

I don't find Swift to be that similar to C#. They are both primarily OO, and they both have some functional programming features, but I suspect that idiomatic Swift code is going to feature a lot of pattern matching, tuples and Swift enums (aka discriminated unions). I know that it's pretty early to be discussing idiomatic Swift code, but this is the impression that I get by reading between the lines and looking at the code examples in Apple's Swift ebook.

 

Also, C# has exceptions while Swift doesn't. It looks like error handling will be done by returning multiple values (via tuples) from a function. Not sure how I feel about this yet. It's possible that their omission is due to the fact that Swift is designed to be used with Cocoa / Cocoa Touch, and while Objective-C does have exceptions, the frameworks have standardised on the NSError class.

 

 Java is really a terrible language to program in, and google doesn't make it any easier with their terrible dev tools.

 

Yeah, I'm not a big fan of Java. I'd take C# over it any day. I was doing iOS development before my current gig with Android, and I find that Java is even more verbose than Objective-C. I'm using RxJava a lot and the lack of lambdas in Java 6/7 (Android doesn't support Java 8) means that there's an explosion of boilerplate code. Anonymous inner classes everywhere.

 

I think that Android Studio is a decent IDE. That's thanks to IntelliJ. I don't fancy the Android Development Tools (ADT), which sits on top of Eclipse. But tooling in general isn't up to par with Apple's Xcode / Interface Builder / Instruments. Also: The amount of time that the build and run step takes drives me up the wall.

Link to comment
Share on other sites

  • 0

It's pretty great.. it's so much closer to other languages now like Java, C#, Scala etc syntactically.. they modernized a bunch of stuff that I really disliked about Obj-C and now the language looks a lot nicer and easier to work with. 

I mean you get used to Obj-C, but now it's much easier for me to jump from coding something in Java to Swift to C# etc. It's not such a mental departure as it was before when I went back to Obj-C.

Link to comment
Share on other sites

  • 0

The bit I don't like about it is the name.

There is already a scripting language called Swift, which I use on a regular basis. Now we have two languages with the same name, which I find stupid. Give it a year, and it's going to be almost impossible to find Swift (scripting language) resources, etc due to the influx of Swift (programming language) crap.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.