I did not see a preference mentioned in the guide and read on down to “zen”, where I do note “Focus on code rather than style”… nevertheless, any leaning here? In particular, WITHIN std. (I have not looked hard and deep at std code, but even if 90% was one way and only 10% the other, I wouldn’t necessarily know if there’s a tide shift underway.)
I like how “way one” corresponds to function calling (most often), and I like how “way two” corresponds to structs. I don’t love how indentation works out in “way two”, but would be happy to get used to it.
(Note: tagged this ‘language’ because I didn’t see a ‘style’ tag and wasn’t sure what might be more appropriate)
I prefer the first unless I feel the line is getting too long or I feel that it gives clarity. Either way, it is completely arbitrary, and I have no problem using both within the same project and file.
I don’t think either is “preferred”, and zig fmt supports both by the presence or lack thereof of a trailing comma.
I’ve come to prefer putting each thing on its own line for the sole reason that it makes diffs between versions more readable. It’s not an absolute, though, it’s a balance, brevity often wins.