What is the general idea of ​​the concept of "context" in programming?

Web programming in particular? I'm used to procedural programming, but I worked with (and understood quite well) some complex object oriented php. The only thing they talk about is "passing context" or "setting context." I would suggest that this contextual concept applies to more languages ​​than php and other areas other than web programming, as I also heard how it was used in discussions about other languages.

+3
source share
1 answer

I think this is about: Transferring an array or passing a bike. In OO languages ​​you will reflect on real life situations and check how something is created there.

I have an example of a game:

Will the game character give a motion controller? Or should it be the static manager that does this for us? We finally decided to implement a motion controller inside the game character. He is the sole responsibility for his movement, or at least his brains. There is no puppeteer in the corner somewhere. This reflects people with a real brain.

The context here is a test of what is and who is who. Why is this happening in real life? Why should we implement this differently? Confidence in your types of objects makes a very clear difference in what is needed and what is not.

Last example:

, . , , , . .

, . , .

, . , .

+2

Source: https://habr.com/ru/post/1787049/


All Articles