Skip to content
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.

Add Javascript Coding Standard #91 #111

Closed

Conversation

sihaoo
Copy link
Contributor

@sihaoo sihaoo commented Dec 22, 2015

Fixes #91
Based on the HTML coding standards md from #93

Based on the C++ coding standards md from nus-cs2103#93
@sihaoo sihaoo changed the title Add Javascript Coding Standard Add Javascript Coding Standard #91 Dec 22, 2015
@damithc
Copy link
Contributor

damithc commented Dec 31, 2015

Looks like this got left out of the review.

  1. Look at the Java/C++ standard .md and .html file and try to follow a similar style where possible.
  2. Modify the link from README.md

@sihaoo
Copy link
Contributor Author

sihaoo commented Dec 31, 2015

I have referenced mainly from the HTML standard file in #93 and copied the content from the link referenced in README.md. Do I recreate a new one to reference from Java/C++ instead?

@damithc
Copy link
Contributor

damithc commented Jan 1, 2016

See #97 for an example.


// G_O_O_D
var FEEDBACK_RESPONSE_RECIPIENT = 'responserecipient';
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use other examples here? These examples are taken from TEAMMATES and may be confusing to developers not in that project.

@sihaoo
Copy link
Contributor Author

sihaoo commented Jan 2, 2016

I will make the changes! Thanks!

2. Modified the content based on comments given.
3. Included html file to reference to markdown file
@sihaoo
Copy link
Contributor Author

sihaoo commented Jan 4, 2016

Sorry for the late update! Was away.

  1. Updated format to adhere to example Add an HTML coding standard #93 #97
  2. Modified the content based on comments given.
  3. Included html file to reference to markdown file

- __Indentation__

Indentation should be 4 spaces for javascript files.
4 spaces should be used instead of 2 `spaces` or `tab`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to wrap spaces as code.

@wkurniawan07
Copy link
Contributor

Also:

  1. Modify the presentation of good/bad examples to follow the way used in Add an HTML coding standard #93 #97.
  2. Update the link to the coding style in README.md. This will be the link. It won't work if you try now but it will later on when this PR is merged.

3. [Future of Javascript (ES6 - Incoming Features)](https://github.com/lukehoban/es6features)
4. [ES6 Compatibility in Browsers](http://kangax.github.io/compat-table/es6/)
5. [Useful CSS Selectors to know](http://code.tutsplus.com/tutorials/the-30-css-selectors-you-must-memorize--net-16048)
6. [W3schools CSS Selectors Reference](http://www.w3schools.com/cssref/css_selectors.asp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the last two references are relevant.

1. Remove wrap from spaces as code
2. Updated link
3. Updated the presentation of examples
4. Updated link on README.md
<pre lang="javascript">
// bad
var foobardescription = 'helloworld';
</pre>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is duplication of the first bad example.

@wkurniawan07
Copy link
Contributor

Some general comments:

  1. You're still using tabs in some places. Change them to 2 or 4 spaces as appropriate.
  2. You don't need the // good or // bad comments anymore as the table header will already tell.
  3. Don't line break before closing </pre> because the line break will be rendered.

</pre>
</td>
</tr>
</table>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, for this table, rather than making the good and the bad side-by-side (not balanced since there are 3 bad examples), you can make the table entirely sequential, for e.g the example of good/bad attributes in the HTML coding standard.

@wkurniawan07
Copy link
Contributor

@sihaoo I haven't checked on this for a while. Any updates?

@damithc
Copy link
Contributor

damithc commented Aug 10, 2016

Closing due to inactivity. Reopen if you decide to work on this again @sihaoo

@damithc damithc closed this Aug 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants