p5 Programming HND
p5 Programming HND
Coding standards define the set of rules to be followed while coding to format the source
code, it’s more likely a programming style. However, developer can code in their own preferred
style without following the proper coding standards documents, coding standards don’t consider
the code is wrong or right it’s just a style to which developers adhere while coding. There are lots
of benefits of coding standards and some are:
Advantages
1. It enhances the efficiency, if the source code is in a proper format then it wouldn’t take
long time to find and solve the problems, it even prevents the issue that comes while coding.
2. Coding complexity increases while the size of the code increases, and we can face lots of
errors, so the proper coding standards applied on the project might help the program less
complex by increasing readability and lessen or diminish the errors in the program.
3. It improves the communication between development team and the maintenance team,
most of the time software cost more in maintenance rather than in development because
original developer of the software doesn’t tend to maintain the software; it happens rarely,
most of the time maintenance team or an individual skilled person need to be hired, so
properly followed code standards might reduce the cost maintenance.
4. Software being critical part of the any organization, need to be well engineered; and need
to be documented with a best practice. Thus, the coding standards play prominent role in
this part.
Fig: Indentation
Commenting Code
Commenting on the code is done to describe what the code or block of code is doing on
our program. Compiler doesn’t compile the comment, it just describes the code and if we visit our
code after the long gap, we can understand why and for what purpose we’ve put that code on the
program. It also helps the maintenance team to understand the code.
Variable Declaration
Variable declaration declares the name of the variable and define which data to be hold. In
our case we’ve use camelCase for the variables.
Fig: Variable
Camel Case
In this naming style in which the first letter of the word is in a lower case and first letter of
every other word followed by the first word is in Upper case.
Pascal Case
This is the naming style in which first letter of every word is in Upper case.
Fig: Namespace
Fig: Class
Design of pattern
We’ve coded this project in the Visual Studio 2017 on C# dotnet framework, before coding
we’ve researched and distinct different coding standards and finally, we came to use C# coding
standards with a small modification. Below is the design of the pattern in a tabular form that we’ve
used in our project.
Fig: Naming Convention pattern