6 Sep 18:30
Re: [Traits] feature request
Martin Chilvers wrote: > Prabhu Ramachandran wrote: >> Hmm, thats a good point and the patch would be extremely simple too. >> Just do nothing if the flag has been set. So here is an updated patch >> and test case. > > Nice! Thanks. > I don't want to preach to the converted (and I'm not ranting here - for a change!), but this issue > is an excellent example of API design by thinking about the intent of the code as opposed to the > technical steps required to get it done... [...] > I'm not criticising here because as developers we often just think about the steps to get something > done, and its only when somebody else comes to use our code that we realise that the API is maybe a > bit odd! It is interesting to me that when you stand back and ask the 'what would I want to write > here?' question, it really seems to help with API designs.. I definitely think that personally > asking that question has significantly improved my code over the last couple of years (and made me > cringe when I look back at some of the crap APIs I came up with when letting the API 'bubble up' > from the low-level details of how things actually get done). > > I know this sounds such an obvious and simple idea, its amazing how often it gets overlooked... This is true in many other fields too. For example teaching is one of the best ways to learn for precisely the same reason. When you try to teach (well!) you try to go beyond just learning the details. The same happens when you explain something you think you know well to someone else, you see something you sometimes haven't and go "Aha!". cheers, prabhu
RSS Feed