Hacker News new | past | comments | ask | show | jobs | submit login
Learning to code as a 30-year-old kid with Apple’s Swift Playgrounds (arstechnica.com)
143 points by shawndumas on July 14, 2016 | hide | past | favorite | 69 comments



We play tested this with 10 year olds at the San Francisco Public Library recently and the kids LOVED it -- keep in mind, these were not middle or upper middle class privileged kids, but lower income at risk ones.

The challenge is that after about 45 min of "play" time, they want to 'build' something and create--and Playgrounds doesn't provide the environment to do that. Then, they get bored and feel encumbered.

After working with over 1000 kids in our beta phase, we've tested almost every product on the market.

I personally like Scratch + Learntomod.com which uses Minecraft to teach Javascript and CodeCombat.com (My YC batchmates).

We're soon launching an online course (for a nominal fee) that has progression, milestones, and support for parents who want their kids to 'complete' a project. Message me or check out our beta site if you're interested to in being a beta tester for our online product--would love to hear from you.


I think you need to dig deeper into Swift Playgrounds. The iPad user can definitely start their own playground outside of the preprogrammed ones provided by Apple.

In addition, you as a developer can create additional playgrounds in Xcode and transfer them to Swift Playgrounds on the iPad. That means you can give the kids a basic template and allow them to fill in the code. For example, create a template with a couple of pages with the imports already complete and a basic template of empty procedures to get them started.


And from watching the WWDC session it seems the playgrounds can have access to the whole iOS SDK, including rather fun stuff like corebluetooth so there is a huge amount of potential in Playgrounds.


I just did an experiment of upload XCode playground to iPad via AirDrop. It worked.

https://twitter.com/ontouchstart/status/753801598367731712

However, with the .playgroundbook format (folder), it seems that I can only export it to Mac (as a folder) and can not AirDrop back to iPad. And it seems that XCode 8 beta-2 does not support playgroundbook yet.

I am keeping an eye on Apple documentation:

https://developer.apple.com/library/prerelease/content/docum...


I was going to message you but do not see any contact details in your profile.

Pasting your website, lead me to your contact link of team@futureleague.co ... is that best place for us to message you?


Do you have a link to Scratch? I'm having trouble finding it.




We're soon launching an online course

Who is we?

btw - Every time I see a bunch of 130+ IQ engineers tackle education problems, I get optimistic about the future.


130+ IQ doing anything about any problem does not me give any hope unless those doing have a good understading about it. So far engineers have shown "if the only tool you have is a hammer…" attitude towards the problem than any other.


How do you know their IQs? I don't think I've ever heard anyone discuss their IQ in real life. I don't mean this as an attack; I'm just curious where the "130+ IQ" qualifier comes from.


I'm just saying that I like seeing smart people work on education.


I've been using it since the day the beta came out. I've been an Apple fan for a long time but I think this might be the best thing they've ever done.

It makes programming approachable to nearly anyone on a device that's approachable to anyone that can afford it.

I heard someone on one of the TWiT podcasts talking last week about teaching their 6 and 8 year old to program using it and that they were talking about creating real-life functions to do household tasks IIRC.


I must admit I initially thought the idea of this app was a bit silly, but after giving it a try yesterday I believe it is some of the best software developed by Apple in recent years.

I ended up working through about half of the first Learn to Code module and had a great time even as an experienced programmer. Hopefully those new to coding will also find it to be an enjoyable experience.


I've been looking for something similar to this for my 12-year old son. Are there any other resources you guys can recommend to help teach coding? (that aren't Apple-product dependent?)


You've been looking for something similar, discovered that this "something similar" exists, yet the Apple logo puts you off? A used iPad that can run this is probably a couple hundred dollars.

Now, perhaps I've misinterpreted your question, and you'd just like a list of alternatives to keep your options open. I've not looked really hard, not having any kids and all, but there seems to be a dearth of options that meet the (IMO) high bar Playgrounds has set. Me, I wonder if the 2nd-best alternative isn't an old machine with QBasic on it. I just don't see anything else out there that doesn't start with "Step 1: Let's learn about dependency trees!"


Maybe they want to use existing hardware?


Why is parent getting down voted, not wanting to spend a couple hundred bucks, specially outside of the US where a couple hundred bucks can be what you make in a month, is a perfectly valid reason.


Well, I obviously didn't down vote it. But if that were a consideration it should have been mentioned, along with what that existing hardware is. Hence my question, because as-worded the motivation comes across as just an allergy to Apple logos.


