|
|
|
|
|
by loup-vaillant
3094 days ago
|
|
> The concept of instancing is inappropriate to most situations. At the application level, maybe. At the library level, this can easily kill reuse. See Lex/Yacc. They used to assume a program would only have one parser. Then some naive developer tried to parse both JSON and Lua tables in the same program. Oops. Another example: standard libraries (including home grown ones). They instantiate everywhere: arrays, hash tables, file descriptors… |
|
> 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.