I don't always write javascript, but when I do I follow these rules