Dudes of 708's knowledge base for getting started and tools we use
Back to homepage • software development
Please select the relevant programming language below.
The official C style guide is coming soon. For now, please contact our engineering manager Gideon Tong <gideon@dudesof708.com> for guidelines on writing C.
Our Javascript style guide is adapted from Airbnb’s Internal ES6 Style Guide. Listed below are the most important resources, but for more style guidelines and interpretations, see the Airbnb style guideline link above.
const
and avoid using var
, if necessary, use let
for scoping.Initialize objects by using literal syntax. Example:
const item = new Object();
Only quote object properties are are invalid identifiers. Example:
const object = {
foo: 3,
bar: 4,
'data-blah': 5
};
Do not call Object.prototype
methods directly, instead use the prototype. Example:
// do this
Object.prototype.hasOwnProperty.call(object, key));
// not this
object.hasOwnProperty(key);
Use Array.from
instead of Array.map
. Example:
Array.from(foo, bar);
Use Array.forEach
rather than for loops or another iterable. This prevents mutating the original array. Example:
array.forEach((item) => {
// do something cool
});
Avoid self-invoking functions. If you choose to use one, wrap one in parenthesis. Example:
(function() {
// do something cool
})());
Use arrow function notation for an anonymous callback. Example:
const myArray = new Array();
myArray.forEach((item) => {
// do something cool
});
Use multiline imports. Example:
import {
moduleA,
module B,
module C
} from 'package';
The official Python style guide is coming soon. For now, please contact our engineering manager Gideon Tong <gideon@dudesof708.com> for guidelines on writing Python.