Getting on the Same Page

09 Feb 2023

Anthropology has shown that when cultures can communicate and exchange ideas, it leads to the flow of knowledge and innovation. This point has been demonstrated throughout history, from the use of Latin in the Western world during the medieval period to the decipherment of Egyptian hieroglyphics with the discovery of the Rosetta Stone. Similarly, adopting a coding standard can promote the flow of knowledge and innovation within an organization. By establishing a uniform set of conventions and guidelines for writing code, developers can integrate and build upon each other’s work more efficiently, leading to the developing of new and innovative solutions.

In any collaborative environment, standard operating procedures (SOPs) allow the team to focus more on the work rather than on adjusting to each other’s style. Everyone working from a uniform foundation reduces the guesswork and mental overhead of continually interpreting the irregularities between multiple contributors’ work.

The notion of standardization being necessary is something I agree with. Much of the interoperability and efficiency I found throughout my experience in the US Army was due to a focused emphasis on adhering to “the standard”. Because everyone was operating on the same foundational set of SOPs, it was feasible to take, for example, a machine gunner from one unit, and they would be just as effective in another without the need for a significant amount of retraining. Likewise, standardization plays a massive role in how professional organizations effectively work as a team.

Ultimately there needs to be some protocol to ensure that the overall quality of deliverables is cohesive, consistent, readable, and maintainable. Developing a complex system with many moving parts, where an entire team of software developers is contributing code to that project, would be a nightmare without some ground rules. Coding standards lay out the structure and style of code and exist to improve the readability and maintainability of code written by many developers contributing to the same project’s codebase. Adhering to an agreed-upon standard makes the project’s code predictable and even more robust.

When everyone is on the same page, there’s less ambiguity about what “right” looks like. This uniformity makes finding and fixing bugs easier, particularly when looking at someone else’s code, because there is less style variation; you know what to expect. Added to this are the benefits of preventing bugs and vulnerabilities before they even arise by adhering to a given standard’s best practices. Additionally, having a standardized approach to coding also improves the scalability of a team. When new members are onboarded, they can quickly learn coding practices that are already established and start contributing to the project with minimal ramp-up time.

Moreover, coding standards also ensure that code is written consistently and predictably, which enhances the readability of code, making it easier for developers to understand and modify code written by others. As a result, this not only reduces the amount of time and effort required to understand and maintain existing code but also increases the accuracy and reliability of the code. Finally, maintainability and longevity depend intensely upon coding standards. Modifying and extending code as requirements change over time is much easier when it has a clear and consistent structure. Because of this, code written to a standard is easier to adapt and more likely to prove useful for an extended time.

However, despite the numerous obvious benefits that coding standards can bring to a software development team, there are also several drawbacks. One of the main drawbacks is that conforming to a given coding standard may limit creativity and innovation. In addition, developers may feel constrained by the rules and guidelines of the standard, preventing them from exploring alternative solutions that could be more efficient or effective.

Additionally, adhering to a coding standard may require additional time and effort, slowing the development process and increasing project costs. I’m used to clang-format, which can be as simple as saving the document and having the format-on-save feature sort everything out for you. With ESLint, formatting requires going item by item and triggering each correction manually.

Furthermore, coding standards are sometimes unclear. Some rules may not even be applicable in some instances or may be ambiguous or confusing. This can be a cause of frustration when implementing a to-standard final product. Poorly defined standards can lead to codebase inconsistencies, making it more of a challenge to maintain and update the software.

Finally, enforcing a coding standard presents an overhead to operational costs through training and oversight, which may be hard to provide in some organizations, especially those with limited resources. As such, this can make it challenging for organizations to effectively implement and enforce a coding standard, resulting in a lack of compliance and a codebase that doesn’t meet the desired criteria.

Insisting that a piece of code be entirely free of lint errors is perhaps excessively fastidious when those errors consist of minor format variations. While I fully embrace the concept of adopting universal norms that promote greater compatibility, reliability, and integration of code, enforcing overly bearing standards stifles creativity. It diverts energy away from producing good code towards ensuring each open parenthesis is preceded by exactly-and-not-to-exceed-one-space. If such attention to detail is truly necessary, then the formatting tool should do this automatically. All praise be to format-on-save!

In short, coding standards are crucial for a successful software development project. They help create a consistent structure and style, thus making it easier to read, maintain, and scale a project’s codebase. Consequently, this leads to better efficiency, collaboration, and innovation among team members. However, there are some drawbacks, such as potentially limiting creativity and the extra time and effort spent to adhere to such standards. Even still, the benefits of having a clear and organized codebase make using coding standards a must for any development team. By following these standards, organizations can have a more productive and efficient development process.