5 ms·
Is there a good reason to require `var`, `set`, and `call` keywords? BASIC doesn’t have those. From my (admittedly dim) memories starting programming as a kid,
by layer8 3y ago
Is there a good reason to require `var`, `set`, and `call` keywords? BASIC doesn’t have those. From my (admittedly dim) memories starting programming as a kid, those keywords would have been an unnecessary complication.
For example in LOGO, you’d just write
forward 10
left 90
In comparison,
call paint.forward(10)
call paint.left(90)
seems excessive and noisy.
- postalrat 3y agoSo "forward" is something you click and it shows all possible expressions for a new line?
- csmeyer 3y agoThe keywords are there on every line to make them easy to verbally read. This is most important in the case of set x = 7, the keyword makes it clear that we're trying to mutate a variable, not assert equality. Even though technically we could make forward() a method at the top level in the context of a paint program, we chose to make things more OOPy to prepare them for later when students get to the 2D game engine and there can be multiple sprites to control.
- deleted 3y ago[deleted]
- wruza 3y agoI always wanted `set` in regular languages instead of (or in addition to) =/==. Edit: well actually, I want a whole development studio like this for professional development. You are the closest of anything else to my vague idea of what programming should look like. I feel bad for the kids who later will have to move from this to what we call "our software development stacks".
- mikeravkine 3y agoPascals := is concise and intuitively obvious, so obviously it never caught on.
- fsckboy 3y ago>Pascals := is ... := is Algol's. Algol had a much bigger European influence than American, and other euro languages like Pascal followed its traditions
- avarun 3y agoHard to type though
- Yasuraka 3y agoGood news https://go.dev/tour/basics/10 https://go.dev/tour/basics/10
- kaba0 3y agoSo now Go has a single good feature!
- runlaszlorun 3y ago> I always wanted `set` in regular languages instead of (or in addition to) =/==. TCL ftw!
- secret-noun 3y agoI felt like the naming was a little unintuitive here. `forward` and `left` seem to be directions of movement (especially if I want the painter to "move left"). Instead, `forward` means to draw/move, while `left` is a CCW rotation (even though it supports a negative argument) call paint.draw(10) call paint.rotate(90) // or even rotate("up") speaks better to me.
- layer8 3y agoThe LOGO terminology is an abbreviation of "move forward 10 steps, turn left 90 degrees", omitting "move"/"turn" and the units, as those are implied. LOGO uses a "turtle" as an avatar carrying out the instructions, like a little robot you program. See https://en.wikipedia.org/wiki/Turtle_graphics https://en.wikipedia.org/wiki/Turtle_graphics. Python also comes with an implementation: https://docs.python.org/3/library/turtle.html https://docs.python.org/3/library/turtle.html I agree that the paint prefix doesn’t quite match that conception.
- CoastalCoder 3y agoGuess I'm showing my age, but the first version of BASIC that I learned had the "gosub" command [1] for subroutine calls. N.B.: I'm using one-based indexing for my links here because that's apparently what early BASICs used [2] :) [1] https://picaxe.com/basic-commands/program-flow-control/gosub/ https://picaxe.com/basic-commands/program-flow-control/gosub... [2] https://alandix.com/blog/2021/07/27/a-brief-history-of-array-indices-making-programs-that-fit-people/ https://alandix.com/blog/2021/07/27/a-brief-history-of-array...
- layer8 3y agoYes, but the built-in commands don't use that. You write PRINT "Hello" and not GOSUB PRINT "Hello" Rather, you'd write GOSUB 690 to run your subroutine that starts at line 690.
- hurryer 3y agoThe Basic I used had LET X=10
- stevekemp 3y agoZX Spectrum? I remember that when I had to enter code printed in magazines/books it always seemed the Spectrum was the one that required that particular modification. (Usually there would be a BASIC listing with modifications for C64, BBC, Spectrum, and other systems. "On line 30 add LET", etc.)
- runlaszlorun 3y agoYes! I had a Timex Sinclair. We had no cassette player, etc so, if you wanted to play a game, you were typing it in. There was one we’d always go back to. It prob wasn’t more than 50 line, tbh. But we typed it in so many times, we started to be able to do it from memory. I’m guessing it was a great way for a kid to internalize programming at a young age.
- ChilliaDay 3y ago[dead]
- CalRobert 3y agoWhen I was first learning to program as a kid I really liked having LET x = 2, or Perl's sigils, etc. It helped remind me of things as simple as assignation being left to right.
- zx8080 3y agoIt will be added as kool syntactic sugar later in v2! Stay tuned for updates! </s> Totally agree, it was my first thought too on call/var nonsense.
- whazor 3y agoI think it is needed for easily moving the code up and down. Notice that the kids don’t have to write the code. So because everything is clickable, it helps to have the keywords there in the design.
- layer8 3y agoI realize that, but it’s still complicated and noisy from a reading perspective.
- jurgenaut23 3y agoAgreed, this was my first impression as well. I spend my whole day in front of much more complex code, but trying to put myself in the shoes of a young kid, I would be really misled by this (unnecessary) noise.