4 ms·
I don't think this would help big projects in the long run - more likely it would hurt. The problem with globals - and why we try to minimize them - is because
by RyanZAG 11y ago
I don't think this would help big projects in the long run - more likely it would hurt. The problem with globals - and why we try to minimize them - is because they can be changed by any code throughout the code base. It makes it hard to know exactly what the global's value will be.
Persistent globals takes debugging a step further. We wouldn't be able to know if the globals value is being changed by another page, an earlier version of the script, etc. It would create true 'nightmare bugs'. Glad it didn't get into javascript.
- jerf 11y agoIt's a closer mental model to speak of "trivially-easy persistence" than "globals". In practice the values were as "global" as the values in an SQL database... technically the SQL database is not imposing any sort of visibility constraints on your code, but that doesn't mean that you necessarily think of those values as "globals".