Re:Beyond PEP 8 – Best practices for beautiful intelligible ...
by bsder on Saturday August 08, 2015 @07:06PM
(#10028919)
Huh? I could have sworn that Python didn't allow a break after a function call. There is something odd in the grammar that does weird things that I have tripped over that forced me to use a continuation character where I really wanted to just use a line break. And, it should be Python because what I'm remembering would need to be a whitespace-delimited language. I'll leave it up to the language lawyers to find. :)
> Interestingly, notice that in your quick back-of-the-envelope example your variable and function names are quite redundant.
Agreed.
The keyword argument is likely to specify things like "maxBufferLengthBytes" even as the variable does. The problem is that they serve two different purposes. The variable is moving around the program and needs to carry it's meaning with it, while the keyword argument serves to document the API that the function is part of. Because they are orthogonal, they are redundant.
In the end, the goal is productivity. I can live in 80 characters if I have to, but, if I'm in charge, it's 120-130.
Raymond's warning about reformatting introducing bugs is spot on though.
Interestingly, notice that in your quick back-of-the-envelope example your variable and function names are quite redundant. I know it was throwaway and it wasn't your point: I'm not suggesting you were holding it up as good naming, but it is interesting that the toy examples being quoted have to work quite hard to make it bad. That suggests to me that a lot of the problem is manufactured, in practice.