No it doesn't. It simply asks for something that will work on a platform other than those owned by Apple. It's an entirely reasonable request, and I'm baffled that people on a web site called "Hacker News" are suggesting otherwise.


HyperCard is great for this, but it's system requirements are likely a little too ancient.


There is a next generation implementation of hypertalk, livecode. It began life as metacard (a hypercard clone) and has now evolved to something that can export to mobile, html5 and multiplatform applications. Basically you program in simple english with a smalltalk message passing philosophy.

https://en.wikipedia.org/wiki/LiveCode


A proud user of MetaCard and RunRev for many years! Although these days js, Obj-C, and other more traditional languages are my bread and butter.


Scratch is really great. It's free, and kids can publish their work online. Being able to see what other people are doing, tinker with their work, and show off your own projects was a big draw for my son.

It's a visual programming environment, so moving into a second more traditional (text-based) programming language is a non-trivial step, but scratch gets you thinking in terms of algorithms, teaches about what variables are and why they matter, loops and conditionals, etc.


I really like nand2tetris [1] in which one builds a computer from NAND gates upwards. You build the ALU etc., an assembler, compiler, a OS and VM on which you can run your own version of tetris, snake, whatever. It doesn't teach programming directly, but could be used to teach programming when the first parts are reached that require programming (I believe it was Chapter 6 - Assembler).

The hardware part of the course is also available on coursera now. [2] Previous discussion on hn [3].

[1] http://www.nand2tetris.org/

[2] https://www.coursera.org/learn/build-a-computer

[3] https://news.ycombinator.com/item?id=5888705


When my son was around 12 years old we gave him the book "Hello World: Computer Programming for Kids and Other Beginners." It teaches programming with Python and targets making games and was perfect for him. Five years later now, he's really a great programmer, proficient with many languages and techniques. Here's his github site: https://github.com/zyedidia


Being an open source language that also runs on proprietary platforms, Swift can teach people programming from many different points of view.

1. Getting familiar with the platform and toolchains. We all know that these toolchains will be obsolete when your kid grows up. But we have to start from somewhere.

2. What matters is the creative exploration via programming. Whether your kid ends up becoming a Swift (or an iOS) developer is a different matter.

3. One of the advantages of Swift playground on iPad is to liberate the swift learning experience from XCode, which requires you to buy an Apple computer. Another one is being touch native, the design and programming experience will be different from the traditional keyboard and mouse.

