SlideShare a Scribd company logo
SE ALA: Coding standards and
coding guidelines
Dhananjaysinh Jhala,
TY CE-1,
Batch B,
170410107027
INDEX
Introduction
Coding guidelines
Coding standards
Coding guidelines
 Control construct
 Some control constructs are selection statements
meaning that it selects which code to execute.
Other control constructs are loops, where
the control construct determines how many
times the loop will execute. C keywords related
to selection statements include: if , else , switch ,
case , break , default .
 Single entry and single exit constructs need to
be used. Standard control constructs must be
used instead of using wide variety of controls.
There are some commonly used programming
practices that help in avoiding the common errors.
 Use of Gotos
 Use of go to statements in our program makes it unstructured and it also imposes an overhead
on compilation process.
 Hence we should avoid them as much as possible or think of another alternative.
 Information hiding
 It should be supported as far as possible.
 In that case, only access functions and data structures must be made visible and the
information present in them must be hidden.
 Nesting
 Nesting means
defining one
structure inside
another. If nesting
is too deep then it
becomes top hard
to understand the
code. So we should
avoid deep nesting
of the code.
 User defined data types
 Modern programming languages allow the user to use user defined data types. It enhances the
readability of the code.
 Module size
 There is no standard rule about the size of the module but the large module size will not be
favourable always.
 Use of meaningful variable names for specific purpose
 We should avoid using same variable name in temporary loops for multiple purposes. Each variable must
be given some descriptive name so that the program becomes easy to understand.
 Well documentation
 Code must be well documented with the help of comment statements at appropriate places.
Coding standards
 Naming conventions
 Package and variable names must be in lower case
 Variable names mustn’t begin with numbers
 Constants must be in upper case
 Method name must be in lowercase
 Prefix is must be used for boolean type of variables. E.g. isEmpty, isFull…
Any good s/w development approach suggests to
adhere to some well defined standards or rules for
coding.
 Files
 Reader must get an idea about the purpose of the file by its name.
 Line length in file must be limited to 80 characters.
 Commenting/layout
 Comments are non executable part of code. But they also enhance readability of code.
 Comments must not only explain what is written, but also why a certain thing is written.
 Statements
 Declare some related variables on the same line and unrelated ones in another line.
 Class variable should never be declared public.
 Avoid use of break and continue in the loop.
 Avoid the use of do…while statement
 Limited use of globals
 These rules tell about which types of data that can be declared global and the data that can’t
be.
 Indentation
 Proper indentation is very important to increase the readability of the code. For making the
code readable, programmers should use White spaces properly.
 There must be a space after giving a comma between two function arguments.
 Each nested block should be properly indented and spaced.
 Error return values and exception handling conventions
 All functions that encountering an error condition should either return a 0 or 1 for simplifying
the debugging.
Coding standard and coding guideline
Ad

More Related Content

What's hot (20)

C# basics
 C# basics C# basics
C# basics
Dinesh kumar
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programming
programming9
 
C# conventions & good practices
C# conventions & good practicesC# conventions & good practices
C# conventions & good practices
Tan Tran
 
10. switch case
10. switch case10. switch case
10. switch case
Way2itech
 
C# Tutorial
C# Tutorial C# Tutorial
C# Tutorial
Jm Ramos
 
Control statements in java
Control statements in javaControl statements in java
Control statements in java
Madishetty Prathibha
 
Break and continue
Break and continueBreak and continue
Break and continue
Frijo Francis
 
Kotlin
KotlinKotlin
Kotlin
Software Infrastructure
 
Data types
Data typesData types
Data types
myrajendra
 
Common language runtime clr
Common language runtime clrCommon language runtime clr
Common language runtime clr
SanSan149
 
C the basic concepts
C the basic conceptsC the basic concepts
C the basic concepts
Abhinav Vatsa
 
Command line arguments
Command line argumentsCommand line arguments
Command line arguments
Ashok Raj
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constants
vinay arora
 
