Hacker News new | ask | show | jobs
by EliRivers 3402 days ago
Factories. I've got a codebase to work with using factories everywhere. Static arrays of them. Classes are given hardcoded enums and there's macro magic all over the palce to join classes to the factories that make them, and to generate all the factories in these static arrays of factories.

Sometimes the static array of factories contains a single factory. Creating a single item. No variation, no types, just one kind of one item.

The item is needed once. In one place.