Spring is here! Spring signifies the start of new beginnings. Why not a new Adobe ColdFusion Project?
The powerful and hopeful feeling you get when starting a new CFML project is like the early days of spring. Just like spring, however, your project can quickly turn to rain showers if you don’t follow some basic best practices before you start.
What are Best Practices?
Best practices are procedures that have been shown through research and experience to produce optimal results. Best practices, however, are constantly changing.
Nolan Erck said it best in the ColdFusion Alive podcast #047, “Best Practices Are Best, Except When They’re Not,”
“…it might be a best practice today, but may not have been a best practice five years ago. And it might not be a best practice five years in the future.”
Why Use Best Practices?
Best practices can be used to speed up the development process. They can also keep you from making valuable mistakes that could cost you dearly in time and resources.
As a company, you may have a list of best practices already compiled. If not, you can easily document a list of your own by reflecting on completed projects.
Top 11 Universal Best Practices
Of the many best practices I’ve found, I have picked 11 that have worked for me now and in the past.
- Avoid Technical Debt – According to techopedia.com, technical debt is:
“… a concept in programming that reflects the extra development work that arises when code that is easy to implement in the short run is used instead of applying the best overall solution.”
2. Use a Version Control System or SCM System – A version control system, like Git, is a vital component of a trouble-free development, testing, and production hosting environment. Using a version control system will pay off handsomely when it comes to securing your code, handling conflicts, and facilitating troubleshooting.
3. Use Consistent Server Architecture (development, testing, and live) – This is probably the most important practice! If you want to remove inadequacies, lower your costs, and improve performance, you need to have a systemized deployment workflow.
4. Add Provisioning Tools for all Environments – Scripted provisioning is a very large step towards reducing the cost and risk of building new servers. With this, you can:
Skip days of repeated hand-configuration effort every time a new developer starts
Gain cost and operational flexibility
Allow for easy hosting upgrade or downgrade path if your needs change.
Scripted provisioning is an important factor when making your test and live hosting environments more stable and consistent. Docker and CommandBox are a common way to achieve scripted provisioning for a team.
5. Excess Code is Bad – Code can go wrong. It needs maintenance and upkeep. Write less worthless code and delete code that doesn’t work. Don’t write code you don’t need. It’s just a liability. Code review with other team members can help spot excess code and deadwood in your apps.
6. Use a Mature Test Environment – Cutting costs does not mean you can get away with not having a well-configured test environment. You need a consistent, portable development environment to make certain tools useful for configuring. The presence of an identical test system to your development system is a huge step forward when building a professional development workflow. Again, using Docker makes this easy.
7. Use a Flexible and Scriptable Production Hosting Platform – While you may require to have dedicated servers for some or all your web applications, using a more dynamic hosting environment based on Docker running on Amazon Web Services (AWS), Google Cloud or similar providers can help you respond more quickly to changing application usage. When it comes to the testing environment, being able to provision and turn down cloud servers at will helps keep costs down without adding significant overhead to your testing workflow.
8. Use a Continuous Integration (CI) System – A CI system brings all the parts of your development workflow together in an automated way. Once you have a version control system and multi-environment scriptable server provisioning, you need something that triggers multiple things to happen simultaneously when underlying code changes. Jenkins is a good CI system.
9. Have a Ticketing System – An email or a spreadsheet is not a ticketing system. A good ticketing system allows you to track customer and internal development issues with just the right amount of metadata to help prioritize and filter the detail. JIRA is a good ticketing system.
10. Create Documentation – This is not just about documenting your code (which is always a good idea), but also documenting:
Procedures and standards for version control
Changed management procedures
11. Monitoring and Profiling Tools – There are several tools (like FusionReactor) that offer visibility into where your codebase needs optimizing – like a heat map for problems in your code. Advanced configurations can also include setting benchmarks for application performance.
Why Best Practices?
Remember that best practices are best until they’re not. Always be aware and update a practice when it has been replaced with something better or new technology has come along and removed the need for it.
By all means, add the practices I have outlined in your own documentation, but you should strive to find what works best for you company and have your own list.
Make it fluid, and make it count!
- Nolan Erck says technical debt is related to best practices. In the ColdFusion Alive podcast #047, he says:
“the general consensus is the fewer best practices you use, the more likely you are to incur technical debt in your application. And technical debt is basically bad stuff that happens in your app. The example I usually give to my non-technical clients when I'm discussing changes we're going to make to their web that is we yes, we can do things, we can fix your bug with this really short-term quick fix. We'll take an hour or two, but there's a lot of technical debt involved in that. Or we can budget a little bit more time and fix it a more proper way. They'll be less technical debt there.”
And to continue learning how to make your ColdFusion apps more modern and alive, I encourage you to download our free ColdFusion Alive Best Practices Checklist.
Because… perhaps you are responsible for a mission-critical or revenue-generating CF application that you don’t trust 100%, where implementing new features is a painful ad-hoc process with slow turnaround even for simple requests.
What if you have no contingency plan for a sudden developer departure or a server outage? Perhaps every time a new freelancer works on your site, something breaks. Or your application availability, security, and reliability are poor.
And if you are depending on ColdFusion for your job, then you can’t afford to let your CF development methods die on the vine.
You’re making a high-stakes bet that everything is going to be OK using the same old app creation ways in that one language — forever.
All it would take is for your fellow CF developer to quit or for your CIO to decide to leave the (falsely) perceived sinking ship of CFML and you could lose everything—your project, your hard-won CF skills, and possibly even your job.
Luckily, there are a number of simple, logical steps you can take now to protect yourself from these obvious risks.
No Brainer ColdFusion Best Practices to Ensure You Thrive No Matter What Happens Next
ColdFusion Alive Best Practices Checklist
Modern ColdFusion development best practices that reduce stress, inefficiency, project lifecycle costs while simultaneously increasing project velocity and innovation.
√ Easily create a consistent server architecture across development, testing, and production
√ A modern test environment to prevent bugs from spreading
√ Automated continuous integration tools that work well with CF
√ A portable development environment baked into your codebase… for free!
Learn about these and many more strategies in our free ColdFusion Alive Best Practices Checklist.