News for hackers. Stuff that matters.
Re:I think Zig is hard but worth it by xormapmap on Thursday June 01, 2023 @07:07PM (#36158675)
> Agreed. Especially on a formatter. The number of code review comments it cuts out is incredibly time and energy saving.

Are people realistically reviewing code formatting? As long as people aren't making egregious violations I generally don't care if someone leaves a brace on the same line or writes a one-line if statement. I tend to review the overall design and look for bugs and edge cases that might've been missed. If somebody told me they didn't like the way I formatted the code then they've got their own editor and are welcome to change it if they want to be petty.

Re:I think Zig is hard but worth it by throwawaymaths on Thursday June 01, 2023 @07:21PM (#36158795)
Nobody is reviewing it. They are rejecting malformatted code in CI step.
Re:I think Zig is hard but worth it by nickcox on Thursday June 01, 2023 @11:12PM (#36160435)
That's not the workflow your GP is describing.
Re:I think Zig is hard but worth it by hyperhopper on Thursday June 01, 2023 @07:23PM (#36158810)
You're looking at it the wrong way

People review code. As soon as that happens, formatting is part of the conversation. Either consciously or subconsciously

Re:I think Zig is hard but worth it by xxpor on Thursday June 01, 2023 @07:15PM (#36158750)
Absolutely. Inconsistency is sloppy, increases cognitive burden while reading code, and can hide bugs.

Everyone should take the time to setup their editor to format their code consistent with the project style, it doesn't take long at all.

Re:I think Zig is hard but worth it by patmorgan23 on Thursday June 01, 2023 @08:51PM (#36159451)
The point of the auto formatter is to get those slight differences out of the way so your Brian can focus on parsing and understanding the important parts
Re:I think Zig is hard but worth it by brundolf on Thursday June 01, 2023 @09:43PM (#36159851)
In addition to reviews, I've started to really enjoy format-on-save as a way to save keystrokes. Instead of manually formatting my code (even for myself), I can take the shortest editor path to the AST that I want and then have everything else snap into place