Block languages
blocklanguages.org
blocklanguages.org
Funnily, one of my first languages (after Basic and Pascal) was VB6, which had for that time an excellent IDE.
If I had back then something for C/C++ as good as XCode / Vim YouCompleteMe / ReSharper C++, I would have been much less scared by pointers. Just write `myvar.` and if it doesn't complete, try `->`. If you forget an address-taking & or a dereferencing *, you'll likely get a red wavy underline and correct it easily without compiling.
Maybe combine that with a snippet palette, and a good help function, and you have someting that is both great for learners and for advanced users.
What makes languages such as these and Scratch beneficial is that they decouple logic from the syntax. I can't tell you how frustrating it is for high schoolers to hit the syntax wall and lose interest altogether. At this age (14-18) when you haven't necessarily built up the grit and persistence you have as an adult, tools such as these keep the student progressing and motivated.
Eventually you take the training wheels off and have them engage in real coding. Languages such as these and tools such as Scratch serve as a crucial bridge to that end state.
Something made it fun for them, so fun they persisted and learned it. There are many other very hard things, such as swimming or riding a bike, which most children learn.
I'm not advocating that things should be boring, just that it's also important to discuss what makes things fun and rewarding, not only on removing hurdles.
Edit: Frankly i think we humans are inherently sequential thinkers. Especially when trying to describe how to do something in detail. So when trying to deal with non-sequential systems we sooner or later make a mess of things.
A well-designed block language could offer a lot of guidance on these sort of points, perhaps by having a context-dependent pool of available blocks to drag into the body of the query.
At least, doing that would make more sense to me than any graphical query builder I've ever seen, with the bonus that it might lead to users who are more capable of writing SQL directly. (Not that I'm holding up SQL as a paragon of language design - but it is ubiquitous, and very useful in a wide range of situations.)
DBSnap: http://www.public.asu.edu/~ynsilva/dbsnap/
DataSnap: http://think.cs.vt.edu/snap/
Come to it, I've got similar suspicions around overcomplicated query structures and MySQL's lack of hash joins.
Having said that, I'm convinced there's a way to design an interface around it that creates an acceptable compromise with (most of) the best of both worlds, although I don't know what that interface would look like. Perhaps introducing a cursor and treating the blocks as we would normally treat glyphs in typed languages[0], using keyboard shortcuts to quickly insert and manipulate blocks.
EDIT: Also, what's notable about all these block lanuages is that they're essentially taking writing, and turning the words into things that can be dragged around and manipulated as objects. Although we do to some degree process language in that way, I wonder if it isn't doing things backwards.
If you look at Bret Victor's recent work you can see interesting alternative takes on this where the problem is approached from a concrete example first and then generalised into abstractions[1][2][3].
[0] Err... not as in typed languages, obviously, but as in languages that we type out.
[1] https://vimeo.com/66085662
People tend to shy away from languages that don't have textual representations, and for good reasons. It's harder to share code, among other things.
I think the best approach would be to come up with something that is human-readable and writable, but is optimized for the block approach.
And I'd argue that some languages (lisp?) already fit this.
Yup. And with proper editing help like Paredit, you start to actually think in terms of moving tree nodes ("blocks") around instead of typing in text. With that, all you'd have to do is to start drawing colored boxes around the code instead of parens, and you'd have a decent, keyboard-operated "block language".
Uphill both ways in the snow.
Also, once you get past toy programs on scratch, there's not really anywhere to go. Building large programs in scratch is cumbersome and error-prone, and methods of transitioning from scratch to a text-based language are pretty iffy.
This approach of starting with a block representation of a common, practical language makes a lot of sense to me.
https://blockly-demo.appspot.com/static/demos/code/index.htm...
The PLT group with its {BSL, ISL...} series addresses the issue of "What's next?" in a way that bespoke environments can't. Legos are a useful abstraction all the way up the CS track. But training wheels made of Legos don't roll very long. Alice pushed gamification to the point it could engage a wide audience. Logo has a track record.
Congratulations, you've just created Lisp :). Really, one can't get any simpler than that, syntax-wise. I don't understand the assumption that kids will be too scared to type and have to do everything with a mouse.
I made a little demo of my Lispy take on Scratch/Elements here, and made use of the code on several game projects. https://www.youtube.com/watch?v=7E8WUMOvL24
I'm not terribly confident that visual programming will ever really come into its own. But I think the combination with Lisp could be really useful, and I'm still doing some work in this area.
EDIT: Just looked around for Jens Monig's "Smalltalk Elements" but it seems the original page is gone...
The issue with blocks is that it gets really hard to handle once it gets a little bit complicated.
- the display becomes cluttered
- A few level of if nestings, and it gets hard to drag around the statements. at least for me: a simple change forces me to mess up the whole structure.
the idea looks nice but it gets messy once you start using it for real.
Of course for a teaching language it has a big advantage: you don't have to bother about syntax errors. Now maybe its too good to be true, right now i don't know how to get past that stage in my teaching efforts.
It's accessible to non-programmers but also is sophisticated enough to cover things like loops, functions, recursion, local/global/member variables, and more.
Aside from the "lots of mouse dragging when a bit of typing would be faster" that I mentioned elsewhere, the only issue I remember having with it, was that it wasn't always really clear which object was being referred to. (Sorry if this is useless vague feedback, but this is from memory and the event being a 48 hour game jam with little sleep doesn't help in that department).
Block languages free the students by the burdens of syntax
Is nothing sacred anymore?To a newbie, rules like ending statements in a semi-colon, wrapping strings in quotes and remembering the casing of a function name can be difficult. Ask them to produce a program with branching and looping with proper syntax and things get needlessly difficult.
I tried teaching a programming class with pseudo code and I found the class seem easier for most than those that had to learn the same material in an actual programming language.
If you could relieve the burden of syntax initially, that's great. But they'll have to learn to carry that burden eventually like the rest of us if they ever want to produce anything of value.
Also, there is a mass of bugs out there that come from someone misplacing or forgetting a " or similar.
One thing that is likely needed though is some way to rapidly insert blocks via keyboard, as right now most of these interfaces are overly mouse driven when you want to modify a bunch of blocks quickly.
The most unusual situation I've seen when teaching (shit-tier university) was that some students couldn't look at a single ASM instruction and understand what it's doing after being explained the syntax:
ADD R1, R2, R3 ; R2 + R3 --> Store sum in R1
It's almost like some students aren't even ready to learn...o_OI've often encountered students who think they need help with syntax, but in actuality have no understanding of how they're going to actually solve the problem. Conversely, I've never encountered a student who has a good idea of how to solve the problem but just has a syntax error.
This whole "syntax errors cause problems in teaching" thing is something students shouldn't be told. Both because it's pretty untrue on balance, and also because it allows them to blame "syntax" when they write down some copy pasta nonsense and it doesn't work due to compiler errors (completely glossing over the fact that even if there were no compilation errors, the code would still be absurd nonsense.)
From a small sample, a significant percentage of students, simply could not fill in the correct values for a short sequence of C-style assignments.
Ability to model a set of sequenced imperative statements is clearly a skill that not all may have.