Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Best example of "good practice" becoming a hassle: the "interface for everything" habit. Even when the majority of those interfaces have only one implementation.


I can't stand this. I once worked on a project where there were seven layers of interfaces that all led down to a wrapper around a library and each step was just adding another parameter onto the call in the library. The entire PROJECT didn't need to exist, the owning project could have easily just called the library directly as it already had all the context, maybe with one method to abstract in case we needed to swap the underlying library. I remember thinking I was a bad developer for not "getting it," but armed with 10 more years of experience I've realized it wasn't me.


I've come around on this one. I (now) like having a separate interface, having just method signatures separated out makes it easy to get an overview of the class. It also makes it a bit easier to agree on the interface.


You have an interface already, without separating it from the implementation: the public methods of the class. In java any IDE will quickly give you the class outline showing you the public methods.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: