Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8680] Core: Define Javascript coding standards

GitHub Issuen/a
TypeStory
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-05-17T00:43:17.000+0000
Affected Version/sn/a
Fix Version/sRelease 2.1.0, Sprint 2012-10 Core
Componentsn/a
Labelscore, look1, tbs-2.1.0
ReporterOpie Cyrus
AssigneeOpie Cyrus
Created2012-04-11T12:17:58.000+0000
Updated2017-03-20T17:01:25.000+0000

Description

Define a document that outlines all Javascript coding standards any javascript written for Appcelerator (internal or community contributions) should adhere to. This should represent more than syntax, but general design approaches and process flow. This document will be focused on language only. Platform Specific information will be contained inside another document. This is a collaboration ticket.

Comments

  1. Kevin Whinnery 2012-04-11

    For straight JavaScript language style, I for one really like the Google style guide, and would recommend that as a jumping off point, and then document deviations: http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml Are CommonJS modules and associated structures in scope for this conversation as well? We have a bit of a disconnect there with what is supported in core mobile web, since in the browser we use AMD, and for end developers we support what is essentially node.js' implementation (and deviations from) the spec.
  2. Chris Barber 2012-04-11

    I'll look at Google's style guide, but already I've seen a couple things that I don't agree with. CommonJS modules as well as inline docs are included in this conversation. We'll need to explicitly document style guides for CommonJS (standard and node.js flavors) and AMD formatted modules. Give me a couple days to come up with something to start from.
  3. Chris Barber 2012-04-24

    I've got a pretty decent style guide written here: https://wiki.appcelerator.org/display/pe/JavaScript+Style+Guide It might be a good idea to write some code snippets, but I don't think it's required.
  4. Rick Blalock 2012-04-26

    I like this a lot. Also think having code snippets is handy. I'm a visual kind of person. We're going to have to make sure our CommonJS implementation is better in order for this one to be true: "Object methods SHOULD be defined on the object's prototype, not via "this" in the constructor" . Sometimes it causes parsing errors in iOS :-D
  5. Opie Cyrus 2012-05-01

    Further updates coming from Chris. Once updated, RFC email will be sent to platform and customer engineering.
  6. Opie Cyrus 2012-05-05

    Pending further updates from Chris.
  7. Opie Cyrus 2012-05-17

    Spec is locked down now. Closing.

JSON Source