What is identifier c programming
What is identifier c programmingWhat is identifier c programming
What is identifier c programming
Rumman Ansari
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
ppd1961
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
SIVASHANKARIRAJAN
 
VB Script
VB ScriptVB Script
VB Script
Satish Sukumaran
 
Java string handling
Java string handlingJava string handling
Java string handling
Salman Khan
 
Bitwise operators
Bitwise operatorsBitwise operators
Bitwise operators
Puneet Rajput
 
Operators in java
Operators in javaOperators in java
Operators in java
Then Murugeshwari
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programming
programming9
 
C# conventions & good practices
C# conventions & good practicesC# conventions & good practices
C# conventions & good practices
Tan Tran
 
10. switch case
10. switch case10. switch case
10. switch case
Way2itech
 
C# Tutorial
C# Tutorial C# Tutorial
C# Tutorial
Jm Ramos
 
Common language runtime clr
Common language runtime clrCommon language runtime clr
Common language runtime clr
SanSan149
 
C the basic concepts
C the basic conceptsC the basic concepts
C the basic concepts
Abhinav Vatsa
 
Command line arguments
Command line argumentsCommand line arguments
Command line arguments
Ashok Raj
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constants
vinay arora
 
What is identifier c programming
What is identifier c programmingWhat is identifier c programming
What is identifier c programming
Rumman Ansari
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
ppd1961
 
Java string handling
Java string handlingJava string handling
Java string handling
Salman Khan
 

Similar to Coding standard and coding guideline (20)

Coding conventions
Coding conventionsCoding conventions
Coding conventions
Thitipong Jampajeen
 
76829060 java-coding-conventions
76829060 java-coding-conventions76829060 java-coding-conventions
76829060 java-coding-conventions
slavicp
 
Best practices in enterprise applications
Best practices in enterprise applicationsBest practices in enterprise applications
Best practices in enterprise applications
Chandra Sekhar Saripaka
 
Coding
CodingCoding
Coding
Vishal Singh
 
Abcxyz
AbcxyzAbcxyz
Abcxyz
vacbalolenvadi90
 
Php Egypt Jan14
Php Egypt Jan14Php Egypt Jan14
Php Egypt Jan14
Hani Gamal
 
Best-Practices-for-Writing-Clean-Code.Presentation
Best-Practices-for-Writing-Clean-Code.PresentationBest-Practices-for-Writing-Clean-Code.Presentation
Best-Practices-for-Writing-Clean-Code.Presentation
Ozias Rondon
 
Importance of the quality of code
Importance of the quality of codeImportance of the quality of code
Importance of the quality of code
Shwe Yee
 
Codings Standards
Codings StandardsCodings Standards
Codings Standards
Philip Johnson
 
Best-Practices-in-Writing-Clean-Maintainable-Code
Best-Practices-in-Writing-Clean-Maintainable-CodeBest-Practices-in-Writing-Clean-Maintainable-Code
Best-Practices-in-Writing-Clean-Maintainable-Code
Ozias Rondon
 
How to do code review and use analysis tool in software development
How to do code review and use analysis tool in software developmentHow to do code review and use analysis tool in software development
How to do code review and use analysis tool in software development
Mitosis Technology
 
Dtacs
DtacsDtacs
Dtacs
guest235dbf3f
 
Perfomatix - iOS swift coding standards
Perfomatix - iOS swift coding standardsPerfomatix - iOS swift coding standards
Perfomatix - iOS swift coding standards
Perfomatix Solutions
 
[DevDay2018] Let’s all get along. Clean Code please! - By: Christophe K. Ngo,...
[DevDay2018] Let’s all get along. Clean Code please! - By: Christophe K. Ngo,...[DevDay2018] Let’s all get along. Clean Code please! - By: Christophe K. Ngo,...
[DevDay2018] Let’s all get along. Clean Code please! - By: Christophe K. Ngo,...
DevDay Da Nang
 
