[Dojo-interest] Code conventions

Alex Russell alex at dojotoolkit.org
Tue Apr 4 19:15:52 MDT 2006


Dylan: no I'm not posting under a different name ;-)

Torkel: Dojo is a large system with many hands on the code. I agree that 
it would be good if all the code adhered strictly to the style guide, 
but for minor whitespaces changes I think we've pretty much agreed to 
disagree as a project. We're more likely to spend time/effort on 
non-trivial style violations.

Regards

On Tuesday 04 April 2006 4:11 pm, Dylan Schiemann wrote:
> Torkel Holm wrote:
> > Alex Russell wrote:
> >> On Wednesday 22 March 2006 3:26 am, Torkel Holm wrote:
> >>> Is the style guide[1] deprecated?
> >>> I do a lot of diving through the source and it doesn't seems
> >>> that everyone agrees about it ;)
> >>
> >> Feel free to point to places that don't conform. We'd like to fix
> >> them.
> >
> > It's primarly about the layout section.
> >
> > I can probably pick a random file and find all permutations of
> > different statement layouts etc. where different coders have
> > contributed ;)
> >
> > I don't think a need to give a rationale for this.
> >
> > Lets take the for-statement
> >
> > (1)
> > // compact
> > for(initialization;condition;increment){
> >
> > (2)
> > // space before the opening brace
> > for(initialization;condition;increment) {
> >
> > (2)
> > // space after semicolon
> > for(initialization; condition; increment){
> >
> > (3)
> > // space after reserved word and before brace
> > for (initialization; condition; increment) {
> >
> > Why not strictly follow the "de facto" Java (I know we are talking
> > about Javascript ;) ) code conventions promoted by Sun which are
> > used by both Mozilla and Microsoft for Javascript code?
> >
> > example:
> >
> > for(var i=0;i<a.length;i++){
> >     doSomething();
> > }
> > // vs
> > for (var i = 0; i < a.length; i++) {
> >     doSomething();
> > }
> >
> > I prefer to used the rhino compressor and gzip :)
>
> Alex, are you sure you aren't posting under a different name ;)
>
> Seriously though, I think most of us prefer:
>
> for (var i=0; i<a.length; i++) {
>
> Really though, minor whitespace differences like this just isn't that
> important to me.  I leave that to the python community :p
>
> -Dylan
> _______________________________________________
> Dojo FAQ: http://dojo.jot.com/FAQ
> Dojo-interest at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest

-- 
Alex Russell
alex at jot.com
alex at dojotoolkit.org BE03 E88D EABB 2116 CC49 8259 CF78 E242 59C3 9723
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://mastodon.dojotoolkit.org/pipermail/dojo-interest/attachments/20060404/8f701b28/attachment.pgp


More information about the Dojo-interest mailing list