Meaning of the term "context" in programming

Hello guys, I was reading a few things and I noticed several time the words "depends on the context" is used. What does the term context refers to in programming please
18 Replies
ἔρως
ἔρως3w ago
it usually means "scope" or "execution scope"
Faker
FakerOP3w ago
hmm is there a difference between scope or execution scope pls
ἔρως
ἔρως3w ago
it's the same sorta for example, the same function can be used in multiple event listeners the function is a scope, the executing scope is the scope that's being executed in
Faker
FakerOP3w ago
Hmm I read that "this" keyword is "context-based" what does this mean ? for example in javascript, I understand that "this" keyword refers to current instance of an object, but I'm kind of confused about the term "context-based" :c don't know if it's my english which is bad😭
ἔρως
ἔρως3w ago
it is and you can even change what the this is
Faker
FakerOP3w ago
yeah when we change this, we are basically changing "context" I don't like this word "context" I need another technical word
ἔρως
ἔρως3w ago
it's the best word to be used
Faker
FakerOP3w ago
Ok so I just GPT it, context can refers to: Scope/ Instance/ State Yeah but I don't know, when I read the term "context" my brain doesn't assimilate it 😭 I don't know how to make sense of this word 😦
ἔρως
ἔρως3w ago
state is different from context state is state instance is different from context instance is a "copy" of an initialized object
Faker
FakerOP3w ago
yeah true, have another alternative: "The specific situation or environment in which code is running or being used." is this one correct pls
ἔρως
ἔρως3w ago
no, because the same code running in the same environment can have COMPLETELY different execution scopes or, in this case, context imagine a resize handler that's triggered for 20 elements just imagine same code, same environment, same situation ... even is being executed by the exactly exact same trigger but, the context is different
Faker
FakerOP3w ago
yeah because each element is a different context?
ἔρως
ἔρως3w ago
yes but not just that external variables can have different values too
Faker
FakerOP3w ago
ah I see so, how would you define "context" once more? 😂 execution scope makes more sense I think
ἔρως
ἔρως3w ago
it's what context is
Faker
FakerOP3w ago
alright, will stick with "Execution scope" then by the way, Happy new year @ἔρως !!!
ἔρως
ἔρως3w ago
happy new year
13eck
13eck3w ago
@Faker please note that this channel is for code-specific questions. This question is better suited to #discussions . In the future, please use that channel for such discussions.

Did you find this page helpful?