Improving Code Quality Through Effective Review Process
Improving Code Quality Through Effective  Review ProcessImproving Code Quality Through Effective  Review Process
Improving Code Quality Through Effective Review Process
Dr. Syed Hassan Amin
 
Code review
Code reviewCode review
Code review
Abhishek Sur
 
Unit iv
Unit ivUnit iv
Unit iv
Sangeetha Rangarajan
 
Clean code-v2.2
Clean code-v2.2Clean code-v2.2
Clean code-v2.2
Bình Trọng Án
 
SE2018_Lec 17_ Coding
SE2018_Lec 17_ CodingSE2018_Lec 17_ Coding
SE2018_Lec 17_ Coding
Amr E. Mohamed
 
Software Development Standard Operating Procedure
Software Development Standard Operating Procedure Software Development Standard Operating Procedure
Software Development Standard Operating Procedure
rupeshchanchal
 
76829060 java-coding-conventions
76829060 java-coding-conventions76829060 java-coding-conventions
76829060 java-coding-conventions
slavicp
 
Best practices in enterprise applications
Best practices in enterprise applicationsBest practices in enterprise applications
Best practices in enterprise applications
Chandra Sekhar Saripaka
 
Php Egypt Jan14
Php Egypt Jan14Php Egypt Jan14
Php Egypt Jan14
Hani Gamal
 
Best-Practices-for-Writing-Clean-Code.Presentation
Best-Practices-for-Writing-Clean-Code.PresentationBest-Practices-for-Writing-Clean-Code.Presentation
Best-Practices-for-Writing-Clean-Code.Presentation
Ozias Rondon
 
Importance of the quality of code
Importance of the quality of codeImportance of the quality of code
Importance of the quality of code
Shwe Yee
 
Best-Practices-in-Writing-Clean-Maintainable-Code
Best-Practices-in-Writing-Clean-Maintainable-CodeBest-Practices-in-Writing-Clean-Maintainable-Code
Best-Practices-in-Writing-Clean-Maintainable-Code
Ozias Rondon
 
How to do code review and use analysis tool in software development
How to do code review and use analysis tool in software developmentHow to do code review and use analysis tool in software development
How to do code review and use analysis tool in software development
Mitosis Technology
 
Perfomatix - iOS swift coding standards
Perfomatix - iOS swift coding standardsPerfomatix - iOS swift coding standards
Perfomatix - iOS swift coding standards
Perfomatix Solutions
 
[DevDay2018] Let’s all get along. Clean Code please! - By: Christophe K. Ngo,...
[DevDay2018] Let’s all get along. Clean Code please! - By: Christophe K. Ngo,...[DevDay2018] Let’s all get along. Clean Code please! - By: Christophe K. Ngo,...
[DevDay2018] Let’s all get along. Clean Code please! - By: Christophe K. Ngo,...
DevDay Da Nang
 
Improving Code Quality Through Effective Review Process
Improving Code Quality Through Effective  Review ProcessImproving Code Quality Through Effective  Review Process
Improving Code Quality Through Effective Review Process
Dr. Syed Hassan Amin
 
Software Development Standard Operating Procedure
Software Development Standard Operating Procedure Software Development Standard Operating Procedure
Software Development Standard Operating Procedure
rupeshchanchal
 
Ad

More from Dhananjaysinh Jhala (20)

Food donation project report II
Food donation project report IIFood donation project report II
Food donation project report II
Dhananjaysinh Jhala
 
Food donation project report I
Food donation project report IFood donation project report I
Food donation project report I
Dhananjaysinh Jhala
 
JavaScript own objects(Web Technology)
JavaScript own objects(Web Technology)JavaScript own objects(Web Technology)
JavaScript own objects(Web Technology)
Dhananjaysinh Jhala
 
BCD arithmetic and 16-bit data operations
BCD arithmetic and 16-bit data operationsBCD arithmetic and 16-bit data operations
BCD arithmetic and 16-bit data operations
Dhananjaysinh Jhala
 
Design of a two pass assembler
Design of a two pass assemblerDesign of a two pass assembler
Design of a two pass assembler
Dhananjaysinh Jhala
 
