Comment 7 for bug 1315796

Revision history for this message
Bartosz Kosiorek (gang65) wrote : Re: Apply common Code Style for all Core apps

Thanks for comments.

For me http://qt-project.org/doc/qt-5/qml-codingconventions.html it is draf for formatting style and have many mistakes:

1. Why in following lines are semicolons:
        if (photoImage.width > 200) {
            photoImage.width;
        } else {
            200;
        }
Does it recommend to use it?
Google link about semicolons: https://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml#Semicolons

2. Why function is formatted as:
    function doSomething(x) // javascript functions
    {
     ...
and not like
    function doSomething(x) { // javascript functions
Google link: https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Spaces_vs._Tabs#Function_Declarations_and_Definitions

3. How we should format conditions?
Google link: https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Conditionals#Conditionals

4. Should we use space, tabs or both?
Google link: https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Spaces_vs._Tabs#Spaces_vs._Tabs

5. etc.

Here is article about different JavaScript coding style:
http://addyosmani.com/blog/javascript-style-guides-and-beautifiers/