When the personal computer was new, there was a language named BASIC. BASIC was easy to learn and, more importantly, it was easy to experiment with. Early versions of BASIC were interpretive, meaning you typed and ran, edited and ran again. You didn’t have to wait for your code to compile and link. Make a change to the program, run it immediately. BASIC was so easy to learn and work with, pretty much anyone could learn how to program.
Apple’s new Swift programming language is designed, over time, to replace Objective-C. Swift is much easier to grasp, though not nearly as easy as BASIC, since Swift is designed to support much more complex tasks. But Swift is much, much easier to grasp than Objective-C.
Like BASIC, Swift is a real joy to play with. Swift is perfect for rapid prototyping. Using Xcode’s Playground environment, you can make changes in your code and immediately see the results. You can build a little freestanding animation, then run that animation in a scrubbable timeline, tweaking the code as you go.
The linked article is thoughtfully written and goes into a lot more detail on Swift. If you are about to take the plunge, or are considering getting into iOS development for the first time, this is well worth reading.
When I first started developing iPhone apps (I wound up building 40 silly little pinpoint apps), Apple would not allow any books to be written on the topic, and put everyone programming for iOS under NDA, so there were no educational resources allowed at all.
I lived through that experience, as a coauthor of one of the very first iOS development books. This is not an understatement. NDAs were a necessary evil, but we did curse them.
But that’s changed tremendously in the years since the iPhone first came out. And, now, with Swift, the doors for iOS development may well have been blown open to a new generation of programmers who may be able to recapture that exploring spirit of wonder that the first Apple II BASIC programmers had when they got their first personal computers.
If you’re a registered Apple developer, you can download the Xcode 6 beta. Even if you’re not a registered Apple developer, you can download the Swift programming guide from iBooks for free.
If you are thinking of taking the plunge, go get the iBook. Even better, sign up as a developer, download Xcode and open the book as a playground from within Xcode. You’ll play as you learn. An incredibly fun experience.
Hi 🙂
When you state “open the book as a playground from within Xcode” are you being literal?? or do you simply mean code snippets?
Thanks
He’s being literal 🙂 You can download a chapter of the book as a playground which you can simply load in Xcode and be able to work interactively with the code.
One point of note, the iBook says “Open this chapter as a playground” but you won’t see a way to do that. In reality, you have to download the chapter as a playground from the pre-release documentation on the Apple developer site.
Thank you for replying 🙂 much appreciated …
This is going to be awesome – !!!!!!
Can you elaborate a bit on this? I haven’t found the right link yet… 🙂
The thing separating BASIC from any modern language today isn’t whether it’s interpreted or compiled or whether the syntax is more or less like English.
It’s the overwhelming number of libraries, parameters, etc. Also, object oriented programming, while great, is not as easy as the procedural, step-by-step logic of BASIC for a beginner. Especially when you’re coding in Cocoa, you’re moving back and forth to code snippets that are sort of connected by a man behind the curtain. You rely on the OS and the compiler to do probably 99% of the work. You read the book on Swift and you learn to do exactly nothing in Cocoa. Beginning/hobbyist programmers aren’t going to easily distinguish the two. They are going to want to know “how do I make a program that does x,y,z”
I’m not saying any of that is bad or should be undone. It’s just the comparison to hobbyists and BASIC is inapt because the universe of things you could do was very limited and today it’s almost unbounded.
Check the second page of the chapter Swift Tour in the Swift Programming Language doc on Apple’s iOS 8 dev site. There is a link called “Open Playground” to download a zip of playground files to go along with the book.
Thanks, found it!
If we’re talking about BASIC vs “new” languages there really isn’t as much of a difference as you think regarding the libraries.
Libraries and APIs are just “gosub” blocks that you didn’t write. Instead of “go sub 15020” to check for a sprite collision you (making this up) you call “if spritestatus(main character)[collision] == ….”.
External libraries were always possible with BASIC and I seem to recall some companies actually selling such libraries back from my OS-9 days on the CoCo (neither having anything to do with Apple) where you could actually include other files to your program.
I was thinking the same thing on Monday. VB was fun and made programming on Windows accessible. It certainly lacked depth which meant that large programs were difficult, if not down right impossible.
Swift, REPL, iOS/OSX are fun. I’ve had more fun in the last couple of evenings than I’ve had in a long time. And there is depth which means anything is possible, not just simple programs.
And for all you old Mac guys, remember HyperCard? Remember the fun? That’s what we’re talking about with Swift.
Also, they’ve posted some of the Swift sessions at developer.apple.com/videos. It looks fantastic!
Definitely give the Swift videos from the WWDC sessions a look if you’re interested in delving into Swift. The sessions cover some interesting aspects that the book didn’t – at least the first 40 pages I went through for the overview 🙂
Plus, the sessions make some concepts that the book glosses over more clear.
When you’re doing a GOSUB you can follow where it goes. Yes, there were external libraries, etc. But GOSUB is exactly what is missing from non-procedural languages. This is a good thing, not a bad one, but it is harder for the first day beginner to understand.