Yinteger / Jiggy.io

GNU General Public License v3.0
1 stars 1 forks source link

Write up coding standard #12

Open breautek opened 7 years ago

breautek commented 7 years ago

https://github.com/YuniYasha/Jiggy.io/wiki/Jiggy.io-Code-Style-Guide

Yinteger commented 7 years ago

We should decide on a tab standard and add it to the doc

Yinteger commented 7 years ago

Actually I'll grab the style guide I wrote for work and we can base it on that a bit perhaps

breautek commented 7 years ago

Sure thing. I also added you to this ticket since I guess we can assign more than one person to a task. Which is kinda neat. Makes sense since this will obviously be a team effort.

breautek commented 7 years ago

I'm not sure why tsc is not enforcing this because we do have "noImplicitAny" set to true,

but all variables, including local variables should define the expected type.

This is valid: var c: Color = getColor();

This is not valid (but the compiler doesn't complain) var c = getColor();

This not only makes the intent clear, but it also helps with any kind of refactoring. Should getColor() API change and return a color (perhaps returning a color string instead), it will make it much easier to find the usages of places that expects Color but should also be refactored.