3 ms·
I think maybe you're missing some subtlety here. In Scratch, the type of a parameter or expression is denoted by it's shape. Strings are square, numbers are r
by xscott 5y ago
I think maybe you're missing some subtlety here. In Scratch, the type of a parameter or expression is denoted by it's shape. Strings are square, numbers are round, booleans are angled, and statements are shaped like puzzle pieces. You don't need quotation marks and escape characters for strings.
So new users can be oblivious to types for a little while - just tell them they can't put a square peg into a round hole.
I think it falls apart pretty quickly as they add more features in Snap. For instance, are lists always lists of strings? And list themselves are rounded rectangles? Sprites and procedures are rounded rectangles? I guess they ran out of easily distinguished shapes, but maybe that's ok by the time new programmers start needing these features.
- zozbot234 5y agoThe thing about shape is that it's a feature of visual syntax. A visual language where shapes are used to distinguish different primitive types is structurally no different from a toy BASIC where each type is given its own sigil character (!#$& etc.). We moved away from this use of sigils because it made it harder to abstract away from primitive types. I can see Snap! developers making the same choice.
- xscott 5y agoI agree with everything you said, and I still think it's a clever/useful idea for new programmers.
- wizzwizz4 5y ago> Strings are square, numbers are round, All variables are round. The only thing that's square is a text input box. (The background colour, white, is the thing denoting that you can put any variable in the box.)
- xscott 5y agoIf we're being pedantic, I should've used the word "parameter" instead of "variable", but surely you know what I meant. If not, see the "What's in a shape?" section of https://nostarch.com/download/samples/Learn-Scratch-05.pdf https://nostarch.com/download/samples/Learn-Scratch-05.pdf It starts at the bottom of page 92.
- wizzwizz4 5y ago> Blocks for cloud variables have a small square in front of them to distinguish them from regular variables, like this: That's supposed to be a cloud icon. :-p