3 ms·
I'm just going to quote myself from a few hours ago: > You don't always get to decide that. The data may be serialized in from JSON, loaded from a database, im
by stickfigure 4y ago
I'm just going to quote myself from a few hours ago:
> You don't always get to decide that. The data may be serialized in from JSON, loaded from a database, imported from some weird EDI system, etc. Maybe the initialization process is not so simple, and spread out all over the codebase (or even just dozens of constructors).
Real-world codebases (the ones out there running profitable businesses, built by programmers that have come and gone) are rarely so clean and pretty that you can say "well, you just should have initialized it properly in the first place!" To that, I offer you Mike Tyson's incredibly apt programming advice: "Everyone has a plan until they get punched in the mouth".