|
|
|
|
|
by jstimpfle
3095 days ago
|
|
Sure, there are exceptions. The other side goes the same way: If it's not a static resource, don't make it a global... > arrays, hash tables, file descriptors Most arrays / hashtables in my own use are actually static resources as well... File descriptors, same thing. They are (or correspond to) a process-wide resource managed by the OS. Most maintainable way is to manage them in a global pool. |
|
There's no question you instantiate a substantial number of arrays and hash tables in your program. Maybe most of them are global variables, but you still spawn several instances of arrays and hash tables. You do not have a single giant array and a single giant hash table, you have several of them.
Same thing with parsers. Lex/Yacc used to allow only one parser of any kind in the whole program. But if you want to parse 2 languages, you need 2 parsers. Of course, you'd need only one parser per language, and perhaps those two parsers parser's state will be stored in global/static variables. You still instantiated 2 parsers.
At least that's how I understand "instantiation".