Hacker News new | ask | show | jobs
by RedShift1 1612 days ago
Same here. I've gotten rid of all that stuff, it's just layers and layers of indirection that contribute nothing.

One rule that has also helped me a lot to keep my code clean and make it easier to debug is to fail as much as possible in the constructor. So when you call new MyThing(), you will either get a usable object or it'll throw an exception. Further method calls are expected to work. Of course this is not doable for everything, but it sure helps keeping the methods clean and not have them throw various exceptions.