Added proposed Development Guide (including style guides)

46 views
Skip to first unread message

Javier Pedemonte

unread,
Aug 23, 2011, 10:57:59 AM8/23/11
to maqett...@googlegroups.com
I added a Development Guide wiki page.  It's purpose is to ensure that all of the Maqetta developers are on the same page, in both style and functionality.

Still a work in progress, so please respond if you have any issues or suggestions.


Javier
- maqetta team

Jon

unread,
Aug 23, 2011, 11:26:12 AM8/23/11
to Maqetta Developers
Proposals look good to me, although I'm disappointed that in 2011 we
are still having to indent with spaces.

Jon

On Aug 23, 7:57 am, Javier Pedemonte <jhpedemo...@gmail.com> wrote:
> I added a Development Guide<https://github.com/maqetta/maqetta/wiki/Development-Guide> wiki

Adam L. Peller

unread,
Aug 23, 2011, 11:39:10 AM8/23/11
to maqett...@googlegroups.com
The Google stuff looks like a great starting point.  Some suggested additions:

ES5 array functions: forEach, some, every, indexOf, etc.:  Yes.  Avoid for-loop constructs when one of these would be a simple replacement. They're more readable.

ES5 methods, in general: Yes (except for runtime code).  There's no going back for us.

eval: don't use it at all.  For evaluating JSON, use JSON.parse() for well-formed (i.e. quoted) JSON.  Use dojo.fromJson() for more forgiving -- basically an eval, but let Dojo be responsible for doing the eval so we don't litter our code with what might be eval for other purposes.  Also, if needed, there is a monkey patch that can make dojo.fromJson secure.

Javier Pedemonte

unread,
Aug 23, 2011, 11:06:09 PM8/23/11
to maqett...@googlegroups.com
Added Adam's suggestions.

Also:
- Added a line to enable JS validation in Eclipse.
- Filled out the Separation of Concerns section (although, it could probably use a better title).


Javier
- maqetta team

Jon

unread,
Jan 16, 2012, 5:15:29 PM1/16/12
to maqett...@googlegroups.com
Latest proposal still says "4 spaces". I thought we were going to use tabs instead of space. Otherwise, looks good to me.

Javier Pedemonte

unread,
Jan 18, 2012, 11:39:48 PM1/18/12
to maqett...@googlegroups.com
I updated the wiki page and the Eclipse Formatter Profile to use tabs instead of space.


Javier
- maqetta team

billreed63

unread,
Jan 19, 2012, 9:51:33 AM1/19/12
to maqett...@googlegroups.com
Allow 100-character long lines (instead of 80), this is to restrictive and in my option makes for choppy hard to read code. While I agree we do not want excessively long lines 
I find code that is restricted to 100 characters harder to understand than code the is allowed to follow in a readable manner. 
I would like to see us adapt a more accommodating approach on line length. and allow lines to extent past this limit for the sake of readability.

Adam L. Peller

unread,
Jan 19, 2012, 10:23:49 AM1/19/12
to maqett...@googlegroups.com
how about 'avoid' instead of making it a requirement.  If it's the rare exception that the line exceeds 100, I think we could live with it.  I was able to look at all the long lines in Context.js and find something wrong with them.  Also, AMD will make our lines a lot shorter when we replace all the davinci.blah.blah.blah references with a local variable.

-Adam

Bill Reed

unread,
Jan 19, 2012, 10:26:48 AM1/19/12
to maqett...@googlegroups.com
I like that 'avoid' is a good compromise.

Wayne Vicknair

unread,
Jan 19, 2012, 10:47:23 AM1/19/12
to maqett...@googlegroups.com
i agree. this is the kind of compromise i was seeking in the meeting yesterday.

--wayne

Javier Pedemonte

unread,
Jan 19, 2012, 12:35:28 PM1/19/12
to maqett...@googlegroups.com
I'm fine with "avoid", but I don't want this to be an easy out.  I have yet to see a greater-than-100-char line that couldn't easily wrapped and still remain readable.  If you find one, please provide it as an example.

As I emailed yesterday, the Google Style Guide for JavaScript has a section on wrapping Function Arguments (go to the Code formatting section, 3rd subsection down).


Javier

Javier Pedemonte

unread,
Feb 22, 2012, 12:29:19 PM2/22/12
to maqett...@googlegroups.com
I added a line stating that we should now be using `bind()`, instead of `dojo.hitch` or `var self = this`...


Javier
- maqetta team
Reply all
Reply to author
Forward
0 new messages