Hacker News new | past | comments | ask | show | jobs | submit login

I heard from devs Swift 1.0 is still alpha quality (tools) and Apple shouldn't release it. Would you use it for new project?



I've been using Swift for personal projects. The company at which I work (it's a large social network that recruiters love) has a couple of small teams which have released or are working on apps written entirely in Swift. So it's definitely usable.

Good reasons to use Swift might include the following:

- You think you can make good use of the features Swift offers (generics, sum types, optionals, namespaces, typed containers) and are willing to not just write Objective-C code with a different syntax.

- You are willing to take a short-term productivity hit to learn a language which will probably become the crux of Apple's developer tools in the future.

- Your project isn't going to rely heavily on the dynamic features Objective-C offers (e.g. method swizzling, adding or replacing classes and methods at runtime).

Things that are troublesome with Swift include the following:

- Swift's interoperability with Objective-C and Cocoa Touch is still touch-and-go in a lot of places. It's been getting better, but unless you understand how both Cocoa Touch and Swift work, you will just have to take on faith things like IBOutlets being implicitly unwrapped optionals.

- Xcode's stability when it comes to working with Swift projects leaves much to be desired. The level of instability also seems to vary; I've worked on files that crashed SourceKit over and over and files that caused the IDE no trouble at all.

- I wouldn't call Swift alpha-quality, but there are still compiler and runtime bugs that need to be addressed.

(BTW I really wish HN supported proper lists in comments. Doing the two-space indent just makes everything run off the screen.)


I wrote a custom keyboard using Swift. XCode stability was mostly OK. SourceKit crashed sometimes (disabling syntax highlight and autocomplete), but it didn't cause much headache.

The thing that bothered me most was that iOS app wrote with Swift was packaged with 8 MB runtime libraries, so it was like 100 kB of my code and 8 MB of swift runtime libraries which I didn't like at all.

I tried to learn how to write an OS X application with Swift and for some reason it became a nightmare, SourceKit keeps crashing and it wasn't possible to work at all. I guess I triggered some bug. I tried to investigate it, but without much success, I think that XCode will send those crash logs to Apple and may be things are already fixed.

Actually I'm not really sure that Swift is the language I want to use. Objective C is good enough. It's good old C which I like. It's very dynamic which I like. Cocoa, Cocoa Touch and other frameworks are made for Objective C, not for Swift. I didn't made a final decision whether I will invest into Swift, but probably (at least until Apple declares Objective C obsolete) I will just use Objective C. It has its problems, but it has its strength too.


Many of those annoying sourcekit crashes thankfully got fixed in a recent update (Xcode 6.1.1)


"apple shouldn't release it" is IMHO clearly wrong. They were absolutely right to release it when they did, at a stage where it was just about stable enough to write working apps but many of the features of the language were still being iterated on. Yes that means the language definition isn't yet stable, but the huge advantage us that iOS devs have the chance to influence the development of the language and it's libraries.

Whether or not it's the write time to use it in production is another separate issues that will depend on the app. For fairly simple applications it seems like it's fine to use it now. There is talk that Apple have banned use of swift within the company. That's obviously false, otherwise they wouldn't be able to further develop the language. I do fully expect that to use swift in a production project you would need high level authorisation and probably close coordination with the swift dev team. That would just make sense.


I attended a Swift workshop (hosted by Apple) on my campus today. After the workshop, I asked one of the Apple engineers what he recommended in terms of developing iOS apps. He told me that he hadn't even seen what Swift looked like until today, that Apple employees are banned from using it (and that they actually have code checkers to make sure), and that he wouldn't learn it solely w/o Obj-C until a few years from now. He noted that Apple is still changing it a lot, as it's young, so the structure of the language could change dramatically between now and next year.

He thought it was good idea when I suggested learning Obj-C and then using Swift to cut down on dev time, b/c it is quicker for many things.


I think a lot of the blame for the backlash in the iOS community over Swift should be laid squarely at Apple's feet. At WWDC they pitched it as production-ready but the truth is that even today it is seriously unfinished. It doesn't even support incremental compilation and the tooling is still very fragile. I'd strongly recommend anybody new to iOS to start with ObjC for now. You need to at least be able to read ObjC to understand the APIs and all of the sample code out there and it's still overall a more productive environment.

I don't think any of Swift's current problems are unfixable but I'd give it another year or so at least to mature.


I think Apple's internal policies regarding employees use of Swift for Apple's own software dev should be published as part of the Swift documentation. If it's not good enough for them, it's not good enough for me, but as they gradually change their policies, I'll probably change mine.


I used it this last week. SourceKit would crash all the time. Xcode would crash occasionally. There'd be spurious warnings. Very poor quality warnings. Stuff like "missing argument" and "extra argument" when the class is abstract.

And I'm not sure about this, but the documentation is also off in a lot of places. Essentially anywhere there is a 'setX' is meaningless because that function won't actually exist even if the (Swift) page for it claims it does because in most case you just access the variable.


Small parts of Genius Scan are written in Swift. It's working fine.

In theory it's nice to work with, as it forces you to think everything more carefully and consider all error/nullable cases. In practice, integration with XCode is still full of bugs, code completion is crashing all the time, Swift classes show up as missing symbols in Objective-C (but the project compiles fine)... So, it's a bit painful and it slows down the development process.

We will keep it to very small and well-defined pieces of code for now. It's good to learn about it, but it's not productive.


I think slow compile times and the stability of Xcode are the two biggest complaints. It should only be a matter of months before these issues are addressed. Now is probably a great time to start learning. Btw, I've collected over 500 Swift urls over the past several months. My hope is that iOS developers will soon have everything they need to make a quick migration to the new language.

http://www.h4labs.com/dev/ios/swift.html


I wouldn't use it yet for real projects. Even getting the compiler to work can be tricky sometimes. For example, when writing a function with generic argument constraints, I sometimes had to flip the LHS and RHS to get things to compile where it made no logical difference. (e.g., S.Generator.Element == X instead of X == S.Generator.Element).


We have been using Swift for a complex production app since August, there are a few issues like SourceKit crashing very often and some tools like the memory report inside Xcode doesn't seem to work properly (Instruments works fine though). Other than that Swift has been solid and you should definitely use it for new projects.


I have already used it for new projects and was glad I did. Yes there are some teething issues, but the small amount of pain is manageable and the productivity improvements are very worthwhile. I start all new projects with Swift now whenever appopriate.


Using Swift for sometime here. The language itself is great and I find myself generally more productive.

The annoyances are not with the language, but with the tooling. Slow auto-complete and lack of incremental compilation are my wishes for Apple to fix soon.


This discussion seems relevant: https://news.ycombinator.com/item?id=8887545

I took his course a few years ago when I got started programming, it was great.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: