3 ms·
It really depends on what this code is doing. If it is dialog window rendering - yes, not so important. If it's complicated data validation - you better make it
by EugeneOZ 2y ago
It really depends on what this code is doing. If it is dialog window rendering - yes, not so important. If it's complicated data validation - you better make it reusable and pure from the beginning.
- lcnPylGDnU4H9OF 2y agoI agree. The data validation example doesn't seem contrary to the advice; you would generally have at least three data types you need to handle in such a case. The difference with the dialog window is that (presumably) you don't know the different flavors of window you'll need to render so adding an abstraction on top of the existing rendering abstraction fits squarely in "premature optimization".