[Qt-creator] Required conventions (was: Documentation for plugin development)

Tobias Hunger tobias.hunger at digia.com
Tue Nov 26 12:15:04 CET 2013


On 26.11.2013 11:43, Mateusz Loskot wrote:
> On 26 November 2013 10:10, Tobias Hunger <tobias.hunger at digia.com> wrote:
>> * Please make sure to follow the coding style.
>> http://doc-snapshot.qt-project.org/qtcreator-extending/coding-style.html
>> has the details.
>> (...)
>> There usually are lots of misplaced * and & chars in newly
>> submitted code, too.
>
> Or, one day, Qt will drop its C with classes heritage
> and allow folks to apply C++ semantic and emphasize actual type
> instead of syntax ofdeclaration as C folks do.

Sorry, but this is not about personal preferences. Qt Creator is too big 
for that.

This basically boils down to how easy it is to work with the code: It is 
so much easier to (git grep|search and replace|run scripts) when 
everybody follows the same set of rules.

Yes, you can not fully rely on everybody doing the right thing, but at 
least you can automate the majority of issues you are looking at and 
only have to fix up those few places where somebody screwed up.

Yes, you can also use regexps, but those get complex enough without 
having to worry about all possible whitespace schemes any contributor 
might have come up with.

> Besides, whoever created the rule of
> "always use a single space before an asterisk (*) or an ampersand (&),
> but never after"
> doesn't seem to mind useless rules:
>
> char **p;

I think that is actually covered by "As usual, rules are not set in 
stone. If you have a good reason to break one, do so. But first make 
sure that at least some other developers agree with you." right in the 
second paragraph.

> I don't mean to start a discussion about it,

It might be a good idea to not post to a mailing list then...

 > as I don't really care about those rules myself.

I see, a true rebel coder:-)

Best Regards,
Tobias

-- 
Tobias Hunger, Senior Software Engineer - Digia, Qt
Digia Germany GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Tuula Haataja
Sitz der Gesellschaft: Berlin. USt-IdNr: DE 286 306 868
Registergericht: Amtsgericht Charlottenburg, HRB 144331 B



More information about the Qt-creator mailing list