Kai Koenig talks about “Improve your CFML Code Quality (with some Cool Tools)” in this episode of ColdFusion Alive Podcast, with host Michaela Light.
- Why does code quality matter?
- Long code lifetime
- Reduce maintenance cost
- Easier to read
- Reduce bugs without testing
- What does code quality mean in practice?
- Bad Code smell (see below for article)
- Bad variable or function naming
- Poor var
- What tools are there for managing and measuring code quality?
- Code review tools
- Code of conduct for code reviews
- Egoless programming
- Rhodecode repository
- Upsource from Jetbrains
- Static analysis
- Runtime analysis
- Code coverage / execution paths
- Duplicate code
- Code Correctness
- Does the code fulfil its spec
- Behavior Driven Development
- McCabe index
- # Lines of code per class/component/function
- Cyclic dependency trackers
- Dependency graph generation
- Code review tools
- Why is there a lack of tools for CFML in this field?
- CF less formal than some other languages
- RAD focus
- Historically CF attracts a lot of cross-training developers, less of a formal Computer Science background
- Allaire, Macromedia and Adobe have not been interested in this aspect of a language ecosystem
- What cool tools exist for other languages?
- What tools do exist for CF?
- A bit stale – no good support for cfscript
- CFQueryParam checker
- Based on CFparser (using ANTLR compiler generator)
- Outputs HTML, XML or JSON for Findbugs
- 2.0 will have API
- CFLint code of conduct
- Various doc tools
- Home-brew stuff for specific use cases
- Why are you proud to use CF?
- Can be released rapidly and is maintainable and works well with Java
- WWIT for you to make CF more alive this year?
- Better CF developer tools
- Market position of paid server product – open source version
- More publicity for Lucee as open source language
- Shift perception
- Ortus tools
- Ortus buy ColdFusion
- What are you looking forward to at CFCAMP?
Let's talk about code quality.
We all agree that our code needs to be functional so that it meets business requirements. We also should aim for code that is well written and maintainable for future changes. There are a lot of elements playing into that. A well thought system architecture is an important foundation. The selection of an appropriate framework could be the next step. In the end you might look at how to format and write your code on a line-by-line basis.
This talk will provide an introduction into code quality. We will look at various aspects around this term first. From there we can investigate different ways how you can perform code analysis. This will help you measure and understand code quality. There is a range of categories of tools available, some of which also support CFML.
In the second part of the talk we'll look at the details and usage of CFLint. CFLint is a static code analyser for CFML that is based on the CFParser project.
Mentioned in this episode:
Bad code smell
CFML Complexity Metric Tool
Intellij CF lint plugin
Adobe CF Builder
Agile eXtreme programming – peer programming
Upsource from Jetbrains
McCabe index – Cyclomatic complexity
Antlr parser generator
CFLint code of conduct
DroidCon UK conference
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.
Kai Koenig Bio
Kai Koenig works as a Software Solutions Architect for Ventego Creative in Wellington, New Zealand. He co-founded the company with two partners and also the CTO of Zen Ex Machina, a startup in the fields of digital & user experience consultancy based out of Canberra in Australia.
Other stuff he occasionally does: Write for magazines (currently mainly Heise's iX) or in my Blog, publish a podcast (2 Developers Down Under) with my friend Mark Mandel from Melbourne and since 2007 he flies small, single-engine airplanes around New Zealand and sometimes Australia, currently working on his Commercial Pilot License.
Michael: Welcome back to the show. I'm here with Kai Koenig, and he’s joining us from New Zealand where it's just after 6:00 a.m. which is very dedicated of him to the ColdFusion community. And we're going to be talking about some tools for improving your ColdFusion code quality, and we'll look at why this code quality matter, and what it means in practice. And we'll look at some different things you can do to measure your code quality without running the code.
And also, we’ll examine why there are more tools in other languages than CFML in this field, and what Kai is doing to remedy this with the C.F. Lindt project and we’ll dig into that in a bit more detail. And if you haven't met Kai, he's been in the ColdFusion community for nearly 20 years now. I think I met him out a C.F. Europe event many years ago. And he works for [inaudible] [00:53] in Wellington, New Zealand. And he doesn't whole a bunch of things from ColdFusion, to Flex, to Java, all kinds of stuff; maybe we'll talk about that a bit later. So welcome Kai.
Kai: Welcome Michael, thanks for having me, good morning.
Michael: Yes, good… well evening for me, but morning for you. So, let's just start off because people may not have thought about this at all. Why does code quality matter?