Jargon is freaky, yo. Let's demystify.
- scope: where you can find variables
- stack: the process of stepping through code and executing it (like the process of cooking a recipe).
- heap: where all your individual objects and trash lives (like a pantry)
- global scope: variables you can find everywhere
- block scope: variables you can only find inside a {piece} of a function
- function scope: variables you can find inside a function
- "foo" and "bar": data placeholders used w/ writing examples
- API: honestly, just a program's signature; what it can do
- for(i=0...): i is literally just a freakin counter.
There. All better.
Top comments (13)
I don't think your
stack
definition is quite right... you more described debugging.A stack in general is no different than a stack of papers: you can see and access what's on top, but if you want something on the bottom, you first have to take off what's on top.
"The" stack (as in stack trace) is a particular stack recording how code got to the current line being executed (foo called bar called baz called fizz called buzz and on down the line)
I would say she meant the 'call stack'
Even so, a call stack isn't an action. I agree that the definition is a bit off. When someone is debugging code, they will interact with the stack. But the stack itself isn't the act of debugging.
Exactly so. Thank you!
Ooo, this is very helpful. I've been grappling with how exactly to explain stack. I certainly explained "stack" here as what is actually a "call stack". Thank you for the input!
I think either some of the definitions are incomplete of the term is not defined well enough.
Stack as mentioned in comment can be a pile of paper it could also be a folder of various pages of information (cloud stack): It can also be the a group of all the technologies used in a project.
API: I really don't get the definition of it and how a signature is linked to it. I would describe it more as the postal office between multiple apps as an API allows communication between various services.
Scope I would change it to "Variable Scope" as scope can not only be variables but can be for classes, functions and more
The "API" definition listed above is more the classical definition from the C/C++ era of programming. What you're describing is more the modern era of "web API" - both are appropriate in different context.
That's why I mentioned that the term is not defined well enough specially as the post is tagged #javascript and not #c
I found the sideways dictionary some time ago, and it helps a lot to explain some terms (like API) to people that have none of the supporting technical understanding to explain it.
Take the API example here: sidewaysdictionary.com/#/term/api
It doesn't explain stuff like scope, but it comes in quite handy when I have to translate some of these technical terms we take for granted to the lay person.
You know, most of these terms come from real world meaning.
For example scope. One of it's definitions is:
Like looking through a scope. You can see only the parts which are within scope. The visibility part of scope in programming languages is a bit reversed though, the deeper you go, the more you can see, and nothing moves out of scope when zooming in. But zooming out, and moving the scope, will move things "out of scope".
A similar thing for heap, from the dictionary
Not to be confused with stack as a heap in unordered rather and neatly stacked. Like a heap of unfolded laundry.
Haha! Nice! 🐵
Very well said 🌟
Thank you!