Justified Variables: Words of the same length with related meanings
github.com
github.com
Your obsessive compulsions are something to be overcome, not embraced, and certainly not something to force on other people.
If you expect the code to be changed infrequently but read frequently, and if you think the justified version is easier to read or harder to miss errors in, then that could easily outweigh the cost of noisier diffs.
(I'm not sure whether I actually believe the following argument, but:) The increased likelihood of merge conflict is not necessarily a bad thing. If you've got a bunch of variables, structure entries, or whatever, that are related to one another, then if A changes one of them and B separately changes another this very well may be the sort of thing you need to look at carefully and explicitly, which is what getting a merge conflict forces you to do. And (maaaaybe) the more closely related nearby variables (etc.) are, the more likely people who like justified code are to justify them.
Full disclosure: I sometimes justify things in code, in cases where I think it helps to clarify relationships between nearby lines. I don't remember ever getting a merge conflict as a result, or having colleagues complain about noisier diffs. But I've generally worked in small teams and I've often been the only person working on a given bit of code, and what works well in that context is not necessarily the same as what works if you have a much larger group all poking at the same code.
Even if only half of engineers think this is true, the other half should be pragmatic and let the go formatter do it's thing. The best thing about go is that it has one standard formatting.
As for equal length variable names, the majority of these examples you would use naturally anyway, so I am not sure what are you so upset about (top/not instead of true/false is a bit overkill)
Why should a group of tolerant people bend to the wishes of a group of intolerant people? That's how I see the whole formatting debate.
Why should people comply with a formatting that is demonstrably worse in concrete ways (let's not even start talking about how it makes the need for ugly line-breaks occur much sooner), and to many is harder to read?
I don't understand why people feel the need to force their obsessions on other people. If you find it harder to read without a specific formatting, please go and develop some plugin in your fancy editor to display it to you that way. Just deal with it on your end and don't make it my problem.
And now I'm reminded of http://bash.org/?406381:
<Axe> I
<Axe> do
<Axe> not
<Axe> know
<Axe> where
<Axe> family
<Axe> doctors
<Axe> acquired
<Axe> illegibly
<Axe> perplexing
<Axe> handwriting;
<Axe> nevertheless,
<Axe> extraordinary
<Axe> pharmaceutical
<Axe> intellectuality,
<Axe> counterbalancing
<Axe> indecipherability,
<Axe> transcendentalizes
<Axe> intercommunications'
<Axe> incomprehensibleness.
<JediHobbes> woah
<JediHobbes> *blinks*Perhaps the worst example of this is Kotlin’s var/val. I much prefer var/const.
`command get/set [long directory]`
Because of that long directory part, I use the command history instead of retyping the whole thing. I probably already lost a cumulative total of hours executing `set` instead of `get` by mistake.
nextAncestor
previousAncestor
line up the same way as nextAncestor
prevAncestor
so I admire the author’s time spent collecting these word groupings. name & value & comment \\
long name here & 1 & one\\
x & 2 & two \\
and the columns line up at the & characters by adding suitable whitespace. Imagine some control character that you could insert in source code: next&Ancestor &= current->next;
previous&Ancestor &= null;
and the corresponding parts would line up in consecutive blocks, like elastic tab stops but even inside words by stretching the existing whitespace around the words. julia> 2π
6.283185307179586\pi → π
That works for any programming language. I’ve used it occasionally for my own programs but use plain ASCII if I expect others to work on the code.
In finance, there are lots of traditional Greek-letter names. Using gamma/delta/theta is probably _more_ immediately comprehensible to your audience than, say, secondOrderUnderlyingSensitivity/underlyingSensitivity/timeDerivative. (Of course, in this case you don't get to choose which Greek letters you use.)
There are other contexts where particular Greek-letter names are traditional. Again, usually you don't get to choose which ones you use (at least, not if you want to get any familiarity advantage from using them).
When doing algebraic manipulations, sometimes it's convenient to give one set of variables Latin-letter names and another "parallel" set corresponding Greek-letter names. E.g., if you're doing plane geometry, maybe one point is (x,y) and another is (xi,eta). In software, this is probably a strictly worse strategy than calling them (x1,y1) and (x2,y2) or something of the sort.
doing
words
fixed
style
takes
moxie> moxie
> n. The ability to face difficulty with spirit and courage.
Thanks!
I also think there should be a place for "many" in the "some" and "none" grouping.