Tuesday, November 25, 2008

Interfaces are implementation details

I believe hiding away the implementations of a code base to be a good thing. I generally try to minimise my interactive surface and make it as user friendly as possible with descriptive names considerate arguments etc.

One thing I have not considered until recently is the very fact that  calling my interfaces IFoo and not just Foo is, in a sense, giving away an implementation detail. is this a .Net thing? Possibly. When I asked my Java mate for his coding standard he informed me that it is common for  quite the reverse to happen in his work place. The implementations of the interface are suffixed with "impl" to imply it is an implementation with the interface having the more user friendly name. Will I change my style? Probably not, as I generally work on other peoples code base and I prefer to stick to language/framework standards, even if they may not be the best (well sometimes).

On a whole other tangent but still discussing interfaces as implementation details Scott Bellware and Greg Young (2 very smart and very opinionated guys) are tussling over this on twitter as we speak.. well as I write..(25/11/2008 ~7am GMT)

No comments: