SlideShare a Scribd company logo
1 of 14
Download to read offline
The Pseudo code
Programming Process
Code Complete
Author : Steven C. McConnell.

Prof. Asha N

1
Summary of Steps in Building Classes
and Routines




Creating a general
design for the class is an
iterative process
class creation can be a
messy process for all the
reasons that design is a
messy process

Prof. Asha N

2
Steps in Creating a Class




Create a general design for the class
Construct each routine within the class
Review and test the class as a whole

Prof. Asha N

3
Steps in Building a Routine


creating a routine—
designing the routine,
checking the design,
coding the routine,
and checking the
code

Prof. Asha N

4
Pseudo code for Pros




“pseudocode” – English-like notation for
describing how an algorithm, a routine, a
class, or a program will work
Pseudocode Programming Process (PPP)
defines a specific approach to use
pseudocode to streamline the creation of
code within routines.

Prof. Asha N

5
Contd…
guidelines for using pseudocode





Use English-like statements that precisely
describe specific operations.
Avoid syntactic elements from the target
programming language.
Write pseudocode at the level of intent.
Write pseudocode at a low enough level that
generating code from it will be nearly automatic.

Prof. Asha N

6
Contd…


Example of Bad Pseudocode
increment resource number by 1
allocate a dlg struct using malloc
if malloc() returns NULL then return 1
invoke OSrsrc_init to initialize a resource for the operating system
*hRsrcPtr = resource number
return 0

Prof. Asha N

7
Contd…


Example of Good Pseudocode
Keep track of current number of resources in use
If another resource is available
Allocate a dialog box structure
If a dialog box structure could be allocated
Note that one more resource is in use
Initialize the resource
Store the resource number at the location provided by the caller
Endif
Endif
Return TRUE if a new resource was created; else return FALSE

Prof. Asha N

8
Constructing Routines Using the PPP


the activities involved in constructing a
routine
1.
2.
3.
4.
5.

Design the routine
Code the routine
Check the code
Clean up leftovers
Repeat as needed

Prof. Asha N

9
1. Design the Routine













Check the prerequisites
Define the problem the routine will solve
Name the routine
Decide how to test the routine
Think about error handling
Think about efficiency
Research functionality available in the standard libraries
Research the algorithms and data types
Write the pseudocode
Think about the data
Check the pseudocode
Try a few ideas in pseudocode, and keep the best (iterate)

Prof. Asha N

10
2. Code the Routine

Prof. Asha N

11
3. Check the Code







Mentally check the routine for errors
Compile the routine
Step through the code in the debugger
Test the code
Remove errors from the routine

Prof. Asha N

12
4. Clean Up Leftovers


take several cleanup steps to make sure that the
routine’s quality is up to your standards









Check the routine’s interface
Check for general design quality
Check the routine’s data
Check the routine’s statements and logic
Check the routine’s layout
Check the routine’s documentation.
Remove redundant comments

Prof. Asha N

13
5. Repeat Steps as Needed


If the quality of the routine is poor, back up to the
pseudocode. High-quality programming is an
iterative process, so don’t hesitate to loop through
the construction activities again.

Prof. Asha N

14

More Related Content

What's hot

Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVA
Abhilash Nair
 
Oop lec 2(introduction to object oriented technology)
Oop lec 2(introduction to object oriented technology)Oop lec 2(introduction to object oriented technology)
Oop lec 2(introduction to object oriented technology)
Asfand Hassan
 
Problem Solving Aspect of Swapping Two Integers using a Temporary Variable
Problem Solving Aspect of Swapping Two Integers using a Temporary VariableProblem Solving Aspect of Swapping Two Integers using a Temporary Variable
Problem Solving Aspect of Swapping Two Integers using a Temporary Variable
Saravana Priya
 

What's hot (20)

Object oriented programming c++
Object oriented programming c++Object oriented programming c++
Object oriented programming c++
 
NP completeness
NP completenessNP completeness
NP completeness
 
9. chapter 8 np hard and np complete problems
9. chapter 8   np hard and np complete problems9. chapter 8   np hard and np complete problems
9. chapter 8 np hard and np complete problems
 
Introduction to Algorithm
Introduction to AlgorithmIntroduction to Algorithm
Introduction to Algorithm
 
Compiler Construction | Lecture 1 | What is a compiler?
Compiler Construction | Lecture 1 | What is a compiler?Compiler Construction | Lecture 1 | What is a compiler?
Compiler Construction | Lecture 1 | What is a compiler?
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in Java
 
Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using Computer
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithm
 
Dynamic method dispatch
Dynamic method dispatchDynamic method dispatch
Dynamic method dispatch
 
Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVA
 
Chapter 09 design and analysis of algorithms
Chapter 09  design and analysis of algorithmsChapter 09  design and analysis of algorithms
Chapter 09 design and analysis of algorithms
 
BackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesBackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and Examples
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-Hard
 
Modular programming
Modular programmingModular programming
Modular programming
 
Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners
 
Oop lec 2(introduction to object oriented technology)
Oop lec 2(introduction to object oriented technology)Oop lec 2(introduction to object oriented technology)
Oop lec 2(introduction to object oriented technology)
 
Problem solving and design
Problem solving and designProblem solving and design
Problem solving and design
 
Problem Solving Aspect of Swapping Two Integers using a Temporary Variable
Problem Solving Aspect of Swapping Two Integers using a Temporary VariableProblem Solving Aspect of Swapping Two Integers using a Temporary Variable
Problem Solving Aspect of Swapping Two Integers using a Temporary Variable
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1
 
Lecture 01 introduction to compiler
Lecture 01 introduction to compilerLecture 01 introduction to compiler
Lecture 01 introduction to compiler
 

Viewers also liked

Introduction to Pseudocode
Introduction to PseudocodeIntroduction to Pseudocode
Introduction to Pseudocode
Damian T. Gordon
 
Pseudocode basics
Pseudocode basicsPseudocode basics
Pseudocode basics
kiran_kaur
 
Algorithm and pseudo codes
Algorithm and pseudo codesAlgorithm and pseudo codes
Algorithm and pseudo codes
hermiraguilar
 
4a searching-more
4a searching-more4a searching-more
4a searching-more
Shahzad Ali
 
程序员发展漫谈
程序员发展漫谈程序员发展漫谈
程序员发展漫谈
Horky Chen
 

Viewers also liked (20)

Pseudocode
PseudocodePseudocode
Pseudocode
 
Introduction to Pseudocode
Introduction to PseudocodeIntroduction to Pseudocode
Introduction to Pseudocode
 
Pseudocode basics
Pseudocode basicsPseudocode basics
Pseudocode basics
 
Algorithm and pseudo codes
Algorithm and pseudo codesAlgorithm and pseudo codes
Algorithm and pseudo codes
 
4a searching-more
4a searching-more4a searching-more
4a searching-more
 
Pseudocode By ZAK
Pseudocode By ZAKPseudocode By ZAK
Pseudocode By ZAK
 
Basic concepts
Basic conceptsBasic concepts
Basic concepts
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Defencive programming
Defencive programmingDefencive programming
Defencive programming
 
Integration
IntegrationIntegration
Integration
 
Design in construction
Design in constructionDesign in construction
Design in construction
 
Variables
VariablesVariables
Variables
 
A Guideline to Test Your Own Code - Developer Testing
A Guideline to Test Your Own Code - Developer TestingA Guideline to Test Your Own Code - Developer Testing
A Guideline to Test Your Own Code - Developer Testing
 
高品質軟體的基本動作 101 + 102 for NUU
高品質軟體的基本動作 101 + 102 for NUU高品質軟體的基本動作 101 + 102 for NUU
高品質軟體的基本動作 101 + 102 for NUU
 
Code tuning techniques
Code tuning techniquesCode tuning techniques
Code tuning techniques
 
Java scriptcore brief introduction
Java scriptcore brief introductionJava scriptcore brief introduction
Java scriptcore brief introduction
 
程序员发展漫谈
程序员发展漫谈程序员发展漫谈
程序员发展漫谈
 
Coding Style
Coding StyleCoding Style
Coding Style
 
代码大全(内训)
代码大全(内训)代码大全(内训)
代码大全(内训)
 

Similar to The pseudocode

javabasics_ programming development chapter01
javabasics_ programming development chapter01javabasics_ programming development chapter01
javabasics_ programming development chapter01
Udeshg90
 
Software development slides
Software development slidesSoftware development slides
Software development slides
iarthur
 
Introduction to Software Review
Introduction to Software ReviewIntroduction to Software Review
Introduction to Software Review
Philip Johnson
 
Sheet1Individual Needs Appointment for Hair StylingEmployee gr.docx
Sheet1Individual Needs Appointment for Hair StylingEmployee gr.docxSheet1Individual Needs Appointment for Hair StylingEmployee gr.docx
Sheet1Individual Needs Appointment for Hair StylingEmployee gr.docx
lesleyryder69361
 
Software development slides
Software development slidesSoftware development slides
Software development slides
iarthur
 

Similar to The pseudocode (20)

TAMUC LO 10
TAMUC LO 10TAMUC LO 10
TAMUC LO 10
 
Preocupações Desenvolvedor Ágil
Preocupações Desenvolvedor ÁgilPreocupações Desenvolvedor Ágil
Preocupações Desenvolvedor Ágil
 
javabasics_ programming development chapter01
javabasics_ programming development chapter01javabasics_ programming development chapter01
javabasics_ programming development chapter01
 
Software development slides
Software development slidesSoftware development slides
Software development slides
 
Programming NC-IV
Programming NC-IVProgramming NC-IV
Programming NC-IV
 
