Documentation and Code Maintenance
Documentation and Code Maintenance
By the end of this module, you'll be well-versed in creating maintainable code and
understanding its documentation.
Student Expectations
During this module, you are expected to spend time working through the prescribed
material prior to attending class. This will enable a more valuable discussion to take
place in online tutorials or conferences, where you will be able to discuss concepts,
present ideas and explore information collaboratively in greater depth.
4 hours for facilitated study. This includes guided facilitated study, watching or
attending course lectures (live or pre-recorded), and responding to facilitator
feedback.
8 hours for personal study. This includes reading through course material,
undertaking learning activities and exploring additional related resources.
Learner Guide
The Learner Guide provides the core knowledge for this topic. Work through the
materials and be prepared to discuss these in your forums, tutorials or classes.
Expand All
Panels
Collapse All
Panels
Further Reading
Reference: Geeks for Geeks, n.d., 'Coding Standards and Guidelines', Geeks for Geeks, accessed 31
January 2024, <https://www.geeksforgeeks.org/coding-standards-and-guidelines/>
● Drafting Guidelines
As a starting point, consider drafting a set of guidelines that align with the
organisational goals and foster a harmonious working environment.
● Implementing Coding Standards
Once familiar with the coding standards, focus on implementing these
diligently in your projects to witness the transformation it can bring in terms
of readability and maintainability.
Scenario
You are a team member in this dynamic environment. The leadership decides that
it's time to bring a change to uplift the code quality and team collaboration. The
objective is clear: To create a well-structured, maintainable, and uniformly styled
codebase that would streamline the workflow and enhance productivity.
Steps Taken
● Setting Up a Committee
A committee comprising senior developers and project managers was set
up to draft the organisational guidelines and coding standards. They were
tasked with researching and proposing a set of rules that would be both
modern and easy to adopt.
● Drafting the Guidelines
The committee worked diligently to draft comprehensive guidelines that
encompassed best practices in coding, including naming conventions, file
organisation, and commenting. These guidelines were built keeping in
mind the existing challenges and potential growth of the firm.
● Training Sessions
Once the guidelines were drafted, a series of training sessions were
organised. These sessions were interactive, providing team members with
the opportunity to understand the new standards and how to implement
them in their daily workflow.
● Implementation
After the training sessions, the team began to implement the new
standards. A grace period was provided to allow team members to adapt
to the new norms. Peer reviews were encouraged to foster a collaborative
learning environment.
● Feedback and Adjustments
Over time, feedback was collected from the team members about the new
guidelines. Necessary adjustments were made to ensure that the
standards were both efficient and user-friendly.
Outcome
Conclusion
Instructions:
1. Study provided materials or search for articles, papers, and case studies
emphasising the importance of documentation in software development.
2. Prepare a list of key takeaways and reasons why documentation is crucial.
3. In a group setting, discuss your findings and relate them to your own
experiences or projects you're familiar with.
4. Write a summary of the discussion, highlighting the main points and
conclusions reached.
The Learner Guide provides the core knowledge for this topic. Work through the
materials and be prepared to discuss these in your forums, tutorials or classes.
Expand All
Panels
Collapse All
Panels
Here, we delve deeper into the methodologies and strategies to craft insightful and
useful documentation.
● Comments
Incorporate various forms of comments within your code to convey the
function and purpose of different code sections.
● Descriptive Naming
Choose appropriate and descriptive names for variables, functions, and
classes.
● Maintaining a README File
Maintain a comprehensive README file that encompasses a project
overview, setup instructions, and guidelines.
● API Documentation
Document the API usage thoroughly, offering endpoint descriptions and
examples.
● Change Logs and Version Control
Employ version control systems like Git to track alterations and manage
different versions of the project.
● Including Code Examples
Provide insights through code examples in the form of tutorials or code
snippets.
● Error Handling and Reporting
Develop a robust system for error handling and reporting, incorporating
descriptive error messages and maintaining error logs.
Background
In the heart of a rapidly expanding tech start-up, a group of ambitious developers
embarked on a mission to create a pioneering web application aimed at
revolutionising e-commerce operations. The initial phases of the project were
marked by enthusiasm and rapid development. However, as the team expanded and
the project became more complex, it became apparent that the codebase lacked
sufficient documentation. This gap in internal documentation began causing delays
and confusion, particularly for new members who found it challenging to navigate
and comprehend the project's intricacies.
Scenario
You, having a substantial experience and understanding of the project, are appointed
to lead an initiative to bolster the internal documentation. This task is not only vital to
streamline the ongoing development process but also seen as a strategic move to
set the stage for the project's future scalability and sustainability. The primary
objective is to transform the codebase into a well-documented repository that can
facilitate smoother collaboration and expedite the project’s progression.
Action Plan
To navigate this challenge, you proposed a comprehensive action plan that involved
several strategic steps:
Outcome
1. Streamlined Collaboration
Team members found it easier to collaborate, with clear documentation
reducing misunderstandings and facilitating more productive discussions.
2. Accelerated Debugging Processes
The introduction of systematic error handling and reporting strategies made it
easier to identify and resolve issues swiftly, reducing the time spent on
debugging.
3. Enhanced Onboarding Experience
New members could onboard more seamlessly, with the enhanced
documentation providing a clear roadmap to navigate the project's
complexities.
Topic 3. Developing and Documenting Maintainable
Code
Learner Guide
The Learner Guide provides the core knowledge for this topic. Work through the
materials and be prepared to discuss these in your forums, tutorials or classes.
Expand All
Panels
Collapse All
Panels
● Code Consistency
○ Coding Conventions
○ Code Linting
● Modular Design
○ Decomposition
○ Encapsulation
● Code Comments and Documentation
○ Inline Comments
○ API Documentation
● Version Control
○ Branching Strategy
○ Change Tracking
● Code Reviews
○ Peer Reviews
○ Automated Code Analysis
Background
In a thriving financial firm, the software team was grappling with growing challenges
emanating from an outdated software system. As the firm expanded and
incorporated new members, the inconsistencies in coding standards and sparse
documentation became evident. This scenario not only hampered the onboarding
process but also decelerated the enhancements needed to meet the business's
evolving needs. Identifying this bottleneck, the leadership decided to strategically
revamp the system to bolster maintainability and scalability.
Initial Challenges
Strategies Implemented
● Coding Standards
The journey commenced with the formulation of comprehensive coding
standards. These norms were meticulously documented and disseminated
throughout the organisation, encouraging a uniform approach to code
development.
● Documentation Overhaul
A dedicated task force undertook the mission to revamp the existing
documentation. This team collaborated closely with veteran members to
develop detailed and contemporary documentation, elucidating the various
system modules clearly and providing guidelines and best practices for
interacting with them.
● Modular Approach
A structural shift to a modular design ensued. Each module was
engineered to handle specific functionalities, fostering easier management
and facilitating potential extensions in the future.
● Version Control and Code Reviews
A robust version control system was instituted to efficiently manage
diverse versions of the code. Regular code reviews became a norm,
aiding in maintaining code quality and fostering knowledge transfer among
team members.
Outcome
Further Resources
The resources in this section are for further exploration, providing additional
information for deeper insights.
Expand All
Panels
Collapse All
Panels
Reading: Coding Standards and Best Practices to Follow
Coding standards are a set of guidelines and best practices that are used to create
consistent, high-quality code. Consider coding standards as rules, techniques, and
best practices to develop cleaner, more readable, and more efficient code with
minimal errors. They offer a uniform format for software engineers to build
sophisticated and highly functional code.
Reference: Shreya Bose (Community Contributor), 2023, 'Coding Standards and Best Practices to
Follow', Browser Stack, accessed 31 January 2024,
<https://www.browserstack.com/guide/coding-standards-best-practices>
Reference: Perforce, n.d., 'Coding Standards For Quality and Compliance', Perforce, accessed 31
January 2024, <https://www.perforce.com/resources/qac/coding-standards>
(19:03)
Reference: ArjanCodes, 2023, 'How to Document Your Code Like a Pro', YouTube, accessed 31
January 2024, <https://youtu.be/L7Ry-Fiij-M>
The Google C++ coding style has become very popular and some highlights are
featured in this article.
Reference: Eric Gregori, 2021, 'Google C++ Style Guide Overview', LinkedIn, accessed 31 January
2024, <https://www.linkedin.com/pulse/google-c-style-guide-summary-eric-gregori/>
The goal of this guide is to manage this complexity by describing in detail the dos
and don'ts of writing C++ code. These rules exist to keep the code base manageable
while still allowing coders to use C++ language features productively.
Google C++ Style Guide
Reference: Google, n.d., 'Google C++ Style Guide', GitHub, accessed 31 January 2024,
<https://google.github.io/styleguide/cppguide.html>