3 ms·
I have a converse case. I once TA'ed for "computational physics," a course that often can be (sometimes) "remdedial programming" for physicists. I distinctly re
by noobermin 4y ago
I have a converse case. I once TA'ed for "computational physics," a course that often can be (sometimes) "remdedial programming" for physicists. I distinctly remembered one very bright scientist who just could not understand how to program because they had not developed the intuition in their mind that a computer works as a state machine. Statements like
x = y + 1
x+= 2
would leave them thinking y would get modified or worse. They knew the words "assignment vs. equality" but they didn't really understand what was going on despite that mantra being hammered on in lectures, because of that which (unfortunately) was not said, which is mental model: there are boxes in memory, assignments put things into memory, and that in a program, there is a progression of steps, where each step modified state...that is, the mental model of a state machine. Their mind still worked in the sense of mathematical statements you see in a physics or math class or calculation, that each statement is a statement of truth simultaneously, and there is no "sense of time" or series of steps that have an order, much less the concept of a state machine. That's why, even if they knew somehow that x could change value, they didn't get that the second line was an instruction that only had to do with the box labelled x and would not have any effect on y, because that was another instruction, and these weren't statements of truth.
I feel like may be part of it may be the confusion from the conflation of conventions here, but given my work with him at the time, I do not think an assignment operator (like := ) would help because a program being a series of steps and the concept of state being modified over time is something you have to internalize, or worse unlearn if you're a bright physicist who's never programmed.
For me, I have (and I had to) made that distinction in my mind because at some point in my learning long ago just to make sense of the difference in my mind. To be honest, I don't think that difference was ever really taught to me explicitly.
- gnull 4y ago> there are boxes in memory, assignments put things into memory You are forgetting about functional programming, which has no assignments, only bindings that are immutable — just like in math. And your program is one big expression that is being reduced by a computer. I wonder what would happen if your friend started with, say, Haskell.
- Tainnor 4y ago> I wonder what would happen if your friend started with, say, Haskell. They might get confused as soon as they saw "do"-notation which, while technically only being syntactic sugar over monadic functions, still ends up looking an awful lot like a sequence of operations being performed one after another.
- awesomeMilou 4y agoI'm waiting for the reply that explains why teaching Haskell to physics students out of all languages is not only a good, but the right idea.