SlideShare a Scribd company logo
3
Most read
6
Most read
12
Most read
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

More Related Content

What's hot (20)

Introduction to Java Programming
Introduction to Java Programming
Ravi Kant Sahu
 
Adaptive software development
Adaptive software development
Jenita lamichhane
 
Java-java virtual machine
Java-java virtual machine
Surbhi Panhalkar
 
unit testing and debugging
unit testing and debugging
KarthigaGunasekaran1
 
Sdlc models
Sdlc models
Vatsana Technologies Pte Ltd
 
White Box Testing
White Box Testing
MariamKhan120
 
Project control and process instrumentation
Project control and process instrumentation
Kuppusamy P
 
Basic Java Programming
Basic Java Programming
Math-Circle
 
Classification of Compilers
Classification of Compilers
Sarmad Ali
 
Evolutionary models
Evolutionary models
Pihu Goel
 
Data Types, Variables, and Operators
Data Types, Variables, and Operators
Marwa Ali Eissa
 
Software requirement specification
Software requirement specification
shiprashakya2
 
software maintenance
software maintenance
rajshreemuthiah
 
Introduction to UML
Introduction to UML
Emertxe Information Technologies Pvt Ltd
 
Software architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding Guide
Mohammed Fazuluddin
 
Software engineering model
Software engineering model
Manish Chaurasia
 
Lect2 conventional software management
Lect2 conventional software management
meena466141
 
Staruml
Staruml
valeri kopaleishvili
 
Evolving role of Software,Legacy software,CASE tools,Process Models,CMMI
Evolving role of Software,Legacy software,CASE tools,Process Models,CMMI
nimmik4u
 
Java String class
Java String class
DrRajeshreeKhande
 
Introduction to Java Programming
Introduction to Java Programming
Ravi Kant Sahu
 
Adaptive software development
Adaptive software development
Jenita lamichhane
 
Project control and process instrumentation
Project control and process instrumentation
Kuppusamy P
 
Basic Java Programming
Basic Java Programming
Math-Circle
 
Classification of Compilers
Classification of Compilers
Sarmad Ali
 
Evolutionary models
Evolutionary models
Pihu Goel
 
Data Types, Variables, and Operators
Data Types, Variables, and Operators
Marwa Ali Eissa
 
Software requirement specification
Software requirement specification
shiprashakya2
 
Software architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding Guide
Mohammed Fazuluddin
 
Software engineering model
Software engineering model
Manish Chaurasia
 
Lect2 conventional software management
Lect2 conventional software management
meena466141
 
Evolving role of Software,Legacy software,CASE tools,Process Models,CMMI
Evolving role of Software,Legacy software,CASE tools,Process Models,CMMI
nimmik4u
 

Similar to Coding standard and coding guideline (20)

Coding
Coding
Vishal Singh
 
Coding standards
Coding standards
BishalAryal8
 
9-Coding.ppt
9-Coding.ppt
KomalSinghGill
 
7-CodingAndUT.ppt
7-CodingAndUT.ppt
DuraisamySubramaniam1
 
11. Lecture 19 Code standards and review.ppt
11. Lecture 19 Code standards and review.ppt
MaddalaSeshu
 
Unit iv
Unit iv
Sangeetha Rangarajan
 
Abcxyz
Abcxyz
vacbalolenvadi90
 
09 coding standards_n_guidelines
09 coding standards_n_guidelines
University of Computer Science and Technology
 
SE2018_Lec 17_ Coding
SE2018_Lec 17_ Coding
Amr E. Mohamed
 
Programming style guildelines
Programming style guildelines
Rich Nguyen
 
Coding
Coding
Anand Mutyala
 
SE2_Lec 18_ Coding
SE2_Lec 18_ Coding
Amr E. Mohamed
 
Software Coding for software engineering
Software Coding for software engineering
ssuserb3a23b
 
Clean code
Clean code
Smita Prasad
 
