3 ms·
>By eliminating the possibility of syntax errors through block-based languages, you can put their entire initial focus on semantics, without having to divert th
by dTal 10y ago
>By eliminating the possibility of syntax errors through block-based languages, you can put their entire initial focus on semantics, without having to divert their attention toward syntactical correctness.
This is very interesting because one often hears the same thing - the exact same thing! - about Lisp as a teaching language. And Scratch and Lisp are indeed quite similar, superficially, though Scratch doesn't think of itself as a "real" programming language and hence stops short of providing features that would make it usable as one, like lexical scope.
One big difference is that Lisp simply hides a lot of its syntax behind homogeneous parentheses (many special forms can only be written a certain way, but you have to remember where the parentheses go) whereas Scratch doesn't so much hide it as handle it for you ("here are the slots where things can go in this syntactical form").
Another, separate but easily conflated difference is that it's in some sense "strongly typed" - numbers go in number slots, predicates go in predicate slots, etc etc. The return type of an expression is represented by the shape and color of its block. All types are statically known, and relayed to the programmer. It is impossible to commit a type error because the editor disallows it (which is in turn possible due to the transactional nature of drag-and-drop - what do you do if someone types the wrong thing in, untype it?)
I think these are valuable concepts that don't automatically imply "toy" and should be explored in the context of a "real" programming language. Computer science has consistently unvalued human factors. There is still a lingering sense that "real programmers" don't need to be mollycoddled, and should suck it up and endure byzantine incidental complexity. Never forget the lesson of Python, a slow and technically unremarkable scripting language which is now one of the most popular languages in the world because it is easy and fun to program in. Or the lesson of Lisp, an enormously fast and powerful language that nobody programs in because...?