Ask HN: Was Programming Intuitive to You?
The main obstacle for me was understanding variables and "=" operator. It wasn't immediately obvious to me what happens to variables in a "for" loop for example.
I knew you can count up thanks to it, but I had no mental model of step-by-step execution and variables changing values, so I couldn't predict how this will behave:
FOR X = 1 TO 10
Z = Y
Y = X + 1
PRINT Z
NEXT X
It probably didn't helped that I only knew Polish at that time and BASIC was in English and the manual for my C64 was in German :)So I mostly typed in the programs from that manual to see what happens and played with the numbers there to see what changes. Some programs I never got to work - for example the one with sprites. The whole thing with programming for me was to make my own games so I was pretty devastated by that, and it was before anybody had internet so I was stuck :)
Then I got a PC and Turbo Basic (and later Turbo Pascal). And a book about Turbo Pascal in Polish - and then I really understood most of the concepts in programming - user defined functions and procedures, recurrence, dynamic memory, pointers, data structures, etc.
After that each next language was just a little different from the previous one so it was pretty easy.
For me, the intuition stops at tree and graph. Anything more complicated (probability, matrix, etc.), I need a reference every time I work with.
May I ask how long have you've been programming? I, myself, am finding it hard to make the correct mental models.
Sorry for the late reply. It's been ~10 years in total for me.
I first learned programming in high school. They taught us how to use flowchart[1] for easier visualisation of the logic and state transitions in a program.
Then in college I was taught data structures and serious CS stuff. This is where my intuition stopped as I mentioned in the previous comment. So what I wanted to say was, it was intuitive for me up till a certain point.
Then working irl is more about using frameworks and tools and thinking in terms of concepts from those tools.
So I'd say there are endlessly many mental models you'll use in programming, depends on the task you work on. Don't worry too much if you don't get some of them.
How long have you been programming?
Its been 6 years but I've doing it intermittently, trying out different languages. Its now that I'm working quite hard at it. Even though I've been studying it for 6 years now, I could not make much sense of it. It takes a while. But I've experienced the more I grind at it, the more it becomes clear. So there's hope, I guess.