[Branch ~go-bot/juju-core/trunk] Rev 1666
Tim Penhey
tim.penhey at canonical.com
Mon Aug 19 21:42:21 UTC 2013
On 19/08/13 20:52, Henning Eggers wrote:
> On 16.08.2013 13:11, Nate Finch wrote:
>> Personally, I prefer variables in the 1-4 character range, because they are
>> less prone to typos and I find them easier to read when embedded in complex
>> expressions.
>
> That is something I was surprised to see in many places when browsing the juju
> go source. Abbreviations or even single letters for variable names are against
> what I have been taught and practiced as good software engineering over the
> last twenty years or so. The rule may be emphasized differently in different
> software projects but it really struck me as very lax in the juju source.
I do have to say I agree with Henning here.
It is my *strong* preference to have full pronounceable, meaningful
names. IMO "information" is not meaningful (neither is "state")
As mentioned on our weekly call, all core developers please buy a copy
of "Clean Code" by Robert C. Martin, and expense it if you don't already
have a copy.
We are going to start doing a chapter by chapter review.
> Is there a coding style guide for go juju?
Not really.
Code should be written to be read by *humans*, not compilers.
Code will be read so much more than it will be written, and often by
people who aren't as familiar with the details or intricacies.
Meaningful variable names are a key component of good readable code.
Tim
More information about the Juju-dev
mailing list