chucksmash 7 days ago

Tbf, there's a phase of learning to code where everything is pretty much an incantation you learn because someone told you "just trust me." You encounter "here's how to make the computer print text in Python" before you would ever discuss strings or defining and invoking functions, for instance. To get your start you kind of have to just accept some stuff uncritically.

It's hard to remember what it was like to be in that phase. Once simple things like using variables are second nature, it's difficult to put yourself back into the shoes of someone who doesn't understand the use of a variable yet.

3
ZoomZoomZoom 7 days ago

> Tbf, there's a phase of learning to code where everything is pretty much an incantation you learn because someone told you "just trust me."

There really shouldn't be. You don't need to know all the turtles by name, but "trust me" doesn't cut it most of the time. You need a minimal understanding to progress smoothly. Knowledge debt is a b*tch.

cyjackx 7 days ago

I remember when I first learned Java, having to just accept "public static void main(String[] args)" before I understood what any of it was. All I knew was that went on top around the block and I did the code inside it.

Should people really understand every syntax there before learning simpler commands like printing, ifs, and loops? I think it would yes, be a nicer learning experience, but I'm not sure it's actually the best idea.

ZoomZoomZoom 7 days ago

If you need to learn "public static void main(String[] args)" just to print to a screen or use a loop, means you're using the wrong language.

When it's time to learn Java you're supposed to be past the basics. Old-school intros to programming starts with flowcharts for a reason.

You can learn either way, of course, but with one, people get tied up to a particular language-specific model and then have all kinds of discomfort when it's time to switch.

skydhash 7 days ago

For most programming books, the first chapter where they teach you Hello, World is mostly about learning how to install the tooling. Then it goes back to explain variables, conditional,... They rarely throws you into code if you're a beginner.

cyjackx 6 days ago

I mean, I didn't need to learn those things, they were just in whatever web GUI I originally learned on; all I knew was that I could ignore it for now, a la the topic. Should the UI have masked that from me until I was ready? I suppose so, but even then I was doing things in an IDE not really knowing what those things were for until much later.

Terr_ 7 days ago

> There really shouldn't be.

I don't see how, barring some kind of transcendental change in the human condition. Simple lies [0] and ignore-this-until-later is basically human nature for learning, you see it in every field and topic.

The real problem is not about if, but when certain kinds of "incantations" should be introduced or destroyed, and in what order.

[0] https://en.wikipedia.org/wiki/Lie-to-children

ZoomZoomZoom 6 days ago

Please, reread the statement I'm arguing with. I posit that you can mostly avoid "everything is an incantation for a while" if you're onto the correctly constructed track to knowledge.

Consider, how it's been done traditionally for imperative programming: you explain the notion of programming (encoding algorithms with a specific set of commands),explain basic control flow, explain flowcharts, introduce variables and a simplified computation model. Then you drop the student into a simplified environment where they can test the basics in practice, without the need to use any "incantations".

By the time you need to introduce `#include <stdio.h>` they already know about types, functions, compilation, etc. At this point you're ready to cover C idioms (or any other language) and explain why they are necessary.

eszed 7 days ago

Yeah, and accepting the LLM uncritically* is exactly what you shouldn't do in any non-trivial context.

But, as a sibling poster pointed out: for now.

codr7 7 days ago

More like forever as long as it's an LLM.

tharkun__ 7 days ago

Fair enough on 'cutting the learning tree' at some points i.e. ignoring that you don't understand yet why something works/does what it does. We (should) keep doing that later on in life as well.

But unless you teach a kid that's never done any math where `x` was a thing to program, what's so hard about understanding the concept of a variable in programming?

sigotirandolas 7 days ago

You'd be surprised. Off the top of my head:

Many are conditioned to see `x` as a fixed value for an equation (as in "find x such that 4x=6") rather than something that takes different values over time.

Similarly `y = 2 * x` can be interpreted as saying that from now on `y` will equal `2 * x`, as if it were a lambda expression.

Then later you have to explain that you can actually make `y` be a reference to `x` so that when `x` changes, you also see the change through `y`.

It's also easy to imagine the variable as the literal symbol `x`, rather than being tied to a scope, with different scopes having different values of `x`.

na4ma4 7 days ago

I think they're just using hyperbole for the watershed moment when you start to understand your first programming language.

At first it's all mystical nonsense that does something, then you start to poke at it and the response changes, then you start adding in extra steps and they do things, you could probably describe it as more of a Eureka! moment.

At some point you "learn variables" and it's hard to imagine being in the shoes of someone who doesn't understand how their code does what it does.

(I've repeated a bit of what you said as well, I'm just trying to clarify by repeating)

chucksmash 7 days ago

It's not even intended as hyperbole. Watching kids first learn to program, there were many high schoolers who didn't really get the reason you'd want to use a variable. They'd use a constant (say, 6) in their program. You'd say, "how about we make this a variable?" So they'd write "six = 6" - which shows they understand they're giving a name to the value, but also shows they don't really yet understand why they're giving a name to the value.

I think the mental rewiring that goes on as you move past those primitive first steps is so comprehensive that it makes it hard to relate across that knowledge boundary. Some of the hardest things to explain are the ones that have become a second nature to us.

pixl97 7 days ago

Yep, I remember way back when in grade school messing around with the gorillas.bas file with nearly zero understanding. You could change stuff in one place and it would change the gravity in the game. Changing something else and the game might not run. Change some other lines and it totally freaks out.

I didn't have any programming books or even the internet back then. It was a poke and prod at the magical incantations type of thing.