[TUHS] python

Larry McVoy lm at mcvoy.com
Sat Aug 5 01:10:55 AEST 2023


On Fri, Aug 04, 2023 at 11:04:16AM -0400, Dan Cross wrote:
> On Thu, Aug 3, 2023 at 9:58???PM Adam Thornton <athornton at gmail.com> wrote:
> > What we've done on my current project is pretty much equivalent to the route Go chose.
> >
> > Go has go fmt; doesn't matter what you personally believe, just run that pre-commit, and you get a consistent style.  For Python we use black.  Same idea.  It's not what everyone would have chosen--in fact, precisely what it does is not what *anyone* on the project, probably, would have chosen--but the fact is, it does something sane and pretty readable, and then there's no fighting over style.
> 
> This.
> 
> I despised Google's C++ style standards, but I respected them because
> they allowed Google to scale to hundreds of millions of lines of C++
> code that was at least intelligible to more or less anyone who worked
> there. After a couple of months, people stop noticing the sharp edges
> and differences from their personal styles.
> 
> The decades spent arguing over where to put the braces seem wasted, in
> retrospect.

I can get used to anything, no argument there.  I'm teaching my kid 
some programming and he is eating up my style because I tell him why
it is like that.  For example, 

int
some_func(int some_arg)
{
}

not 

int some_func(int some_arg)
{
}

because I can do

grep '^some_func(' *.c

and find the declaration.

I "won" the braces argument by starting my own company and people were
pretty happy with the resulting code.

--lm


More information about the TUHS mailing list