I wish the GNOME community would embrace one of two viewpoints:

- Code formatting does not matter
- Code formatting matters, and is *entirely* maintained and enforced by a tool (cf go fmt, rustfmt, black)

It's heartbreaking to see code reviews which ask only that the authors change things which have no semantic meaning. What a waste of limited time that we could spend on making the software work well.

@wjt Personally I've been slowly growing fond of using “whatever code formatting some tool enforces” and lately I'm even starting to think that merge requests should be accepter with whatever formatting the contributor sends it, and using some hook at merge time to run the tool over the code.

@wjt I've recently had enough myself, and added the style checker job to the GTK CI. The problem is, as always, that large code style formatting changes on an old code base that had no consistent coding style for a long time, break tools like git blame, so we can't just run a conversion tool on contributions. Well, that, and the fact that no tool manages to handle the weirdo GTK-style argument alignment without literally accessing the AST from a compiler and rewriting the code on the fly.

@ebassi @wjt ...which means it might be about time to reconsider the weirdo GTK-style argument alignment 🙃

@aperezdc @wjt But it's so elegant and easy to read!

I mean: yeah, we might do that, but

- it's really nicer to the eye when scanning declarations visually
- changing the code now would mean chucking the output of `git blame` out of the window forever

@ebassi @aperezdc @wjt refusing to clean up or update code for the sake of preserving the oh-so-sacred git history is one of the greatest ills of modern software development. Just acknowledge that tools to browse git history are shit, move on and keep your codebase clean. It is much more valuable to have clean code than to be able to know whoever wrote a line of code.

@wjt I happen to disagree, at least somewhat. At the core of it, of course formatting matters, as do comments and naming. To say that cleanups only waste time is plain wrong. But I remember dealing with the tool enforcement and it's only a partial success. Solaris had one for C, which was sort of okay. The pep8 in Python is somewhat better, but perhaps thanks to it being Python.

@wjt code formatting matters but only when I review it. if you review my code it doesn't matter

@wjt @angristan totally agree ob this. In my team we are using in solution for code formatting and I told everyone that I refuse top discus formatter settings. Thankfully there were'nt any.

Sign in to participate in the conversation

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!