[QBS] qbs code style?

joerg.bornemann at nokia.com joerg.bornemann at nokia.com
Mon Jun 18 07:46:20 CEST 2012

Hi Yuchen,

There's no coding style document yet. I suggest to adpot the QML coding style where it makes sense for us:   http://qt-project.org/doc/qt-4.8/qml-coding-conventions.html

To use == instead of === can be surprising if the operands have different types. If were comparing strings like in your example then === does not perform type conversions. That gives us a theoretical performance advantage which is most probably neglectable. :)
I suggest to use == in the general case and === where type conversion is explicitely unwanted.

For string literals I suggest to use double quotes for strings of a length > 1 and single quotes for single character strings. E.g. like in C "foo" and 'X'.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20120618/2c9d3e7c/attachment.html>

More information about the Qbs mailing list