4 ms·
I think it is. It solves a problem, that is of course very real and urgent in programming, but does so by adding a layer of abstraction. And I think abstraction
by analog31 3y ago
I think it is. It solves a problem, that is of course very real and urgent in programming, but does so by adding a layer of abstraction. And I think abstractions have to be introduced sparingly and gradually. Likewise functions with arguments. I still find this to be a hurdle when helping people learn Python, and they don't naturally use functions and scoping unless I goad them into it. Many of them won't do anything beyond writing basic linear scripts, which is OK.
My first language was the original line-numbered BASIC. I think a benefit was that you could pretend to think like the computer, and run the program in your head or on paper. Naturally we were led to experience the mishaps that scoping overcomes.
Nowadays, a motivation is showing how they can import a package, and use its functions, without having to understand the internals of the package. The most primitive reasons are named function arguments and scoping.
- int_19h 3y agoI would argue that introducing such concepts in easy to understand ways is the task of the IDE for such learning languages. E.g. Thonny does a great job of explaining how locals work during debugging by using a multi-window mode where each stack frame gets a separate window that shows just that function's code (with current statement highlighted) and its locals. It also takes care of recursion - you can easily see how every recursive call adds a new window, and each window has its own set of variables.
- analog31 3y agoAh, I had forgotten about Thonny. For a while it seemed like they weren't keeping up with Python versions. Hmmm... even after just a few minutes, I'm impressed. I prefer to use beginner tools for my own work, even though I'm actually quite experienced, because it gives me a chance to familiarize myself with the things that I would actually recommend to beginners. Also, it reminds me of another thing, which is that not just the language but also the tooling, can be a source of abstraction and frustration.