BPP assignment
BPP assignment
Code documentation is the process through which software programmers document their
code. It is a combination of clear pictures and textual explanations that describe what a
codebase does and how it may be used. It enhances code readability, reproducibility, and
usability.
Technical documentation is essential for all parties involved in the SDLC, including software
developers and stakeholders. Effective communication with both technical and non-technical
audiences is crucial for the process's success. This enhanced communication enhances
employability and enhances technical communication abilities.
Documented code is often used more than undocumented open-source projects, as it provides
more information and makes it easier for users to contribute. Choosing a less powerful library
with well-documented code is preferable, as developers aim to make important decisions in
clear language for easy access.
How Do You Write a Documented Code?
Develop clean code before writing documentation to avoid ambiguous, improperly
formatted code. Create a logical folder structure, adhere to naming standards, remove
repetitive code, and format code according to consistent standards throughout the
project.
Select appropriate tools for creating searchable, user-friendly HTML documentation
and manual code documentation for open-source software. Sphinx is a Python
package, Pkgdown for R projects, and free HTML-favoured tools like latex, pandoc,
and markdown.
Document code step-by-step as it's written to save time and produce accurate,
thorough documentation. Use proper versioning to track changes and ensure
consistent documentation.
Add Comments - Comments in source code files provide background information,
justification for coding styles, and explanations of algorithms. Use active voice,
present tense, imperative mood, and concise language for improved readability.
Add Docstrings-Docstrings are multi-line descriptions at the beginning of function
definitions, documenting functional units in code. They maintain a connection
between documentation and components, with two types: functional docstrings, which
include function details, parameters, results, errors, and exceptions, and structural
docstrings, explanatory comments in standalone modules.
Q.2 What is Software Architecture? How to design software architecture in five steps.
3. Divide your architecture into slices: Agile architecture design focuses on vertical slices,
allowing your team to quickly deliver value to users and plan development resources. By
diagramming the layers involved in your software architecture project, you can visualize the
entire piece and how each layer influences other layers.
4. Prototype: Prototyping is crucial for validating work and checking assumptions. It allows
for early failures, providing quick feedback, and discovering proof-of-concept. It is essential
to document design decisions and changes, maintain a careful revision history, have a single
source of truth, and use diagrams to manage prototype changes and visualize differences
between versions.
As per the design pattern reference book Design Patterns - Elements of Reusable Object-
Oriented Software, there are 23 design patterns that can be classified in following
categories:
1. Creational Patterns: These design patterns provide a way to create objects while
hiding the creation logic, rather than instantiating objects directly using a new
operator. This gives the program more flexibility in deciding which objects must be
created for a given use case.
2. Structural Patterns: These design patterns concern class and object composition. The
concept of inheritance is used to compose interfaces and define ways to compose
objects to obtain new functionalities.
3. Behavioral Patterns: These design patterns are specifically concerned with
communication between objects.
4. J2EE Patterns: These design patterns are specifically concerned with the presentation
tier. These patterns are identified by Sun Java Center.
The three types of defensive operations are mobile defense, area defense, and retrograde.
Mobile defense involves engaging the enemy rapidly, disrupting their momentum, and
preventing their objectives. Area defense focuses on establishing defensive positions in key
terrain areas, using obstacles, strong points, and overlapping fields of fire to hold ground and
deny enemy access. Retrograde defense involves withdrawing from a current position to a
new defensive line or area, disengaging from direct contact while preventing enemy advance.
These strategies are part of broader military tactics and planning, involving forces, terrain
analysis, and situational awareness.
b) Code design: Code design in programming involves the steps a programmer takes before
starting a program in a specific language. When properly documented, these steps make the
completed program easier for other programmers to maintain in the future. Coding standards
improve code quality, increase efficiency, facilitate collaboration, ensure compatibility, and
reduce maintenance costs. To follow industry-specific coding standards, developers should
focus on code readability, standardize headers for different modules, avoid using single
identifiers for multiple purposes, turn daily backups into an instinct, leave comments and
prioritize documentation, formalize exception handling, and choose between Closed vs. Open
coding standards.