Good Stuff to know
Topics, notes, opinions, comments, and caveats on important aspects of web development. This isn't intended to provide basic syntax or a tutorial on how to use any language or library, but instead go a bit more in depth into what is important, why it's important, and perhaps some things you may ordinarily miss about it.
General Principles
Make Code Easy to Reason About
Code should be written to be read by humans first, and by computers second. Anyone can write something that will run, the challenging thing is to write it so that people can understand it and easily change it.
Most programmers understand that they should run tests to find performance bottlenecks, rather than coding with performance constantly front of mind. This is because you don't want to write code that will save a millisecond or two over the entire runtime of the application, but adds lots of complexity and rigidity to the architecture.
It is also important to find performance bottlenecks in your day-to-day workflow, as those costs can easily dwarf those of server costs. Typing code may actually be a small portion what you do each day. Most of it is likely taken up by trying to reason about what you or someone else wrote, or about a problem in general. You should therefore try to optimize around the latter problem than the former. A "one liner" may be faster to write, but if it makes harder to decipher what it's doing later on, it will likely increase costs rather than save them.
Always Consider Costs
Everything has trade offs. It's always going to be impossible to perfectly minimize costs, but it is important to consider if doing one thing or an other is going to cost more than it's worth. Tests and Documentation, for example, can be a double edged sword.
Writing automated tests will indeed keep you from having to test everything by hand as you write it, as well as preventing bugs as things change. However, it is possible to write too many tests. They can easily become brittle, and time consuming to fix as the codebase changes. Documentation can help others understand code more easily, but it too can easily end up costing more to fix and maintain than it's worth if one is not careful with it.
The purpose of any tool or process is to reduce costs. If it fails in that function, then you need to reconsider how you're using it or whether you should use it at all.