PDA

View Full Version : Coding styleguide



Chemist
10 Apr 2013, 10:43 PM
I'm writing one more big application based on ExtJS framework and see, that when the amount of code becomes bigger day after day, i have to refactor it to make it more readable/maintainable. So the question : Are there any where coding styleguide for javascript applications based on ExtJS?

evant
10 Apr 2013, 10:50 PM
What specifically are you wanting to see?

Chemist
10 Apr 2013, 11:55 PM
What specifically are you wanting to see?
Something like this : http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml

With explanations on how you can make your code more readable, like - writing comments(what we expect to see in those comments), moving events handlers from component configuration to class function, maybe splitting configuration in initializecomponent when it has several object one in another & etc. Maybe someone already wrote that stuff ...

evant
11 Apr 2013, 12:05 AM
I think a lot of the things in that guide are either:

a) Things common to all JS that should be followed regardless
b) Things that are common across all languages

There's certainly some useful things in the linked guide, but a majority of it is just common sense and good all-round coding practice.

Chemist
11 Apr 2013, 1:30 AM
The problem for me is that I have new members in the team who I cannot control, and they have strong jQuery background. After this - they try to make every view with XTemplates with big html code which will lead us to problems in future, so the only way for me is such obvious thing as this - coding style guide. so i'm searching for one. If someone did that - it would be great to see it and maybe take some information from it.

Arg0n
11 Apr 2013, 2:33 AM
Here you can find some small information:

http://docs.sencha.com/ext-js/4-2/#!/guide/command_code (http://docs.sencha.com/ext-js/4-2/#!/guide/command_code)

For docblocks I use the JSDuck tags and style:

https://github.com/senchalabs/jsduck/wiki



(https://github.com/senchalabs/jsduck/wiki)

Marco Piccolino
29 Jan 2015, 4:40 AM
Finally Sencha does have an official styleguide:

https://github.com/sencha/code-guidelines

Marco