Crafting high quality code
Crafting high quality code
Allan Mangune
 
Software engineering topics,coding phase in sdlc
Software engineering topics,coding phase in sdlc
dhandesumit71
 
Source Code Quality
Source Code Quality
Alberto Simões
 
Software development slides
Software development slides
iarthur
 
Software coding & testing, software engineering
Software coding & testing, software engineering
Rupesh Vaishnav
 
Coding conventions
Coding conventions
Thitipong Jampajeen
 
Ad

More from Dhananjaysinh Jhala (20)

Food donation project report II
Food donation project report II
Dhananjaysinh Jhala
 
Food donation project report I
Food donation project report I
Dhananjaysinh Jhala
 
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 operations
Dhananjaysinh Jhala
 
Design of a two pass assembler
Design of a two pass assembler
Dhananjaysinh Jhala
 
Binary search trees
Binary search trees
Dhananjaysinh Jhala
 
Sleeping barber problem
Sleeping barber problem
Dhananjaysinh Jhala
 
Email and DNS
Email and DNS
Dhananjaysinh Jhala
 
Friend function OOPC
Friend function OOPC
Dhananjaysinh Jhala
 
applications 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
Dhananjaysinh Jhala
 
Circular Queue data structure
Circular Queue data structure
Dhananjaysinh Jhala
 
variable entered map digital electronics
variable entered map digital electronics
Dhananjaysinh Jhala
 
2 phase locking protocol DBMS
2 phase locking protocol DBMS
Dhananjaysinh Jhala
 
Dark sensor using photodiode
Dark sensor using photodiode
Dhananjaysinh Jhala
 
Parabola, hyperbola and its applications
Parabola, hyperbola and its applications
Dhananjaysinh Jhala
 
1st, 2nd kind improper integrals
1st, 2nd kind improper integrals
Dhananjaysinh Jhala
 
Corporate life and skills
Corporate life and skills
Dhananjaysinh Jhala
 
type1,2 superconductors
type1,2 superconductors
Dhananjaysinh Jhala
 
Earthing, grounding and isolation
Earthing, grounding and isolation
Dhananjaysinh Jhala
 
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 operations
Dhananjaysinh Jhala
 
applications 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 electronics
Dhananjaysinh Jhala
 
Parabola, hyperbola and its applications
Parabola, hyperbola and its applications
Dhananjaysinh Jhala
 
1st, 2nd kind improper integrals
1st, 2nd kind improper integrals
Dhananjaysinh Jhala
 
Earthing, grounding and isolation
Earthing, grounding and isolation
Dhananjaysinh Jhala
 
Ad

Recently uploaded (20)

Impurities of Water and their Significance.pptx
Impurities of Water and their Significance.pptx
dhanashree78
 
FINAL 2013 Module 20 Corrosion Control and Sequestering PPT Slides.pptx
FINAL 2013 Module 20 Corrosion Control and Sequestering PPT Slides.pptx
kippcam
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
djiceramil
 
