RFC Coding Guidelines: Formatting Class Member Declarations | Haiku Project

My two cents on this topic:

  • In general, I hate it, if I have to adapt my preferences or taste because of an inferior technical solution. That’s actually one reason I got involved with software development in the first place.
  • Unfortunately, I am now old enough to admit that I won’t be able to solve all those problems, so sometimes, compromises must be made.
  • I really like the way we structure our headers, and having written a ton of them myself, I know that it’s really simple to do, and problems with it are actually rare at the moment.
  • If this would just be about new C++ features, I’d say let’s wait and see how it’ll go.
  • However, it’s not all this is about, as Pulkomandy nicely pointed out: it would be great never having to worry about the coding style ever again.
  • I know for a fact that many aspects of a coding style are just subjective preferences, and you can get used to pretty much everything, even that ugly style I have to use at work. But I still find it ugly.
  • I’m very sceptical about automatic formatting tools, though, as I haven’t seen one that works flawlessly. Even if they just follow rules, they tend to mess things up, and, since they don’t really understand the semantics that may be behind line breaks and indentations, often choose bad line breaks, for example.
  • I would be against throwing such a tool at our whole codebase at once. For one, see my last point, and secondly, losing all patches in Gerrit would be a show stopper for me. The tool should improve our work flow, and not throw everything away. But maybe it would be possible to automatically convert them, too.
  • I am not convinced of the necessity of a change given the issues it will introduce. If all of this would work out okay in some way, though, it would be a great addition.
  • If we will change the class definition style, I think we should simply use what we had before: single tab at the beginning, and no tabs after. That’s really common, too. I’m not too fond of new experiments like what Pulkomandy suggested. I would also put the curly braces at the end of the line after “class”.
  • But if we really will change the style, I’d have another suggestion: to switch to 100 columns always, and always indent the next line two tabs, not just one.