0% found this document useful (1 vote)
661 views

p5 Programming HND

The coding standard used in the project includes proper indentation, commenting code, and variable naming conventions. Indentation is used to define the program structure and increase readability. There are three types of comments - single line, multi-line, and XML documentation comments. Variables use camelCase naming. Namespaces and classes use PascalCase. The coding standard aims to enhance efficiency, reduce complexity, improve maintenance, and properly document the code.

Uploaded by

John Sherchan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
661 views

p5 Programming HND

The coding standard used in the project includes proper indentation, commenting code, and variable naming conventions. Indentation is used to define the program structure and increase readability. There are three types of comments - single line, multi-line, and XML documentation comments. Variables use camelCase naming. Namespaces and classes use PascalCase. The coding standard aims to enhance efficiency, reduce complexity, improve maintenance, and properly document the code.

Uploaded by

John Sherchan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Outline the coding standard you have used in your code.

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.

Coding standards that We’ve used in this project


Coding Standards used in our project.
Indentation
Coding is not just solving the problem; it’s an art. Basically, Indentation is the gap at the
beginning of the text, it defines the structure of the program in more details, increase the readability
of code to a great extent and saves huge amount of time if we revisit the code after a week, month,
year we can understand the written code in some extent. Often the new programmers declined to
follow it during programming. Rather then putting spaces, tab can be use for the proper indent in
the code, most preferred tab size is 4;

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.

Fig: Commenting Code example


There are 3 types of comment in C# Single Line, Multiline and xml Documentation
Comments.
1. Single Line Comments
This is for commenting single line, double black slash is used to comment single line on
the code ‘//’ as shown in image.

Fig: Single Line Comments


2. Multi line Comments
Sometime we need to comment multiple line in the source code, it begins with /* and ends
with */. Below is the portrait of multi-line comments.

Fig: Multi line comments


3. XML Documents comments

Fig: XML Documents comment

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.

Fig: Camel Case

Pascal Case
This is the naming style in which first letter of every word is in Upper case.

Fig: Pascal Case

Naming convention for Namespace and Classes


For the Namespace and Classes, we’ve used Pascal 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

You might also like