Over the years I have modified my code formatting several times and in the recent years I avoid tight code as much as possible.Bering relatively new to C++ I have been amazed at the way FreeCAD devs have been jamming up code as tight as possible, avoiding any use of spaces wherever possible, no space lines between methods etc.
When reading the code of PRs I see how tiring it is if it lacks of any useful spaces, new lines or braces because you waste a lot of energy in deciphering every single character to get it in the right context. Thus, the risk is much higher to overlook serious bugs.
I agree with you for the actual implementation. But for classes or functions I don't think that the readability suffers if the opening curly brace is at the same or next line.Personally I find this painful to read, but I've come to realise its a bit of a pattern in C++ land, particularly older C++ code.
I guess Qt devs must use a formatting tool and this it seems can distinguish between header and source files.I'm not sure clang-format can distinguish between h and cpp files. I doun't think so, but heh ..
IMO, most of the rules are OK but there are a few like curly braces for cascaded if-else blocks that I don't like. So, instead ofWe're already seeing in ealier posts that the Qt settings are less than ideal.
Code: Select all
if (codec) {
} else {
}
Code: Select all
if (codec) {
}
else {
}