3 ms·
This feels like inheritance to me, AdminUser inherits from User both have a setup / create method… Or just use a constructor… For the most part I feel whatever
by _3u10 4y ago
This feels like inheritance to me, AdminUser inherits from User both have a setup / create method… Or just use a constructor…
For the most part I feel whatever gets the job done in the least lines of code is usually the right solution.
But overall this entire exercise smells suspiciously like a constructor.
- code_runner 4y agoYeah I assumed we were going to get to some sort of types/inheritance based solution as well. Stuff like this doesn’t bother me a ton unless it’s littered everywhere. If every function can run one of two paths that’s certainly annoying… if there is some high level function that builds one of two “pipelines” and I don’t think about userType again, I don’t care too much.