Sorry for the delay in posting (6 months, sweet christ), but I’ve been incredibly absorbed in some great projects we’ve got going on at work recently.
However, we’re at a point of reflection now and I feel like this would be a great time to introduce a couple of concepts that I’ve found are key to making code perform well. These may be basic concepts, but they’re things that are key to reinforce:
- The best code you write is code you don’t have to write. While this might sound like an ode to being lazy, it’s not. Think about it in object oriented terms: Write a function you can call instead of several variations on the same code. It hits all the great hallmarks of good code: It ends up being more readable, is more maintainable, and is easier to tune.
- Understand your stack and how what you’re writing affects it. When you write a new function, understand what it’s doing and why. Might it be better implemented at a lower level? If you find yourself operating at one layer of the stack, challenge yourself to step up or down and do it differently. Different languages and technologies can inspire a different way of thinking about the solution to a problem.
- Don’t be afraid to rewrite something. We always hear about sunk cost and always strive for doing things right the first time, but by making sure that we leave ourselves room to iterate (using branched source control, for one) we let our future self make improve on our own thoughts.
- Act like an Engineer, not a developer or code monkey. Apply scientific rigor to what you do: measure, test, and re-measure. Prove out your assumptions using whatever you can (I’m a huge fan of napkin math), and continually think about how to solve problems rather than accomplish tasks.
- Never stop learning or being excited. We work in technology, and it’s amazing. From medical science to astrophysics to quantum technology we are seeing breakthroughs every day. The best way I know to keep my motivation up is to continually learn new things, even if it’s outside of my particular job. Learning about how sys-admins accomplish their job led to a better understanding of SAN technology, which leads directly to better tuning it.
These are just a few of the multitude of things I’ve learned over the past few years, and I don’t expect the rate will slow down at this point. Are there things you’ve learned along the way you want to share? Let me know.