Re:Black, the uncompromising Python code formatter, is stable
by LegionMammal978 on Saturday January 29, 2022 @05:51PM
(#30131416)
I've recently been working with an old C++ codebase that formats every function call like this:
Foo<Bar,Baz> value = some.method (1, 2, 3 + 4) ;
// or with no parameters:
value = some.method() ;
I've never seen it anywhere else, and it took me a good week to get used to it.
Re:Black, the uncompromising Python code formatter, is stable
by goblin89 on Saturday January 29, 2022 @09:57PM
(#30133433)
You might not have been writing JavaScript. For objects, spacing properties from curly brackets is pretty much the norm, Prettier does that by default. For lists I see it rarer but I personally use it instinctively for consistency with objects, especially with things like useState destructuring and ([ complex, ...splatting, ...combinations ]) into function calls (which admittedly becomes uncomfortably terse).
Re:Black, the uncompromising Python code formatter, is stable
by goblin89 on Sunday January 30, 2022 @06:56AM
(#30136271)
And here’re some fresh examples with lists just encountered in the wild: https://developer.matomo.org/guides/tracking-javascript-guid...
If anything I’m seeing the opposite trend with a few devs writing “[1,2,3]” so that large constant literals don’t overflow the line.