3 ms·
> So just write those 100 lines of boilerplate. Although I agree with your ide, I've written some boilerplate code before to do something very similar. As the
by maccard 10y ago
> So just write those 100 lines of boilerplate.
Although I agree with your ide, I've written some boilerplate code before to do something very similar. As the project grew its become a constant source of bugs where someone has updated the code for one type and not another. At this point they're too far gone to have any hope of merging them, but had I known two years ago how much hassle it would have caused I would have refactored it into common code
- fsloth 10y agoYeah - I agree with both of you. First start with the boilerplate approach, and once there is boilerplate in place for a low number of entity types, say, 2<n<10, figure out if that can be refactored into something less boilerplatey. But yeah, very seldom starting with a complex abstraction for a code you've never written before is a good idea.