CONSTANT_NAME variable_name ClassName functionName
-
Naming things is cheap--have DESCRIPTIVE NAMES. It should read as close to natural language as possible, avoiding abbrevs. and in-house language when possible.
-
Functions should have one thing they do. Endeavor to have pure functions, so that they do not have side effects. Functions should be have a maximum of three arguments. Good functions have one or two.
-
Avoid being clever and implicit whenever possible.
-
Like this sentence
//Comment only when it's not clear what you're talking about
-
Don't rebuild the wheel unless the wheel is a box made of rubber. Then reinvent and open-source that sucker.
-
Classes can be simple. Don't build a monolith if three tiny types will do.
-
Git commits are like bookmarks. Great to find stuff, but too many, too often, makes them less useful.
// not sure on this one
-
Avoid flags whenever possible
-
Build first, then re-factor. DON'T FORGET TO REFACTOR.
-
Bracket spacing
function andClassesToo()
{
if-controls() {
}
loops() {
}
}
Cool, I like your revision. Yeah, #7 is a little controversial. My view on it is that git commits are great for finding things. Great for when you want to revert to a previous code-state, find a specific change, etc. Thus, if commits are too frequent, then it takes longer to find what you want. I could be misguided though