The Compact Guide to Web Maintainability: 200 Tips and Resources
Published on January 24, 2018 (⻠February 5, 2024), filed under Development (RSS feed for all categories).
Half a year ago I was happy to work with A List Apart to ask our field a few questions about maintainability: What helps website maintenance? What prevents it? And what resources do developers turn to for improving maintainability?
The goal was to get a much more in-depth and a much more practical view than what we had before, which was little more than a few theses put up about a decade earlier. The result was a list of 134 responses with more than 500 data points that have now all been reviewed, normalized, rephrased, sorted, and tested, to form a new guide, a new and more definite guide to web maintainability.
To elaborate on each point would have meant a whole book on the topic; and while I like the idea of indeed making it another one (or see someone else write one), Iâve opted to first present it in a form thatâs easier to scan and digest. Categorization was not always trivial, and some redundancy may exist, too, but with your and the fieldâs helpâcomment here or send a messageâwe can improve and build on this so to accomplish an actual base to work on when it comes to: maintenance, and maintainability.
Figure: Maintaining a kingdom, not nearly as politically correct as we maintain code bases. (Copyright King Features Syndicate, Inc., distr. Bulls.)
The following uses the words âmaintenanceâ and âmaintainabilityâ quite liberally. As one may suspect, âmaintenanceâ refers to the act of maintaining, âmaintainabilityâ to the ease (or even possibility) of a code base to be maintained. Also, then: Exceptions prove the rule. Sometimes it depends, and personally I donât agree with each and every single statement in here, either. And, finally: This post contains more than 200 statements and resources, and yet not enough.
Contents
The 9 Pillars of Maintainability
There are roughly nine parts to maintenance and maintainability.
For the markup connaisseur, all aspects are laid out in sentence and paragraph form to add weight to them. Like other posts on this site, this post will also be updated, and perhaps amended by examples, in order to keep it relevant for time to come.
Be Clear About Maintenance
Understand the value of maintainability and maintenance.
See the big picture (and avoid getting caught up in details).
Avoid unnecessary changes. âChange is inevitable, yet there is change that is avoidable.â (This we know for many years.)
Take or define ownership. Avoid interference by outsiders.
Set aside a budget for maintenance.
Make sure to build and hire maintenance competence and expertise.
Define processes and procedures.
Offer motivation and incentives to maintain.
Make maintenance a priority.
Avoid âbig bangâ maintenance, when everything has to be updated at the same time.
Set clear maintenance goals and direction.
Beware of slowness (âchanging direction [âŠ] takes nearly forever to saturate, resulting in many layers of partial changesâaka lava flowâ).
Assign and delegate maintenance responsibilities. Avoid unclear responsibilities. Avoid âtoo many cooks in the kitchen.â Reassign unengaged content owners.
Rotate the team (over the code base).
Set reminders (for updates and maintenance).
Donât procrastinate.
Refactor when possible.
Be smartâbut not too smart.
If necessary, enforce maintenance.
Plan
Understand organization and project. Internalize mission and purpose. Comprehend needs and necessities.
Know all the priorities.
Focus. Avoid scope and feature creep.
Beware of expectations of the wrong peopleâfor example, HTML skills from users or CMS editors.
Structure the work; avoid chaos and disorganisation.
Define site concepts and goals.
Look for a balance.
Consider each projectâs lifespan. Think about the future: âHow can I write this in a way that a developer five years from now will understand it?â
Set up care and maintenance plans.
Allow for enough time for maintenance.
Work off technical debt.
Talk about maintainability of features specifically, upfront.
Prepare for complexity.
Prepare for aging issues (âthe more mature a project becomes the bigger the problems caused by poor [or] no longer fit for purpose decisionsâ).
Do It Yourself
Avoid outsourcing (â[âŠ] and expecting the internal team to just âfigure outâ how to keep the collection of scope creep and cutting-corners [âŠ] from catching fire and burning to the groundâ).
Write code from scratch where possibleâor tailor.
Avoid (âif something is able to be coded, code itâ) or make minimal use of plugins and third-party âboilerplates.â
Limit use of third-party tools (to avoid support and security issues).
Avoid customization of third-party tools.
But: Donât improvise; avoid temporary fixes to turn permanent.
Keep It Simple
Use only whatâs absolutely necessary.
Prefer simplicity over flexibility. (Use your own judgment.)
Avoid overzealous, âpixel-perfectâ design (and too much CSS in consequence).
Be clear and consistent.
Avoid content and code excesses.
Avoid repetition.
Beware of exceptions and special cases (for example, CMS inputs for custom markup). But: Avoid early consolidation and abstraction (only âuntil you have at least three or four usages,â because âa bad abstraction is much harder to maintain than no abstractionâ).
Write human-readable code, then use a build step to optimize it.
Adhere to Standards and Best Practices
Work disciplined. Donât be sloppy.
Donât become too pragmatic. Donât always take the easy way. Avoid âcopy and pasteâ coding. Avoid âupdates through appending.â Avoid short-term fixes.
Be consistent.
Keep dependencies to a minimum, and particularly avoid complex and hidden dependencies. Avoid high code coupling.
Use (and break websites up into) reusable components and modules.
Structure the code. Keep all structure descriptive: Use useful nomenclatures and naming, link only one style sheet and script file, use functional or generic style sheet and script names. In HTML, keep nesting reasonable; do not specify media types in the markup.
Keep logic as clean as possible (for example, avoid nested if
s).
Separate concerns (especially CSS in JavaScript). Donât use inline CSS or JavaScript.
In CSS, be aware of the implications of broad selectors.
Use normalized databases (âusing databases where you can easily insert/update data instead of changing code means you wonât have to change code laterâ).
Use uni-directional data-flow (instead of mutating global state).
Be aware of âinvisibleâ conventions and standards (for example, with WCAG).
Use coding conventions (style guide) and coding standards (code consistency). Use consistent indentation and nesting.
Use naming conventions.
In JavaScript, beware of long functions, use short ones (with few parameters).
In CSS, know when to use !important
.
Be careful about global event listeners and global selectors.
Follow professional standards and practices. Apply the Single Responsibility Principle. Use Test-Driven Development (TDD). Use Object-Oriented Programming (OOP). Apply PHP Standards Recommendations (PSR). Use namespaces. Use immediately-invoked function expressions (IIFE).
Donât Repeat Yourself (DRY).
Write semantic HTML.
Lint CSS and JavaScript.
Use principles across projects (âso itâs easy to switch between themâ).
Run backups.
Maintain inventory.
Use the boyscout rule (Ă la âleave things better than you found them,â and âalways check a module in cleaner than when you checked it out,â per Robert C. Martin).
Avoid mystery code (âcoders who purposely make it hard to read their work, perhaps thinking they will make themselves indispensableâ).
Use Processes
Communicate, especially during the design phase (âthe single biggest detriment to maintainability [âŠ] is winning the argument that tech debt &c. is as important as feature developmentâ).
Make use of Continuous Integration (CI).
Establish and enforce principles and standards (like, âbe diligent in what you add and generous in what you take offâ).
Establish routines.
Code in tandem.
Organize code as if it was under public review and scrutiny (like an open source project).
Use Agile methodology.
Test (for regressions), but avoid unreasonable testing needs. Include critical devices.
Set up and follow maintenance and update routines.
Automate.
Know and Use Your Tools
Use quality tools.
Use off-the-shelf technology (for easier ramp-up and easier help). But, use only well-supported third-party software; avoid exotic, esoteric, undocumented tools and methods; avoid overreliance on third-party tools; avoid new technology for the sake of new technology.
Use a version/source control system.
Use a content management system (CMS).
Use a JavaScript framework (to stay focused and avoid anti-patterns). But, use reusable libraries that are easily extensible.
Use a component-based system. Pair scripts to style sheets 1:1.
Use a preprocessor (like Sass or LESS).
Use a package manager (which can list outdated packages) and package management tools.
Use build tools (to automate).
Use a dependency manager.
Use a pattern library with a grid and type system for code and design patterns.
Use templates.
Avoid dependence on systems that offer no staging or QA environment.
Understand the tools. Be conscious about tool changes (âthe best tool is often the one in your handâ).
Understand the system architecture.
Disable (unneeded) features.
Update, regularly.
Sunset unused and unmaintained third-party tools.
Sometimes, donât use tools.
Document
Talk about what is done and why.
Document, detailed and understandable, in-line and in-file. Document architecture; work and prior work; updates and versions; decisions; standard operating procedures.
Comment the code (âleave little notes for âyourself [and your peers] in the futureââ).
Refer to official documentation.
Review
Focus on quality.
Maintain proper code hygiene.
Review all code.
Log.
Monitor. Monitor the code base, especially unused code (code rot). Monitor performance. Monitor tools, and avoid tools that arenât needed. Monitor everything.
Audit regularly. Run quality checks. Take samples, to check for quality issues. Check for broken links. Audit everything.
Resources
Particular resources mentioned in the original maintainability survey.
Articles &c.
- A Product Managerâs Guide to Technical Debt
- C# Coding Conventions (C# Programming Guide)
- [Canada] Government Communications
- Digital Ocean API
- How to Manage a Live WordPress Website Like a Pro
- Meteor API
- PHP Standards Recommendations
- Style Guide Guide
- TechnicalDebtQuadrant
- WPMU DEV
Magazines &c.
- A List Apart
- CSS-Tricks
- DigitalGov
- Every Page Is Page One
- Frontend Focus
- heise online
- The Interconnected
- IT Hare
- Lynda.com
- php[architect]
- PHPDeveloper
- Scotch
- ShopTalk
- Smashing Magazine
- Stack Overflow
- tuts+
- Web Designer News
- Wordfence
- Working Draft
People
- (Colleagues)
- (Mentors)
- John Allsopp
- Paul Boag
- Wes Bos
- Chris Coyier
- Anna Debenham
- Martin Fowler
- Jeremy Keith
- Ethan Marcotte
- Robert C. Martin
- Tom McFarlin
- Jens Oliver Meiert
- Eric A. Meyer
- Harry Roberts
- Matt Stauffer
- David Walsh
Companies and Organizations
- Amazon
- DNN Software
- GOV.UK Blogs
- Mozilla
- Nielsen Norman Group
- Pattern Lab
- World Wide Web Consortium
Books
- (A Book Apart)
- (OâReilly)
- (SitePoint)
- The Checklist Manifesto (Atul Gawande)
- Content Strategy for the Web (Kristina Halvorson and Melissa Rach)
- Enduring CSS (Ben Frain)
- Frontend Architecture for Design Systems (Micah Godbolt)
- How to Make Sense of Any Mess (Abby Covert)
- Maintainable JavaScript (Nicolas Zakas)
- Managing Chaos (Lisa Welchman)
- Scalable and Modular Architecture for CSS (Jonathan Snook)
Events
- (An Event Apart)
- (Meetups, in general)
- (Talks, in general)
Many thanks to the people contributing to the survey.
About Me
Iâm Jens (long: Jens Oliver Meiert), and Iâm a web developer, manager, and author. Iâve worked as a technical lead and engineering manager for small and large enterprises, Iâm a contributor to several web standards, and I write and review books for OâReilly and Frontend Dogma.
I love trying things, not only in web development and engineering management, but also in other areas like philosophy. Here on meiert.com I share some of my experiences and views. (I value you being critical, interpreting charitably, and giving feedback.)
Read More
Maybe of interest to you, too:
- Next: On Loyalty
- Previous: Oh WTF My Tone, or: On Germans Speaking English
- More under Development
- More from 2018
- Most popular posts
Looking for a way to comment? Comments have been disabled, unfortunately.
Get a good look at web development? Try WebGlossary.infoâand The Web Development Glossary 3K. With explanations and definitions for thousands of terms of web development, web design, and related fields, building on Wikipedia as well as MDN Web Docs. Available at Apple Books, Kobo, Google Play Books, and Leanpub.