9 ms·
I've been learning Swift in recent months, and as part of that process I wrote a short book about the language. It's aimed at developers (like me) who can alre
by aidanf 11y ago
I've been learning Swift in recent months, and as part of that process I wrote a short book about the language.
It's aimed at developers (like me) who can already program in a language like Ruby or Python and are looking for a quick tour of Swift.
It's available to read for free online at http://books.aidanf.net/learn-swift http://books.aidanf.net/learn-swift
I'll be adding stuff about yesterdays announcements in the next couple of weeks.
- NicoJuicy 11y agoWith what did you create the ebook?
- aidanf 11y agoI used Softcover (https://www.softcover.io/ https://www.softcover.io/) to generate the ebooks.
- acoleman616 11y agoSoftcover is awesome. (It's a Michael Hartl creation.)
- lsjroberts 11y agoThanks for sharing it :) just fyi, the .fixed header overlaps the content making links unclickable if they are in the top part of the page
- aidanf 11y agoThanks for letting me know, I hadn't noticed that.
- CornishPasty 11y agoI believe you just need to remove 'margin-bottom: 2em;' from .top-bar in styles.css
- aidanf 11y agoThanks, I'll try that. Although I'm reluctant to clear the cache until it goes off the HN front page :)
- brador 11y agoThe ebook is great, but it's missing complete start to finish examples. Pad it out with them and you could double the price (and it would be massively more helpful!). Maybe a todo app, flappy bird clone, etc.
- aidanf 11y agoThanks for the suggestion. I think I'll add another chapter at the end that walks through a longer example start-to-finish.
- sswaner 11y agoNot sure if you have a better method for getting feedback. First sentence in 12.6 has a minor typo: "“Subscripts allow you *do define a way of allowing your class”
- geuis 11y agoWould you mind removing or moving all of the position:fixed stuff on the left? Makes it impossible to read the site on mobile.
- aidanf 11y agoWas it the share buttons? I tested these on iphone and they dropped to the bottom of the page. But it looks like they only do this for phones below a certain resolution. So I've removed them.
- geuis 11y agoYep yep. Just put em somewhere where they're static, or use a media query to position:static on < 768px. Excited to read the book now. =)
- tjl 11y agoIt looks like you're looking at an earlier version of Swift at least based on the fact that you're talking about Xcode 6.1 at the start. If you're covering 1.2, you probably should update that.
- aidanf 11y agoThanks. The code is 1.2, but the Xcode references are out of date. I'll update soon, I'm also going to update the whole thing to Swift 2 when it's released.
- BuckRogers 11y agoGreat timing on the post. I'm a Python(2) user who is always on the lookout for the next language to jump to since I'm never moving to Python3. With Swift on the server and iOS, and being a very pleasing language similar to Python, this will be what I study next as I look to migrate off Python2 as it dies (which itself may take a while). Thanks for posting this.
- Lofkin 11y agoTake a look at julia!
- FungalRaincloud 11y agoOut of curiosity, why are you avoiding Py3? I've not touched python in a couple years. I was thinking of taking it back up, just to be more familiar with it.
- x5n1 11y agothere is nothing wrong with py3. some people just want to be ornery.
- BuckRogers 11y agoAs the other guy who replied said, there's nothing explicitly wrong with it. But it's not to be ornery. I think it only appears that way to people who haven't thought it through. I don't owe GVR or the core dev team anything. Certainly not thousands of man-hours to make their new, unnecessarily breaking version of Python3 to be successful. It's that going from Python2, it's mere technical churn. Python3 has zero technical innovation. It's just a different way of doing certain things, nothing more. Unicode was supported in Python since 2.6. Print was a statement rather than a function. Std lib cleanups. So what? Bigger fish to fry in the world than that. All of the new features, can, and do work on Python2 in the form of backports. It breaks everything I've ever written, for no good reason. I also end up with a much smaller pool of libraries to choose from for new projects. It makes no sense. In a microcosm of the universe where Python was the only game in town, Python3 would have worked out. Instead of moving to 3 and losing many advantages for churn, I can just go spend time with something else. Swift is pretty what I'd design if I could pick and choose features, so it's perfect for me- excited I'll be able to use it serverside while simultaneously learning the language for iOS. Also, people frequently cite that moving from 2->3 is easy. It is. But they somehow forget that testing old, large projects is extremely labor intensive and always results in breakage. Unless you have 100% test coverage, which I know no one who does.
- rshaban 11y ago"For anyone who has been programming in a modern language such as Ruby [1995], Python [1991], Clojure [2007], Haskell [1990], etc, and who was put off developing iOS apps by Objective-C, Swift marks a new era." You say modern but I don't think it's really what you mean here. Your descriptions of Ruby vs Obj-C make it seem that really what you mean is high-level; that is, to a newer programmer, easier. These languages (Haskell excepted) make it very easy to do simple things. Describing them as "modern" in contrast with the implicitly antiquated Obj-C makes it a little hard to take your assertions seriously. Verbosity is a claim to make, age is not.
- antoaravinth 11y agoOnline version of reading has complete book?