>About global state: yes global state can be avoided most of the time, but the fact that there is still some pressure to use it show it is not that obvious, or, said otherwise, that no other solution is able to cover all use cases.
Right, but my point is that this is not a computer science problem anymore; it's really a matter of discipline and habits (or languages which enforce good habits).
>But if you need to dynamically set a value and use it in a very remote part of the code, the need for some global state arise and is hard to avoid.
There are still very principled ways to do this. A problem can still be solved even if some people are ignorant of the solution.
>About ORM: sure, but these still exists and are widespread, so the solution must be not that obvious.
These still exist largely due to inertia; same reason a lot of bad ideas still exist.
>About complexity: ... good data structures.
Yes. Good data structures and good habits: layered stack of languages, data abstraction, composition over inheritance, bottom up design, DRY, static typing (why is this still controversial?).
Right, but my point is that this is not a computer science problem anymore; it's really a matter of discipline and habits (or languages which enforce good habits).
>But if you need to dynamically set a value and use it in a very remote part of the code, the need for some global state arise and is hard to avoid.
There are still very principled ways to do this. A problem can still be solved even if some people are ignorant of the solution.
>About ORM: sure, but these still exists and are widespread, so the solution must be not that obvious.
These still exist largely due to inertia; same reason a lot of bad ideas still exist.
>About complexity: ... good data structures.
Yes. Good data structures and good habits: layered stack of languages, data abstraction, composition over inheritance, bottom up design, DRY, static typing (why is this still controversial?).