guitar-academy / gaclient

Web-app dedicated for classical guitarists to build up their skills by doing warm-ups, speed drills, scales, etc.
1 stars 0 forks source link

Coding standard #2

Open digawp opened 9 years ago

digawp commented 9 years ago

Coding standard, unless otherwise specified:

TODO:

9gix commented 9 years ago

Here's my recommendation. Unless otherwise specified, follow these conventions:

For Django & Python,

  1. Django
  2. Python

For HTML & CSS:

  1. https://google-styleguide.googlecode.com/svn/trunk/htmlcssguide.xml
digawp commented 9 years ago

Satu hal yang gw concerned (for now) sih cuma indentation. Buat JS ama HTML, gw merasa 2 space (Google standard) is too small (CS2103 standardnya 4 space) but I know HTML bisa super deeply nested element nya, so I don't know haha.

JS juga ada high chance deep nesting, tapi kalo JS kita bisa refactor (SLAP! CS2103 much lol) Jadi mau turutin Google 2 space or....?

Terus I think mending kalo kita bikin consistent between JS and Python codes, atau beda aja gpp? (menurut those docs, Python 4 space tab, kalo JS 2 space tab)

9gix commented 9 years ago

HTML may be very deep, I think to use 2 spaces for HTML. However for JavaScript, I think 4 spaces is preferable to avoid deep nested code.

digawp commented 9 years ago

Was looking through the html coding standard, there isn't any limit to the no of chars in a line for html, is there?

9gix commented 9 years ago

No hard limit other than your own computer screen.

However, I always follow my own conventions to achieve at most 79 char/line for everything I wrote. There are historical reason why this number, but for me because it fit my Vim Editor when I am on Linux. (*readability)