4. On the other end, with open source swift on Linux, kids also have opportunities to learn lower level non-graphic programming all the way down to llvm (http://llvm.org/) on portable Linux platforms such as Docker and the cloud. Again, whether your kid ends up being a "server programmer" is also a different matter.

Here is an example of a non-graphic interactive "playground" (https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93prin...) for the same language. https://asciinema.org/a/79773

Although it won't deliver the same kind of user experience as Apple product, but there is no reason to believe that kids can only learn from traditional GUI. And to be honest, nobody knows what the future user and programming interface would be.

Kids will find out themselves.


Swift is open-source now, so it's not really Apple-dependent. Using the Swift Playgrounds doesn't mean your kid will be locked into the Apple ecosystem.


There's nothing usable you can write in Swift that would run on other platforms. Lack of cross platform standard library makes portability only a lip services, "opensource" or not.


Actually, Foundation is being ported to Linux and there are already quite a few third-party libraries out there. I am successfully writing cross-platform server-side applications in Swift.

https://github.com/open-swift https://github.com/VeniceX https://github.com/Zewo



I teach my 6yo son using Pyret and Racket simultaneously. Pyret is, hands down, the best teaching language today, but hasn't been in use as long as Racket, so there aren't as many resources.

https://www.pyret.org

http://www.wescheme.org

https://docs.racket-lang.org/drracket/

http://www.ccs.neu.edu/home/matthias/HtDP2e/

http://www.bootstrapworld.org

Someone below mentions Khan Academy. It's approach is similar and stays on the straight-and-narrow in its use of Javascript:

https://www.khanacademy.org/computing/computer-programming


A few suggestions, in no particular order:

- Pico-8 (Lua)

- Love2d (Lua)

- Scratch (visual coding)


The Community Edition of Livecode is interesting. It's the closest thing out there to a modern Hypercard successor.

http://downloads.livecode.com/livecode/


Elementary School Coding & Robotics Resources https://docs.google.com/document/d/1r1b2CM1uTdST47IbWa7zlZYm...

referenced here: http://www.livebinders.com/play/play?id=810282

Unfortunately the bigger the list, the less likely profitable info has been highlighted. I also didn't note where I found this info; bummer.


Khan Academy's programming environment might have some useful content: https://www.khanacademy.org/computing/computer-programming

It's a live programming environment with instruction to go along with it.

(Disclaimer: Used to work there; didn't work on CS)


As I wrote in my post above, I'd suggest Racket with the book 'Realm of Racket'.


The raspberry pi3 is a great way to learn raspbian comes with Scratch built in.


Swift Playgrounds looks great but I'm surprised no one has mentioned the frustration that Apple is shipping something on iPad that other developers have been banned from making since iPad shipped

From the Swift Playground website:

> Send your code to a friend’s iPad using Mail, Messages, or AirDrop

No other apps are allowed to do this because of the iOS Terms of Service restrictions


Codea has been around for a few years now. It lets you code iPad apps on the iPad using Lua. You can even export the project to Xcode so you can eventually deploy your creations to the App Store. And this is certainly not the only iOS-based coding environment. It looks like Apple has knowingly made an exception for this use case because it's not the type of thing they had set out to prevent with their rules around loadable code. Apps like Codea bring a lot of value to the platform.

http://twolivesleft.com/Codea/


The terms of service only disallow downloading code. As long as codea only allows copying and pasting code it's not breaking any terms

You can see this is how they handled it

https://bitbucket.org/TwoLivesLeft/core/wiki/CopyingCode

Swift Playground doesn't seem to have that limit which arguably makes Swift Playground a whole lot better and arguably anti-competitive


Wow; very cool! I've been hoping for something like this ever since I read Bret Victor's essay "Learnable Programming":

http://worrydream.com/LearnableProgramming/


Pythonista does the same since months, just for Python code.


That's great but unless they're running Python in WebKit it's actually against the current terms of service

> 3.3.2 An Application may not download or install executable code. Interpreted code may only be used in an Application if all scripts, code and interpreters are packaged in the Application and not downloaded. The only exception to the foregoing is scripts and code downloaded and run by Apple's built-in WebKit framework, provided that such scripts and code do not change the primary purpose of the Application by providing features or functionality that are inconsistent with the intended and advertised purpose of the Application as submitted to the App Store.


You can even do little web servers in Pythonista and access it from the browser. I didn't think iPads allowed that sort of thing.


By now, people are used to being dicked around by the masters of whatever walled garden they choose to play in.

It's not like this sort of behaviour is new to Apple (or any of their competitors) .


Aww, this is basically a really slick version of Stanford's 1st CS106A (intro CS) assignment, Karel the Robot!

(After some googling, apparently it goes way back: https://en.wikipedia.org/wiki/Karel_(programming_language) )


I've been hobby-trying to learn swift on Udemy for a few months. I'm going to try this out. (I'm 35!).


It seems nice and polished like most Apple products. I'll try it out more, and then with my baby girl when she's a bit older. Apple needed to start addressing the software end a bit more.

For me, I guess having started in 1979 with a Commodore PET and basic and assembly, it doesn't have the appeal. I tried Kotlin a year ago, and Swift looks identical to it to me. I believe in the gamification concept, I just think it is from an adult's view on what they think a child likes, which I guess is inescapable unless you do constant targeting studies and updates. In the end, have children design what children like with an adult's skills at hand to realize it.

I use Codea, Pythonista and now Continous (.NET/F#/C# on an iPad Pro) [1]. I can write add-ons and actions for my iPad apps in Pythonista (Editorial and others) to extend them. I am a polyglot and Scratch is not something I would use to teach my kids, not for any enumerable reasons other than I tried, and it didn't appeal to my kids after the first animation demo program. I know it has been somewhat popular. My older teenage children fared better with Processing, Racket, Minecraft, Arduino and plain Python.

One that has caught my attention, and I will show my youngest child is NetLogo [2]. It is a modeling environment for researchers, business people, and well, basically adults, but it is self-contained, comes with tons of examples, and will be valuable in the future in learning modeling. It's a lot of fun too!

NetLogo's three-tabbed unified interface has the GUI simulation up front, an Info/Documentation page second, and a Code tab. The Code is a variation of Logo. Short programs, and easy syntax with immediate gratification of watching your simulation run. Now just some more kid-friendly examples, and you're off to the races and a PhD in the Mathematical Sciences and Modeling!

[1] http://praeclarum.org/post/147003028753/continuous-c-and-f-i... [2] https://ccl.northwestern.edu/netlogo/


I was really looking forward to letting my daughter (and wife, who was interested) in using this.

Then I realised it won't work on their iPad (4th Gen with Retina) - which runs everything fine, and there's no need to uprade it.

So there we go - they won't be using this.


I am not (yet) familiar with this app, but I do like to suggest to any new (young or old) programmers to give Racket along with the book 'Realm of Racket' a try. It's a simple enough programming language to get a good foundation with important principles, but also can take you nearly as far as you want.

Edit: For those who downvoted my comment here, I'd really be curious to know why.


Maybe I'm wrong, but I don't think starting out with parenthesis based programming language is the best starting point for new programmers. You'll probably just scare them. I'm saying this with my huge love for Scheme. Of course, if you're already programming and want to learn/try something different, Haskell or Racket, or any other functional language is a great option.

What makes Swift Playground so compelling is that it seems to be specifically tailored towards new programmers, with the way it teaches -- it provides basic information about Swift, and does not overload information at the reader at once. And even existing programmers can make use of it because it's just a Swift playground (part of Xcode) underneath.

I think Swift Playground is genuinely fun as you can manipulate an object on an iPad. It's pretty much like playing a game in that sense. That's something you just can't get out of reading a book. It makes it that much more approachable.

If you show kids or even new programmers Swift Playgrounds along with something like Learn You a Haskell or Realm of Racket, or even tell them about Scratch, which do you think they would gravitate towards more?


Hm, again I haven't tried it - I don't have an iOS device that can run it - does it actually use Swift syntax? This is only anecdotal (anecdata) but both my friend and partner (both 27) are learning to program for the first time using Racket, who both barely know what a 'web browser' is and they're both finding it really easy to pick up, and even have started 'thinking in lists'. It also was my first programming language..

But anyways, I'm excited to give this app a try - I'm always glad to see more tools to help people get started.


I wasn't really directing all of what I said to you, but just commenting about Playgrounds versus other resources in general.

And yes, it uses real Swift syntax which is its main goal, according to the "Platforms State of the Union"[1] talk at WWDC this year.

[1]: https://developer.apple.com/videos/play/wwdc2016/102/


Very cool, thanks for explaining :)


In my experience, people expect programming languages to look different than human languages (and maybe more like math) and thus aren't put off by whatever structure the one they're learning takes.

It's after people have gotten used to a few languages that they start to develop syntactic prejudices, for example against "parenthesis languages" if they've been doing a lot of coding in C-family languages.


...or you could learn Swift and ship real apps. You'll have something to show your friends and family. You'll go much farther once you ship real software that does something that's interesting to you.


Um, are you trying to say that you can't make some 'real' with Racket? That you can't do something interesting with Racket? Because that's really not true, and you sound really snobby.


Um, no, ... that's not what i'm saying. Snobby is thinking that you need to learn computer science concepts first. I'm saying that excitement is the most important thing. 30+ years ago, i got excited by typing hex codes in for C64 assembler games. Next i learned 6502 assembler from magazines and books so i could move sprites across the screen, etc

Playing with Swift on an ipad is a lot of fun.


Snobby or not, there's something really great about being able to make an app that has an icon on your phone. Easy to show friends, and it feels somewhat tangible. And practical experience.

As a total noob programmer myself, stuff that exists only on the command line is a bit of a let down.


Wish it were a bit more like HyperCard in its scope.


I did a quick test on my iPad after I read this. I am posting my experience on twitter.

https://twitter.com/ontouchstart/status/753709980239466497


Please no more vertical videos.[0]

[0]: https://www.youtube.com/watch?v=Bt9zSfinwFA


Yes, I learned that after the first video. :-)

(The second one is a trim from the same original.)


This looks cool... I wish there were a macOS/OSX version, don't have an ipad, have a couple macbooks (and hackintosh) though.


Does swift work on androids, windows, chromebooks, RPi, consoles? What is the cheapest iOS device that would support swift for kids?


Looks a lot like lightbot. Better, but would have been nice if they gave some credit to lightbot.

iPad swit playground preview video : http://www.apple.com/swift/playgrounds/

Lightbot: https://lightbot.com/


Edit parent: i guess there are other older tools as well, following the reference to karel by binarysolo :

https://codehs.com/

https://en.wikipedia.org/wiki/Guido_van_Rob

https://en.wikipedia.org/wiki/AgentSheets


I can't wait to teach my eight-year-old how to code using Swift Playgrounds...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: