Policies for coding

Gustavo Niemeyer gustavo at niemeyer.net
Mon Aug 26 16:56:40 UTC 2013


On Fri, Aug 23, 2013 at 12:47 PM, Nate Finch <nate.finch at canonical.com> wrote:
> On the interface point, I agree with Roger. To me, this is a classic example
> of good programming practice: Have your methods accept the most general
> types coming in, and return the most specific types going out. This leads to
> the least coupling between bits of code, while allowing the most
> functionality.

As an overarching, vague, and obvious comment, but nevertheless worth
emphasizing, watch out for both excess generalization and excess
specialization. As long as it doesn't compromise the medium/long term
in a relevant way (and often it doesn't), doing the simplest thing
that solves the real problem at hand tends to be quite fruitful.


gustavo @ http://niemeyer.net



More information about the Juju-dev mailing list