Was it actually hard to explain? Or was it hard to explain in a way that didn't risk coming across as condescending? I'm "fortunate" in that I never needed to be motivated to study and learn computer programming, so I have about 40 years of computer programming knowledge now. Some of it (cryptography, networking, recursion, pointers) was hard won and took me a long time to grasp. Now I find myself frustrated by the Braeden's of the world who assume that every question has a two-word answer that if I don't know, I'm either incompetent or worse, deliberately hiding something from them.
I can explain memory to anybody, but I have to start from the basics of computation - and if somebody doesn't know what "memory" is, that's where they need to start! But if there's an art form to starting from the beginning without pissing off the person who asked to start from the beginning, I've yet to master it.
My explanation went something like this (M is me, H is him, and yes, he was male) and this was many years ago:
M: you know the COBOL MOVE statement?
H:Yup.
M: So when I say 'MOVE "hello world" INTO greet' what is happening?
H: The sequence of characters gets moved into the variable greet.
M: Nearly right. The characters get copied - MOVE should really be called COPY. And where do you think those characters get copied from?
H: I don't know.
M: Well, they are copied from one area of memory to another. When your compiled program is run, things like "hello world" are loaded along with the actual executable code, and given an address in memory.
[at this point i drew a diagram, but cannot be arsed doing so now]
H: OK so far
M: So when we do the COPY of "hello world" we need to have some memory to copy it into. Now, in COBOL the compiler takes care of generating code to do this, but (for a variety of reasons) the C compiler does not. So we have to do it ourselves using functions like malloc. Anyway, don't worry - you've been doing well on the course so far, and we can go through this again tomorrow, if you would like.
This one of the main things about cobol people don't understand; all memory is statically allocated, there is no dynamic memory allocation. Well there can be, but not generally. No call stack, no heap. In reality, cobol, the 85 standard and before was really very primitive. The new standards have changed this obviously, but no one uses those. The terminology this person would have understood is "working storage".
Was it actually hard to explain? Or was it hard to explain in a way that didn't risk coming across as condescending? I'm "fortunate" in that I never needed to be motivated to study and learn computer programming, so I have about 40 years of computer programming knowledge now. Some of it (cryptography, networking, recursion, pointers) was hard won and took me a long time to grasp. Now I find myself frustrated by the Braeden's of the world who assume that every question has a two-word answer that if I don't know, I'm either incompetent or worse, deliberately hiding something from them.
I can explain memory to anybody, but I have to start from the basics of computation - and if somebody doesn't know what "memory" is, that's where they need to start! But if there's an art form to starting from the beginning without pissing off the person who asked to start from the beginning, I've yet to master it.