4th International Conference on Computer Science and Information Technology (...
4th International Conference on Computer Science and Information Technology (...
ijait
 
Rearchitecturing a 9-year-old legacy Laravel application.pdf
Rearchitecturing a 9-year-old legacy Laravel application.pdf
Takumi Amitani
 
NALCO Green Anode Plant,Compositions of CPC,Pitch
NALCO Green Anode Plant,Compositions of CPC,Pitch
arpitprachi123
 
Structural Design for Residential-to-Restaurant Conversion
Structural Design for Residential-to-Restaurant Conversion
DanielRoman285499
 
Great power lithium iron phosphate cells
Great power lithium iron phosphate cells
salmankhan835951
 
ACEP Magazine Fifth Edition on 5june2025
ACEP Magazine Fifth Edition on 5june2025
Rahul
 
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
RATNANITINPATIL
 
Rigor, ethics, wellbeing and resilience in the ICT doctoral journey
Rigor, ethics, wellbeing and resilience in the ICT doctoral journey
Yannis
 
How Binning Affects LED Performance & Consistency.pdf
How Binning Affects LED Performance & Consistency.pdf
Mina Anis
 
OCS Group SG - HPHT Well Design and Operation - SN.pdf
OCS Group SG - HPHT Well Design and Operation - SN.pdf
Muanisa Waras
 
Week 6- PC HARDWARE AND MAINTENANCE-THEORY.pptx
Week 6- PC HARDWARE AND MAINTENANCE-THEORY.pptx
dayananda54
 
Pavement and its types, Application of rigid and Flexible Pavements
Pavement and its types, Application of rigid and Flexible Pavements
Sakthivel M
 
Engineering Mechanics Introduction and its Application
Engineering Mechanics Introduction and its Application
Sakthivel M
 
WIRELESS COMMUNICATION SECURITY AND IT’S PROTECTION METHODS
WIRELESS COMMUNICATION SECURITY AND IT’S PROTECTION METHODS
samueljackson3773
 
IntroSlides-June-GDG-Cloud-Munich community [email protected]
IntroSlides-June-GDG-Cloud-Munich community [email protected]
Luiz Carneiro
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
djiceramil
 
A Comprehensive Investigation into the Accuracy of Soft Computing Tools for D...
A Comprehensive Investigation into the Accuracy of Soft Computing Tools for D...
Journal of Soft Computing in Civil Engineering
 
Impurities of Water and their Significance.pptx
Impurities of Water and their Significance.pptx
dhanashree78
 
FINAL 2013 Module 20 Corrosion Control and Sequestering PPT Slides.pptx
FINAL 2013 Module 20 Corrosion Control and Sequestering PPT Slides.pptx
kippcam
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-ABB Furse.pdf
djiceramil
 
4th International Conference on Computer Science and Information Technology (...
4th International Conference on Computer Science and Information Technology (...
ijait
 
Rearchitecturing a 9-year-old legacy Laravel application.pdf
Rearchitecturing a 9-year-old legacy Laravel application.pdf
Takumi Amitani
 
NALCO Green Anode Plant,Compositions of CPC,Pitch
NALCO Green Anode Plant,Compositions of CPC,Pitch
arpitprachi123
 
Structural Design for Residential-to-Restaurant Conversion
Structural Design for Residential-to-Restaurant Conversion
DanielRoman285499
 
Great power lithium iron phosphate cells
Great power lithium iron phosphate cells
salmankhan835951
 
ACEP Magazine Fifth Edition on 5june2025
ACEP Magazine Fifth Edition on 5june2025
Rahul
 
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
Tree_Traversals.pptbbbbbbbbbbbbbbbbbbbbbbbbb
RATNANITINPATIL
 
Rigor, ethics, wellbeing and resilience in the ICT doctoral journey
Rigor, ethics, wellbeing and resilience in the ICT doctoral journey
Yannis
 
How Binning Affects LED Performance & Consistency.pdf
How Binning Affects LED Performance & Consistency.pdf
Mina Anis
 
OCS Group SG - HPHT Well Design and Operation - SN.pdf
OCS Group SG - HPHT Well Design and Operation - SN.pdf
Muanisa Waras
 
Week 6- PC HARDWARE AND MAINTENANCE-THEORY.pptx
Week 6- PC HARDWARE AND MAINTENANCE-THEORY.pptx
dayananda54
 
Pavement and its types, Application of rigid and Flexible Pavements
Pavement and its types, Application of rigid and Flexible Pavements
Sakthivel M
 
Engineering Mechanics Introduction and its Application
Engineering Mechanics Introduction and its Application
Sakthivel M
 
WIRELESS COMMUNICATION SECURITY AND IT’S PROTECTION METHODS
WIRELESS COMMUNICATION SECURITY AND IT’S PROTECTION METHODS
samueljackson3773
 
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
362 Alec Data Center Solutions-Slysium Data Center-AUH-Adaptaflex.pdf
djiceramil
 

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.