Binary search trees
Binary search treesBinary search trees
Binary search trees
Dhananjaysinh Jhala
 
Sleeping barber problem
Sleeping barber problemSleeping barber problem
Sleeping barber problem
Dhananjaysinh Jhala
 
Email and DNS
Email and DNSEmail and DNS
Email and DNS
Dhananjaysinh Jhala
 
Friend function OOPC
Friend function OOPCFriend function OOPC
Friend function OOPC
Dhananjaysinh Jhala
 
applications of first order non linear partial differential equation
applications of first order non linear partial differential equationapplications of first order non linear partial differential equation
applications of first order non linear partial differential equation
Dhananjaysinh Jhala
 
concepts of national income
concepts of national income concepts of national income
concepts of national income
Dhananjaysinh Jhala
 
Circular Queue data structure
Circular Queue data structureCircular Queue data structure
Circular Queue data structure
Dhananjaysinh Jhala
 
variable entered map digital electronics
variable entered map digital electronicsvariable entered map digital electronics
variable entered map digital electronics
Dhananjaysinh Jhala
 
2 phase locking protocol DBMS
2 phase locking protocol DBMS2 phase locking protocol DBMS
2 phase locking protocol DBMS
Dhananjaysinh Jhala
 
Dark sensor using photodiode
Dark sensor using photodiodeDark sensor using photodiode
Dark sensor using photodiode
Dhananjaysinh Jhala
 
Parabola, hyperbola and its applications
Parabola, hyperbola and its applicationsParabola, hyperbola and its applications
Parabola, hyperbola and its applications
Dhananjaysinh Jhala
 
1st, 2nd kind improper integrals
1st, 2nd kind improper integrals 1st, 2nd kind improper integrals
1st, 2nd kind improper integrals
Dhananjaysinh Jhala
 
Corporate life and skills
Corporate life and skillsCorporate life and skills
Corporate life and skills
Dhananjaysinh Jhala
 
type1,2 superconductors
type1,2 superconductors type1,2 superconductors
type1,2 superconductors
Dhananjaysinh Jhala
 
Earthing, grounding and isolation
Earthing, grounding and isolation Earthing, grounding and isolation
Earthing, grounding and isolation
Dhananjaysinh Jhala
 
JavaScript own objects(Web Technology)
JavaScript own objects(Web Technology)JavaScript own objects(Web Technology)
JavaScript own objects(Web Technology)
Dhananjaysinh Jhala
 
BCD arithmetic and 16-bit data operations
BCD arithmetic and 16-bit data operationsBCD arithmetic and 16-bit data operations
BCD arithmetic and 16-bit data operations
Dhananjaysinh Jhala
 
applications of first order non linear partial differential equation
applications of first order non linear partial differential equationapplications of first order non linear partial differential equation
applications of first order non linear partial differential equation
Dhananjaysinh Jhala
 
variable entered map digital electronics
variable entered map digital electronicsvariable entered map digital electronics
variable entered map digital electronics
Dhananjaysinh Jhala
 
Parabola, hyperbola and its applications
Parabola, hyperbola and its applicationsParabola, hyperbola and its applications
Parabola, hyperbola and its applications
Dhananjaysinh Jhala
 
1st, 2nd kind improper integrals
1st, 2nd kind improper integrals 1st, 2nd kind improper integrals
1st, 2nd kind improper integrals
Dhananjaysinh Jhala
 
Earthing, grounding and isolation
Earthing, grounding and isolation Earthing, grounding and isolation
Earthing, grounding and isolation
Dhananjaysinh Jhala
 
Ad

Recently uploaded (20)

Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt
rakshaiya16
 
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdfML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
rameshwarchintamani
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjjseninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
AjijahamadKhaji
 
