[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-panel-devel
Subject: Re: QML style guide
From: Aurélien_Gâteau <agateau () kde ! org>
Date: 2012-10-30 17:16:26
Message-ID: 3834789.RHeEvhsE1L () trinity
[Download RAW message or body]
Le lundi 29 octobre 2012 21:42:18 Aaron J. Seigo a =E9crit :
> hi..
> =
> we have a style guide for our C++ code: the kdelibs style, which was most=
ly
> borrowed from Qt. unfortunately for us there was no QML guide we could
> similarly abscond with.
> =
> and it shows.
> =
> summary -> i've started putting together a QML style guide draft and would
> like your input and to bring it completion in a collaboration with all of
> you who are writing QML for Plasma. to that end, i've started a wiki page
> here:
> =
> http://community.kde.org/Plasma/QMLStyle
Good idea. A few comments:
In the example, "property alias bar : actual.property": there is a space =
before the colon, is it on purpose?
I think it would be good to standardize the id of the top-level item. So fa=
r I =
have often seen "main" or "root" used.
JS lines should end with semi-colons. This is expected by JSLint anyway, bu=
t I =
think it is invasive enough to be mentionned explicitly.
The only part I don't really like is putting left curly brace on its own li=
ne =
for functions because:
- having different conventions for event-handlers and function code blocks =
look =
inconsistent
- it differs from many coding styles: Qt QML JavaScript, Douglas Crockford, =
jQuery, Node... so I think it is going to look odd and unfamiliar to many =
newcomers.
Aur=E9lien
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic