Name your variables meaningfully.

"j" is not a useful variable name. You are not a minifier. Do not assume people understand the role of "j" intrinsically.

Write code to be understood.

Name meaningfully.

Comment about *why* a thing, code should self-explain *what* and *how* a thing.

Don't make shortcuts while coding just because you know what you're thinking and doing in the moment. You won't later.

@mattwilcox Once in a while, take a moment to look at your code. Does it make sense? Could it be organized more sensibly?
@Gjoel I'd say to do that on slightly older code especially. When you have less of that pre-loaded in your mind. But haven't completely forgotten it. That's a good time to become aware of what isn't actually clear, but you thought was, and fix it.

@mattwilcox I sometimes do it if I have worked myself through a big task. Sometimes you get lost in getting the logic right and forget to make it maintainable.

The following mantra is pretty good and scales with time. Making it fast is usually something you do when you find you have an issue, but during initial development there is still low hanging fruit, like picking the right data structures.

Make it work
Make it pretty
Make it fast (optional)