3 ms·
> Modules don't, in most languages, have instances. You get one set of data. Bundling data with functions is way better than global data. Modules usually have
by Jtsummers 6y ago
> Modules don't, in most languages, have instances. You get one set of data. Bundling data with functions is way better than global data.
Modules usually have data types that can be instantiated via functions/procedures in the module that let you avoid global data. They don't have to have data fields in them that are changed directly by the procedures (giving you, effectively, singletons).