> Unfortunately 95% of the complexity is in the massive API set, not language syntax.
Can't agree with this more. I'm a web developer (with Scala experience) and was watching the WWDC live streaming. As soon as I heard about Swift I had just one aim - download Xcode 6 and give the playground a go. Within two days, I managed to go through the iBook on Swift. But I still don't have a single app ready. Most of swift tuts teach only about the language and the Obj C tuts are hard to port (for a beginner). The new language is surely more approachable to newcomers but its still going to take time to learn the Cocoa framework, Storyboard and other parts involved in building an app.
That said, the Cocoa/iOS ecosystem has better resources for diving deep into its style and capabilities than any other I have worked with.
The Big Nerd Ranch set of books [1] is fantastic. It explains "how we do things" and "how we learn about new things" for its community better than any other book for any other community I've tried. It doesn't just teach a language or show a few examples, but actually walks you through the experience of reading documentation for, playing around with, and ultimately building a finished app using a new API or part of the ecosystem. After you're done with the books, there is plenty to learn, but you know where to look and how to go about doing it.
Then I compare that to what it took me to become a web programmer. While it seems "easy" now, the amount I had to read about http, OSes, browsers, the dom, security, performance, etc. is astonishing. Without any of these topics, I would have made terrible mistakes. And each of these topics was covered in a separate book, which often showed best practices for that topic mixed into code using poor practices with regard to the other topics.
You are right, but I really want to be optimistic here. The moment the language is stable and officially released this fall, I am expecting Apple to give a "Swift treating" to its entire toolchain, including the APIs written in Objective-C and C. This won't happen in a couple of days, obviously, more in a couple of years or even more.
But we SHOULD expect this, sooner or later, otherwise Apple will be stuck to support Objective-C for long. The whole point of Swift is to make the entire development endeavor easier, thus Objective-C should eventually become deprecated. This can happen only when the APIs are rewritten from scratch in Swift, something that will take a lot of time.
(do not worry, even if Objective-C becomes deprecated, we should expect at least 5-10 years before it becomes completely outdated to the point that Apple drops it entirely)
YES, how can we spend so much time on the 10 things a programming LANGUAGE consists of? Vendors: Get things right (so you won't trap yourself). I am not interested in your switch statement syntax NOW & I'll just pick it up and just use it THEN (including it's quirks, but hopefully vendors learn)
Yes, Cocoa is very complex. But I hope that a language like Swift will make it easier to come up with high level libraries that hide some of that complexity. We'll see what happens. Personally I feel that with Swift instead of Objective-C I lost a millstone around my neck...
Yes yes yes. I'm currently porting a Alpha prototype app from Obj-C to Swift and I was telling someone on last Sunday that "Swift won't save you." The syntax is great, but it ignores so much of what's complex about building an iOS app. With the new Adaptive Layouts, the layout engine is now more complex, knowing the delegate methods is still crazy, Xcodes native auto-complete is still hot garbage and you're still going to need to understand obj-c in some capacity if you're using any legacy libraries. Swift is best if you already knew what you were doing. I guess it looks nice for newcomers, but we'll see how people take to it over the next few months.
I got mixed feelings from the presentation I have done on Swift, most of the presents were scared by the huge size of the language and the mixing of functional and Object Oriented programming, which can lead confusion into developers, mainly the not so experienced ones.
Any other comments?
As one who has shied away from IOS development because of Objective-C it looks pretty attractive. My own background is C#, Python, Javascript and a smattering of Java and Groovy. Swift has whetted my appetite to revisit IOS development again, there's lots of familiar looking stuff there. I could probably become dangerous in a couple of weeks or so, but effective inside a month. Sure I'd need to learn the IOS SDK but that stuff is very well documented.
That said I'm a developer with around 20 years experience under my belt so the ability to learn new stuff quickly is in the blood, and I've got the advantage of working for many years with different development paradigms.
I personally really like it. I don't believe it will simplify life of non iOS programmers, but I find it a big step forward. The syntax is very clean and flexible and the functional construct will make the code much compact and readable when we will get used to the new constructs (imho some experience with Haskell, or any other functional and typed language will be quite useful).
And in principle it can revolutionise the way scripting works in OSX. From the few test I've done, when it will be stable it will be a fast nice replacement for many of my python, sh and ruby scripts.
Moreover, I think that this can set the basis for a better and simpler concurrency model in iOS too. But we will see.
The only thing I find disappointing and error prone is the different passing behavior between structs and classes, but I assume that we will get used to it.
Swift looks wonderful to me as a JS/Python developer who's recently got into Haskell a bit. It looks like my dream language, really. It's statically typed with type inference (the benefits of typing without the drawbacks), it compiles to native code (it's fast), the syntax is modern, and it encourages immutability. If it weren't for it being OS X/iOS only, I'd write in it.
C, C++ and Java developer for the last 30 years, but NOT a CompSci major.
Swift is great! Even with my exposure to various C+Objects syntaxes over the years, Objective C just makes my eyes hurt. I wrote a couple of iOS apps and I never got used to it. I just don’t care for it. It’s really just a matter of personal prefs, I think, because others really like Obj-C and I grant that it must be possible! ;)
The Swift syntax is airy and easy to read. I felt like I was breathing fresh air, if that makes any sense. I converted the SpriteKit walkthrough PDF examples to Swift from Obj-C as I went along. Very straightforward. There were a couple of things that took a few minutes to figure out, but it was all very logical. The Cocoa APIs seem to fit Swift nicely.
I am very happy about this new language. As someone else said above, its like a heavy weight has been lifted. It really is that affecting.
The Scala folks like to say that newcomers can start with procedural OO and then slowly grow into the functional mindset. Developers don't need to learn and use all the language features from the get go. I suppose that the same advice applies to Swift.
Having said that, Swift is not nearly as intimidating as Scala.
As you say in one of the slides, the main difficulty of iOS programming is the API.
You're presenting mainly the language, which makes senses but might be already ticking boxes with at least part of the audience here which is already familiar with Haskell, or Rust, or OCaml, etc.
So, it's great to see the features and syntax, but what would be great is use Swift to make a tour of the API for iOS newcomers :)
Straight into Swift, it's the future of iOS development. That being said, you'll spend most of your time studying API's and the "Apple way" to create apps, so if you have to learn Obj C eventually, it's not going to be a big leap.
* For those unfamiliar with Aaron, he's one of the foremost authors and teachers of Mac and iOS development -- going all the way back to NeXT. He's gonna be a little biased towards Objective-C, but what he has to say is definitely of interest.
If one had done Ruby programming in its early days, he/she would come across an epiphany. I tried swift and the best part was the similarity to Ruby and the ease of use. Plus, loads of built in lib functions just make development easier. Added to that, the amazing lldb support for Swift is wonderful.
But what's not so great?? The fact that there will be two languages with greatly different syntaxes in the same file. It would just remind you of the initial days of iOS programmer's surge when many realised that Objective C file could also contain C code.
Some find this mixture of languages fun, and some would probably not feel the same.
If the acceptance is the same as it was for Objective C, maybe this is the Objective C 2.0 successor.
The languages won't be in the same file. They can be in the same project, of course, but at least they'll be separated. It means you can write a class in one language and use it in the other language, without having to worry about it breaking.
Regarding the slide with the Objective-C book on the trash can, probably don't want to throw that out if you want to make use of C or (C++ in your .mm file). Can you do that with Swift? Game programmers write C++ a lot.
It can be difficult to gauge presentation tone for completely unknown audiences. If the audience for the presentation was mostly a group of "corporate friends" with unknown common technical background, it probably went well. If the audience was a bunch of unrelated HN people who want information _now now now_, a meme every other slide is a bit tiresome.
(gratuitous self promotion): I'm starting a long-form intro-to-Swift ebook series: https://matt.sh/books — no meme graphics, guaranteed.
The first book was released yesterday and more are on the way!
I haven't seen it mentioned how you would do composition in Swift. I assume it has a feature like Scala's traits –– hopefully with a better syntax? Does anyone know?
[+] [-] krat0sprakhar|11 years ago|reply
Can't agree with this more. I'm a web developer (with Scala experience) and was watching the WWDC live streaming. As soon as I heard about Swift I had just one aim - download Xcode 6 and give the playground a go. Within two days, I managed to go through the iBook on Swift. But I still don't have a single app ready. Most of swift tuts teach only about the language and the Obj C tuts are hard to port (for a beginner). The new language is surely more approachable to newcomers but its still going to take time to learn the Cocoa framework, Storyboard and other parts involved in building an app.
[+] [-] asolove|11 years ago|reply
The Big Nerd Ranch set of books [1] is fantastic. It explains "how we do things" and "how we learn about new things" for its community better than any other book for any other community I've tried. It doesn't just teach a language or show a few examples, but actually walks you through the experience of reading documentation for, playing around with, and ultimately building a finished app using a new API or part of the ecosystem. After you're done with the books, there is plenty to learn, but you know where to look and how to go about doing it.
Then I compare that to what it took me to become a web programmer. While it seems "easy" now, the amount I had to read about http, OSes, browsers, the dom, security, performance, etc. is astonishing. Without any of these topics, I would have made terrible mistakes. And each of these topics was covered in a separate book, which often showed best practices for that topic mixed into code using poor practices with regard to the other topics.
[1] http://www.bignerdranch.com/we-write/
[+] [-] kensai|11 years ago|reply
But we SHOULD expect this, sooner or later, otherwise Apple will be stuck to support Objective-C for long. The whole point of Swift is to make the entire development endeavor easier, thus Objective-C should eventually become deprecated. This can happen only when the APIs are rewritten from scratch in Swift, something that will take a lot of time.
(do not worry, even if Objective-C becomes deprecated, we should expect at least 5-10 years before it becomes completely outdated to the point that Apple drops it entirely)
[+] [-] mqsiuser|11 years ago|reply
[+] [-] solarexplorer|11 years ago|reply
[+] [-] joeblau|11 years ago|reply
[+] [-] gscalzo|11 years ago|reply
[+] [-] teh_klev|11 years ago|reply
That said I'm a developer with around 20 years experience under my belt so the ability to learn new stuff quickly is in the blood, and I've got the advantage of working for many years with different development paradigms.
[+] [-] mseri|11 years ago|reply
And in principle it can revolutionise the way scripting works in OSX. From the few test I've done, when it will be stable it will be a fast nice replacement for many of my python, sh and ruby scripts.
Moreover, I think that this can set the basis for a better and simpler concurrency model in iOS too. But we will see.
The only thing I find disappointing and error prone is the different passing behavior between structs and classes, but I assume that we will get used to it.
[+] [-] TazeTSchnitzel|11 years ago|reply
[+] [-] eludwig|11 years ago|reply
Swift is great! Even with my exposure to various C+Objects syntaxes over the years, Objective C just makes my eyes hurt. I wrote a couple of iOS apps and I never got used to it. I just don’t care for it. It’s really just a matter of personal prefs, I think, because others really like Obj-C and I grant that it must be possible! ;)
The Swift syntax is airy and easy to read. I felt like I was breathing fresh air, if that makes any sense. I converted the SpriteKit walkthrough PDF examples to Swift from Obj-C as I went along. Very straightforward. There were a couple of things that took a few minutes to figure out, but it was all very logical. The Cocoa APIs seem to fit Swift nicely.
I am very happy about this new language. As someone else said above, its like a heavy weight has been lifted. It really is that affecting.
[+] [-] vyshane|11 years ago|reply
Having said that, Swift is not nearly as intimidating as Scala.
[+] [-] hbbio|11 years ago|reply
You're presenting mainly the language, which makes senses but might be already ticking boxes with at least part of the audience here which is already familiar with Haskell, or Rust, or OCaml, etc.
So, it's great to see the features and syntax, but what would be great is use Swift to make a tour of the API for iOS newcomers :)
[+] [-] dotnick|11 years ago|reply
What would you recommend to someone just starting out in iOS, starting with Obj-c or diving straight into Swift?
[0] https://news.ycombinator.com/item?id=7875208
[+] [-] beggi|11 years ago|reply
[+] [-] gdubs|11 years ago|reply
http://www.bignerdranch.com/blog/ios-developers-need-to-know...
* For those unfamiliar with Aaron, he's one of the foremost authors and teachers of Mac and iOS development -- going all the way back to NeXT. He's gonna be a little biased towards Objective-C, but what he has to say is definitely of interest.
[+] [-] abhilash0505|11 years ago|reply
But what's not so great?? The fact that there will be two languages with greatly different syntaxes in the same file. It would just remind you of the initial days of iOS programmer's surge when many realised that Objective C file could also contain C code.
Some find this mixture of languages fun, and some would probably not feel the same.
If the acceptance is the same as it was for Objective C, maybe this is the Objective C 2.0 successor.
[+] [-] AlexanderDhoore|11 years ago|reply
[+] [-] gbrhaz|11 years ago|reply
[+] [-] leorocky|11 years ago|reply
[+] [-] tvon|11 years ago|reply
[+] [-] hengheng|11 years ago|reply
[+] [-] seiji|11 years ago|reply
(gratuitous self promotion): I'm starting a long-form intro-to-Swift ebook series: https://matt.sh/books — no meme graphics, guaranteed.
The first book was released yesterday and more are on the way!
[+] [-] picardo|11 years ago|reply
[+] [-] gress|11 years ago|reply
Implementation is currently strictly based on single inheritance with open classes (through extension).
[+] [-] krat0sprakhar|11 years ago|reply
[+] [-] matthewmacleod|11 years ago|reply