Topic on Talk:Best practices for extensions

Jump to navigation Jump to search
Smalyshev (WMF) (talkcontribs)

One thing that should be avoided even more than global state (e.g. global variables/public static properties in classes) is local static vars and similar instances of hidden local state, especially when used for caching. It looks like a very good idea when writing it, and is absolute nightmare when debugging/testing, because it creates hidden un-clearable state which could be in any random configuration when you get to it.

Thiemo Kreuz (WMDE) (talkcontribs)
Reply to "Avoid global state"