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

Honest question: to what extent is this a fancier-graphics version of Logo from the 1960s? (you know, the little turtle with which you can draw shapes, by using commands like pen down, pen up, move, turn, etc).

Does swift playgrounds teach one other stuff, in particular stuff relevant to the MacOS or iOS API?




Logo’s a Lisp. Swift’s an Algol. The latter are much more complex, and also much less expressive and customizable; alas, thanks to C they’re also firmly entrenched as the status quo. Logo emphasises compositional thinking; Swift Playgrounds algorithmic hoop-jumping.

Ironically, Apple did do a Lisp[-in-Algol-clothing] back in the 90s—Dylan—but abandoned it when NeXT took over. Shame. Closest thing since then was the “Objective” part in Objective-C, but that was always a bit smoke-n-mirrors (since it’s still C at the bottom) and is slowing going away now in any case.

I do not think Swift is a good K12 teaching language (it’s a nicer C++, roughly on-par with Java in complexity), but Apple’s goal here is to create lots of new (and preferably locked-in) iApp developers, not raise talented independent CS students†, so that’s not a problem for them.

Real-world Swift App development also gets varying degrees of ugly/tedious/painful when dealing with BSD/Foundation/AppKit/UIKit idioms and APIs due to the impedance mismatch between Swift and Obj-C worlds, so the sooner it has its own native APIs for everything the better. I don’t think SP can really prepare anyone for that tangled mess, though if/when SwiftUI is fully ready for primetime I can see SP boosting that. (Whether SwiftUI itself is particularly good remains to be seen.)

--

(† Mind, most K12 and college “computing science” courses nowadays are really “software engineering” and not really CS either; and even SE can be a stretch considering how much software today is garbage.)


Swift Playgrounds is essentially an interactive Swift REPL that ALSO ships with some prebuilt learning material, some of which is "fancy logo".


Swift Playgrounds is not a real REPL though as it re-evaluates the entire program after every code change†. While it nicely annotates the code with per-line results, program state is not persisted between edits and side-effectful operations are repeated each time. That seriously limits its real-world usefulness to little more than a cute toy.

Ironically, Swift does have a true REPL which you can invoke in Terminal (`swift`, unsurprisingly enough). That does persist state over the entire session while showing the output of each line, albeit with old-school CLI line editor. The Print bit really sucks though as it ignores `description` methods and does a full debug dump of complex structures every time.

(Plus, of course, users need to be comfortable finding their way around a 1970s shell, which Playgrounds’ audience won’t be.)

Two partial “REPL” implementations that could’ve been a single knock-it-out-the-park REPL had they bothered to consolidate and refine. Swift may be many things, but great at joined-up thinking it is not.

--

(†Unless they’ve changed that behavior since I last tried it. Probably not.)




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

Search: