For context, I work primarily in the world of high-assurance embedded software. Over the years, this has included applications such as safety-critical aircraft navigation systems, life-saving medical devices, toxic gas monitoring systems, and high-risk industrial control systems; among others. The common link here is quality. Without a focus on software quality, attributes like safety, security, and reliability don't stand a chance. Most of the day-to-day software development advice I see is geared toward folks who write websites, business software, and mobile devices; where failure is comparatively inconsequential.

For a long time, I have advocated that higher quality software can be cheaper to produce than that of average quality. I'm talking here about tools and techniques that make the developer more productive while making the code better. Quality measures are often very subjective, but there are some universal hallmarks: clear internal documentation that adds value; meaningful names; easily readable style and structure; and low defect counts are four that come to mind. Those are attributes that every coder should be striving for.

The "FREE" mentioned in the title, isn't referring to tool cost, though there are inexpensive and free tools. I'm talking about the overall cost to the software development organization. These techniques will significantly reduce some aspects of the software development effort. While some may initially have a small additional effort up-front, they will still contribute to a reduced overall effort.

Several of the items take advantage of features of a high-quality programmers' editor. The popular (free) choices are very weak, and therefore costly in terms of productivity. I still primarily use Multi-Edit, which has been out of production since 2008, but still handles most of my needs. There are at least a few editors around that support most of these features, either natively or with plug-ins.

The code editor is the most important tool that most developers use. We spend the vast majority of our days interacting with it. The difference between a true code editor and an advanced text editor is mainly whether it also integrates with our other development tools. It is a short step between code editor and integrated development environment (IDE), so short that I generally use the terms interchangeably. For example, Visual Studio is a true IDE, in that it really can't be separated from the compilers and languages that it supports; Visual Studio Code is more of a code editor because while it has much of the look-and-feel of VS, it is designed for use with externally accessible tools.


#1 - Enhanced Syntax Highlighting

My code editor should provide at least 4 classes of keywords plus several symbols with combinations of background color, foreground color, bold, and italic properties. Having multiple definable comment types also allows you to differentiate ordinary comments, from special comments such as doc comments, doxygen comments, and comment-embedded directives for your favorite linter. I generally have a category for imperative (control-flow) keywords, one for declarative keywords, one for modifiers and qualifiers, and one for illegal keywords. This last one is a gem. I used to find myself making simple mistakes, like forgetting the hash (#) before preprocessor directives; or using extensions or keywords that aren't supported by the compiler in the current project. Those are mistakes that can be eliminated quickly with the addition to this last category. Another feature that I consider vital is the ability to have a different syntax highlighting profile for assigned printing hard copies. This is helpful since I generally edit with a gray background that I'd rather not have printed, and several of my other on-screen color/font choices are bad choices for paper. I also maintain separate profiles for editing and reviewing. For review, I de-emphasize some elements, while highlighting others. Syntax highlighting at this level probably gave me my first big productivity boost as a young developer. Quality is enhanced because many basic errors become apparent before you've finished editing the line.

#2 - Code Formatting

Also called pretty-printers, code formatters are great, and especially useful when they are integrated into your editor. With this, you can make sure that all of your code comes out looking excellent. They can do tab-to-space, or space-to-tab substitution, remove trailing white-space, and get your code to meet your team's style standards with a few key presses. I particularly like this feature when reviewing complex code from another developer. I can format his or her code to make it easier to understand, however, it is important to maintain the original for comment, since the formatting may cause lines to be broken or merged. Some modern IDEs also do on-the-fly styling, but beware that these smart systems often don't have a lot of configuration options, and they may also not work well during changes to existing code. A stand-alone formatter tuned to the organization's preferences can also be integrated into the commit process to ensure that all committed code is in a uniform style.

#3 - Code Completion

Microsoft re-branded their version of Code Completion as IntelliSense, but even my ancient editor from the early 90's supported the expansion of a symbol name that had been used elsewhere. The productivity element here is obvious, as it saves typing. The quality piece here is that it prevents misspellings of a variable or function name, and because it saves typing, it reduces the inclination to over-shorten names, resulting in more readable code.

#4 - Code Navigation/Replacement Markers

My editor uses the grave accent as a navigation marker. When you use it like quotation marks around a word or phrase, you can navigate to the next or previous one with a hotkey combination, and it becomes selected text, which will be replaced by whatever you type. I often use it like a bookmark, to mark a place in code that I know needs more work. This one is more helpful for productivity than quality, but when combined with Code Templates, it becomes very powerful, and that's where the quality benefit comes in.

#5 - Code Templates

Visual Studio calls their version of templates "snippets", but whatever you call them, these might be one of the biggest productivity aids there is. Code templates can be expanded via a hotkey combination, or even by a keyword that is typed. For example, you might define one such that you type "for" and when you hit the space bar, the keyword is replaced by an entire for-loop structure; or "fn" for a full function skeleton with a header doc-comment ready to populate. The templates can use Code Navigation Markers to guide and prompt you as you fill in the skeleton. In the case of my editor's template implementation, I have templates that generate dates and GUIDs, call macros, and even expand other templates. When I create a new code file, my templates create a 20+ line header comment with all the legalese that my client requires, copyright statement, and creation date, even faster than cut-n-paste and without the need for tailoring. All I have to add is the purpose of the file. Best of all, once you get your templates right, the code that they produce is always formatted flawlessly. This will eliminate the need for Code Formatting most of the time.

I would estimate that my actual typing has been reduced by as much as 75% by using Code Templates, Code Completion, and Navigation Markers. The quality benefit is obvious; more automatic code means fewer opportunities for injecting errors. I get much higher quality output, with much less effort.

[Managers: If you think that a $300 editor is too expensive to purchase for each of your developers, I promise you that once they are proficient, it will pay for itself (probably more than once) every week -- so this really is better than FREE.]

Make sure that your development team has access to an excellent code editor that supports most or all of these features, and is using it to its fullest advantage. This may require some lunch-n-learns for knowledge sharing.

[Developers: If your organization's management is wise enough to provide you with a powerful code editor (or if you've purchased one on your own) make the effort to become an expert user. It can make a huge difference, not just in your productivity and code quality, but in making the coding task easier.]


This article was initially entitled "10 Ways to Boost Software Quality for FREE". Sadly, I am too long-winded for that title to be practical. If, through sheer determination, you've made it to the end of this article, then I encourage you to take a coffee break and move on to part 2 of my list at "5 More Ways to Boost Software Quality for FREE". In part 2, I will venture beyond the editor features to some powerful advanced techniques that can boost team productivity while enhancing quality. Finally in part 3, "Boost your Software Quality for FREE? Does it work?", I will share my experience with these techniques, and attempt to quantify the benefits.

Postscript: In trying to find examples of feature-rich code editors for this article, I came across UltraEdit (UE). I am now in the process of evaluating it. Code Template functionality is much weaker than I'm used to, so I may need to adapt there, but otherwise UE appears to have the power and features that will make it a worthy successor to the editor that has been the central tool in my kit for more than 2 decades. I don't know enough to recommend UE yet, but I can suggest that you take a look at the product's YouTube channel to see if it might be a fit for you or your organization.