Introduction to Software Review
Introduction to Software ReviewIntroduction to Software Review
Introduction to Software Review
 
[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,...
 
Testing practicies not only in scala
Testing practicies not only in scalaTesting practicies not only in scala
Testing practicies not only in scala
 
Sheet1Individual Needs Appointment for Hair StylingEmployee gr.docx
Sheet1Individual Needs Appointment for Hair StylingEmployee gr.docxSheet1Individual Needs Appointment for Hair StylingEmployee gr.docx
Sheet1Individual Needs Appointment for Hair StylingEmployee gr.docx
 
Code tuning strategies
Code tuning strategiesCode tuning strategies
Code tuning strategies
 
DataMind interactive learning: Dublin R User Group: September 2013
DataMind interactive learning: Dublin R User Group: September 2013DataMind interactive learning: Dublin R User Group: September 2013
DataMind interactive learning: Dublin R User Group: September 2013
 
Intro to prog
Intro to progIntro to prog
Intro to prog
 
Django Best Practices
Django Best PracticesDjango Best Practices
Django Best Practices
 
Software coding and testing
Software coding and testingSoftware coding and testing
Software coding and testing
 
Ch13
Ch13Ch13
Ch13
 
Software presentation
Software presentationSoftware presentation
Software presentation
 
Slides chapter 5
Slides chapter 5Slides chapter 5
Slides chapter 5
 
SE chapter 5
SE chapter 5SE chapter 5
SE chapter 5
 
How to Deliver the Right Software (Specification by example)
How to Deliver the Right Software (Specification by example)How to Deliver the Right Software (Specification by example)
How to Deliver the Right Software (Specification by example)
 
Software development slides
Software development slidesSoftware development slides
Software development slides
 

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Recently uploaded (20)

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 

The pseudocode

  • 1. The Pseudo code Programming Process Code Complete Author : Steven C. McConnell. Prof. Asha N 1
  • 2. Summary of Steps in Building Classes and Routines   Creating a general design for the class is an iterative process class creation can be a messy process for all the reasons that design is a messy process Prof. Asha N 2
  • 3. Steps in Creating a Class    Create a general design for the class Construct each routine within the class Review and test the class as a whole Prof. Asha N 3
  • 4. Steps in Building a Routine  creating a routine— designing the routine, checking the design, coding the routine, and checking the code Prof. Asha N 4
  • 5. Pseudo code for Pros   “pseudocode” – English-like notation for describing how an algorithm, a routine, a class, or a program will work Pseudocode Programming Process (PPP) defines a specific approach to use pseudocode to streamline the creation of code within routines. Prof. Asha N 5
  • 6. Contd… guidelines for using pseudocode     Use English-like statements that precisely describe specific operations. Avoid syntactic elements from the target programming language. Write pseudocode at the level of intent. Write pseudocode at a low enough level that generating code from it will be nearly automatic. Prof. Asha N 6
  • 7. Contd…  Example of Bad Pseudocode increment resource number by 1 allocate a dlg struct using malloc if malloc() returns NULL then return 1 invoke OSrsrc_init to initialize a resource for the operating system *hRsrcPtr = resource number return 0 Prof. Asha N 7
  • 8. Contd…  Example of Good Pseudocode Keep track of current number of resources in use If another resource is available Allocate a dialog box structure If a dialog box structure could be allocated Note that one more resource is in use Initialize the resource Store the resource number at the location provided by the caller Endif Endif Return TRUE if a new resource was created; else return FALSE Prof. Asha N 8
  • 9. Constructing Routines Using the PPP  the activities involved in constructing a routine 1. 2. 3. 4. 5. Design the routine Code the routine Check the code Clean up leftovers Repeat as needed Prof. Asha N 9
  • 10. 1. Design the Routine             Check the prerequisites Define the problem the routine will solve Name the routine Decide how to test the routine Think about error handling Think about efficiency Research functionality available in the standard libraries Research the algorithms and data types Write the pseudocode Think about the data Check the pseudocode Try a few ideas in pseudocode, and keep the best (iterate) Prof. Asha N 10
  • 11. 2. Code the Routine Prof. Asha N 11
  • 12. 3. Check the Code      Mentally check the routine for errors Compile the routine Step through the code in the debugger Test the code Remove errors from the routine Prof. Asha N 12
  • 13. 4. Clean Up Leftovers  take several cleanup steps to make sure that the routine’s quality is up to your standards        Check the routine’s interface Check for general design quality Check the routine’s data Check the routine’s statements and logic Check the routine’s layout Check the routine’s documentation. Remove redundant comments Prof. Asha N 13
  • 14. 5. Repeat Steps as Needed  If the quality of the routine is poor, back up to the pseudocode. High-quality programming is an iterative process, so don’t hesitate to loop through the construction activities again. Prof. Asha N 14