On Tuesday, December 31, 2013 2:05:06 PM UTC-5, John Myles White wrote:

> (7) + (8) These rules are part of the official Google style guides for R, 
> which is the language with the most similarity to Julia that’s being used 
> at companies with public facing style guidelines. I think they’re quite 
> sensible rules, which is why I decided to borrow them from published 
> standards. 
>

I also think (7) (trailing space after comma in array indexing, e.g. x[a, 
b] ) is quite sensible, though, in what I freely admit is pure 
bikeshedding, I do sometimes find an exception, that the readability of a 
trailing space depends on the length of the index variable names.

(A1) counts[a,b,c,d]
(A2) counts[a, b, c, d] 

(B1) counts[topicIndex,docIndex,ideologyIndex,genderIndex]
(B2) counts[topicIndex, docIndex, ideologyIndex, genderIndex]

I personally find A1 > A2, but B1 < B2.  (higher = more readable).

Not sure where the threshold is, in terms of variable nmae lengths.

(C1) counts[aa,bb,cc,dd]
(C2) counts[aa, bb, cc, dd]

(D1) counts[aaa,bbb,ccc,ddd]
(D2) counts[aaa, bbb, ccc, ddd]

Or maybe it partly depends on number of dimensions.

(E1) counts[a,b]
(E2) counts[a, b]


For me I find, at least when looking at this email when the alternatives 
are placed side-by-side like that:

A1 > A2
B1 < B2
C1 > C2
D1 < D2
E1 > E2

On the other hand, my 1>2 preferences are fairly weak, but B1<B2 is very 
strong.  I'm not sure there's a good simple brightline for when it's ok to 
violate rule (7) ... maybe only when all variable names are single letters? 
Nah, that's too complex already.  Therefore (7) is sounding more sensible 
the more I think about it.

Brendan

Reply via email to