This is the first post in a series on writing cleaner code in your WCMS Velocity formats.
Next month, I’ll be starting work on my 6th (!) Velocity-powered framework in the WCMS.
This new framework will be my largest and most widely-used since I started developing for the WCMS back in 2014. Because of this, I’ve been thinking a lot about how to write my Velocity formats in a way that will make the framework easy to maintain and extend in the future.
Unfortunately, neither Hannon Hill nor Apache have made code standards or style guides available (that I could find), and the Velocity language itself doesn’t do much to nudge you toward any kinds of best practices.
This sort of thing makes me super anxious, so I decided to fall back on my two favorite resources when it comes to code quality: Clean Code by Robert “Uncle Bob” Martin, and the PSR Standard by the PHP Framework Interop Group.
In this series on writing cleaner Velocity code, I’ll pull out some practices from both Clean Code and the PSR Standard and talk about how we can apply them to write WCMS frameworks that are less of a headache to manage.