acid base ppt and their specific application in food
acid base ppt and their specific application in foodacid base ppt and their specific application in food
acid base ppt and their specific application in food
Fatehatun Noor
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Agents chapter of Artificial intelligence
Agents chapter of Artificial intelligenceAgents chapter of Artificial intelligence
Agents chapter of Artificial intelligence
DebdeepMukherjee9
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
Autodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User InterfaceAutodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User Interface
Atif Razi
 
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdfML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
rameshwarchintamani
 
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
Guru Nanak Technical Institutions
 
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdfDavid Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry
 
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Journal of Soft Computing in Civil Engineering
 
Frontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend EngineersFrontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend Engineers
Michael Hertzberg
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt
rakshaiya16
 
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdfML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
ML_Unit_VI_DEEP LEARNING_Introduction to ANN.pdf
rameshwarchintamani
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjjseninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
AjijahamadKhaji
 
acid base ppt and their specific application in food
acid base ppt and their specific application in foodacid base ppt and their specific application in food
acid base ppt and their specific application in food
Fatehatun Noor
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Agents chapter of Artificial intelligence
Agents chapter of Artificial intelligenceAgents chapter of Artificial intelligence
Agents chapter of Artificial intelligence
DebdeepMukherjee9
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
Autodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User InterfaceAutodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User Interface
Atif Razi
 
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdfML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
rameshwarchintamani
 
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdfDavid Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry
 
Frontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend EngineersFrontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend Engineers
Michael Hertzberg
 

Coding standard and coding guideline

  • 1. SE ALA: Coding standards and coding guidelines Dhananjaysinh Jhala, TY CE-1, Batch B, 170410107027
  • 3. Coding guidelines  Control construct  Some control constructs are selection statements meaning that it selects which code to execute. Other control constructs are loops, where the control construct determines how many times the loop will execute. C keywords related to selection statements include: if , else , switch , case , break , default .  Single entry and single exit constructs need to be used. Standard control constructs must be used instead of using wide variety of controls. There are some commonly used programming practices that help in avoiding the common errors.
  • 4.  Use of Gotos  Use of go to statements in our program makes it unstructured and it also imposes an overhead on compilation process.  Hence we should avoid them as much as possible or think of another alternative.  Information hiding  It should be supported as far as possible.  In that case, only access functions and data structures must be made visible and the information present in them must be hidden.
  • 5.  Nesting  Nesting means defining one structure inside another. If nesting is too deep then it becomes top hard to understand the code. So we should avoid deep nesting of the code.
  • 6.  User defined data types  Modern programming languages allow the user to use user defined data types. It enhances the readability of the code.  Module size  There is no standard rule about the size of the module but the large module size will not be favourable always.
  • 7.  Use of meaningful variable names for specific purpose  We should avoid using same variable name in temporary loops for multiple purposes. Each variable must be given some descriptive name so that the program becomes easy to understand.  Well documentation  Code must be well documented with the help of comment statements at appropriate places.
  • 8. Coding standards  Naming conventions  Package and variable names must be in lower case  Variable names mustn’t begin with numbers  Constants must be in upper case  Method name must be in lowercase  Prefix is must be used for boolean type of variables. E.g. isEmpty, isFull… Any good s/w development approach suggests to adhere to some well defined standards or rules for coding.
  • 9.  Files  Reader must get an idea about the purpose of the file by its name.  Line length in file must be limited to 80 characters.  Commenting/layout  Comments are non executable part of code. But they also enhance readability of code.  Comments must not only explain what is written, but also why a certain thing is written.
  • 10.  Statements  Declare some related variables on the same line and unrelated ones in another line.  Class variable should never be declared public.  Avoid use of break and continue in the loop.  Avoid the use of do…while statement  Limited use of globals  These rules tell about which types of data that can be declared global and the data that can’t be.
  • 11.  Indentation  Proper indentation is very important to increase the readability of the code. For making the code readable, programmers should use White spaces properly.  There must be a space after giving a comma between two function arguments.  Each nested block should be properly indented and spaced.  Error return values and exception handling conventions  All functions that encountering an error condition should either return a 0 or 1 for simplifying the debugging.
  翻译: