SlideShare a Scribd company logo
1 of 7
Download to read offline
The Importance of
Documentation in Programming
Why is it important?
Without documentation, programs
may be confusing and/or make no
sense.
va r sla ying = t rue ;
va r youH it = M a t h.f loor (M a t h.ra ndom () * 2);
va r da m a ge ThisRound = M a t h.floor (M a t h.ra ndom () *
5 + 1);
va r t ot a lD a m a ge = 0;
w hile (sla ying) { if (youH it ) {
c onsole .log("You hit t he dra gon a nd did " +
da m a ge ThisRound + " da m a ge !");
t ot a lD a m a ge + = da m a ge ThisRound ;
if (t ot a lD a m a ge > = 4) {
c onsole .log("You did it ! You sle w t he dra gon!");
sla ying = f a lse ;
} e lse {
youH it = M a t h.f loor (M a t h.ra ndom () * 2);
} } e lse {
c onsole .log("The dra gon burnina t e s you! You' re
t oa st .");
sla ying = fa lse ; }}
?
Commenting
Comments can be their own line or
added to the end of a string.
Commenting
Comments can be used as a form of pseudocode to
outline intention prior to writing the actual code. In
this case it should explain the logic behind the code
rather than the code itself.
Commenting in various languages
Javascript / /
Visual Basic
C / * */
‘
General Rules for Commenting
Not every line should be commented, but any line that
performs an operation should.
Any line that causes confusion should be commented.
At the top of the program there should be comments on
its purpose and scope of the program.
Another common comment is a last revised date and
version number at the top of the program.

More Related Content

Similar to The Importance of Documentation in Programming

Chapter 2.4
Chapter 2.4Chapter 2.4
Chapter 2.4
sotlsoc
 
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docxCS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
faithxdunce63732
 
Database & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdf
Database & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdfDatabase & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdf
Database & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdf
InSync2011
 
Fundamentals of prog. by rubferd medina
Fundamentals of prog. by rubferd medinaFundamentals of prog. by rubferd medina
Fundamentals of prog. by rubferd medina
rurumedina
 

Similar to The Importance of Documentation in Programming (20)

Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
 
lecture 5
 lecture 5 lecture 5
lecture 5
 
C tutorial
C tutorialC tutorial
C tutorial
 
C tutorial
C tutorialC tutorial
C tutorial
 
C tutorial
C tutorialC tutorial
C tutorial
 
Rpg Pointers And User Space
Rpg Pointers And User SpaceRpg Pointers And User Space
Rpg Pointers And User Space
 
Telephone directory using c language
Telephone directory using c languageTelephone directory using c language
Telephone directory using c language
 
Chapter 2.4
Chapter 2.4Chapter 2.4
Chapter 2.4
 
Introduction to Compiler Development
Introduction to Compiler DevelopmentIntroduction to Compiler Development
Introduction to Compiler Development
 
Vendredi Tech_ la programmation fonctionnelle.pptx
Vendredi Tech_ la programmation fonctionnelle.pptxVendredi Tech_ la programmation fonctionnelle.pptx
Vendredi Tech_ la programmation fonctionnelle.pptx
 
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docxCS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
 
Ic lecture7
Ic lecture7  Ic lecture7
Ic lecture7
 
Tugas Pw [6]
Tugas Pw [6]Tugas Pw [6]
Tugas Pw [6]
 
Tugas Pw [6] (2)
Tugas Pw [6] (2)Tugas Pw [6] (2)
Tugas Pw [6] (2)
 
JavaScript: Core Part
JavaScript: Core PartJavaScript: Core Part
JavaScript: Core Part
 
Fundamentals of programming)
Fundamentals of programming)Fundamentals of programming)
Fundamentals of programming)
 
The Sieve of Eratosthenes - Part 1
The Sieve of Eratosthenes - Part 1The Sieve of Eratosthenes - Part 1
The Sieve of Eratosthenes - Part 1
 
Database & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdf
Database & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdfDatabase & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdf
Database & Technology 1 _ Tom Kyte _ Efficient PL SQL - Why and How to Use.pdf
 
Fundamentals of prog. by rubferd medina
Fundamentals of prog. by rubferd medinaFundamentals of prog. by rubferd medina
Fundamentals of prog. by rubferd medina
 
The Sieve of Eratosthenes - Part 1 - with minor corrections
The Sieve of Eratosthenes - Part 1 - with minor correctionsThe Sieve of Eratosthenes - Part 1 - with minor corrections
The Sieve of Eratosthenes - Part 1 - with minor corrections
 

More from Casey Robertson

Types of Production and Manufacturing
Types of Production and ManufacturingTypes of Production and Manufacturing
Types of Production and Manufacturing
Casey Robertson
 

More from Casey Robertson (20)

Workplace Hazards
Workplace HazardsWorkplace Hazards
Workplace Hazards
 
Introduction to Typography
Introduction to TypographyIntroduction to Typography
Introduction to Typography
 
Concerns with Technology
Concerns with TechnologyConcerns with Technology
Concerns with Technology
 
Technology In Business
Technology In BusinessTechnology In Business
Technology In Business
 
Business Operations
Business OperationsBusiness Operations
Business Operations
 
Production and Manufacturing Planning
Production and Manufacturing PlanningProduction and Manufacturing Planning
Production and Manufacturing Planning
 
Investigating Graphic Image Design
Investigating Graphic Image DesignInvestigating Graphic Image Design
Investigating Graphic Image Design
 
Types of Production and Manufacturing
Types of Production and ManufacturingTypes of Production and Manufacturing
Types of Production and Manufacturing
 
Levels of Management
Levels of ManagementLevels of Management
Levels of Management
 
Human Resource Management
Human Resource ManagementHuman Resource Management
Human Resource Management
 
Introduction to Layouts in Graphic Design
Introduction to Layouts in Graphic DesignIntroduction to Layouts in Graphic Design
Introduction to Layouts in Graphic Design
 
Features in Graphic and Publication Design
Features in Graphic and Publication DesignFeatures in Graphic and Publication Design
Features in Graphic and Publication Design
 
Types of Leadership
Types of LeadershipTypes of Leadership
Types of Leadership
 
Principals of Managment
Principals of ManagmentPrincipals of Managment
Principals of Managment
 
Five Types of Partners in a Business Partnership
Five Types of Partners in a Business PartnershipFive Types of Partners in a Business Partnership
Five Types of Partners in a Business Partnership
 
Forms of Business Organization
Forms of Business OrganizationForms of Business Organization
Forms of Business Organization
 
Factors and Regulations for the Global Economy
Factors and Regulations for the Global EconomyFactors and Regulations for the Global Economy
Factors and Regulations for the Global Economy
 
Classification of Economic Conditions
Classification of Economic ConditionsClassification of Economic Conditions
Classification of Economic Conditions
 
The Systems Approach to Design
The Systems Approach to DesignThe Systems Approach to Design
The Systems Approach to Design
 
Measuring Economic Activity
Measuring Economic ActivityMeasuring Economic Activity
Measuring Economic Activity
 

Recently uploaded

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
Krashi Coaching
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
中 央社
 

Recently uploaded (20)

Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17
 
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General QuizPragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
Pragya Champions Chalice 2024 Prelims & Finals Q/A set, General Quiz
 
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17
 
MichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdfMichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdf
 
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptxHVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
HVAC System | Audit of HVAC System | Audit and regulatory Comploance.pptx
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptx
 
Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024
 
How to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 InventoryHow to Manage Closest Location in Odoo 17 Inventory
How to Manage Closest Location in Odoo 17 Inventory
 
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
Operations Management - Book1.p  - Dr. Abdulfatah A. SalemOperations Management - Book1.p  - Dr. Abdulfatah A. Salem
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the life
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).
 
IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.
 
size separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticssize separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceutics
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 

The Importance of Documentation in Programming

  • 2. Why is it important? Without documentation, programs may be confusing and/or make no sense.
  • 3. va r sla ying = t rue ; va r youH it = M a t h.f loor (M a t h.ra ndom () * 2); va r da m a ge ThisRound = M a t h.floor (M a t h.ra ndom () * 5 + 1); va r t ot a lD a m a ge = 0; w hile (sla ying) { if (youH it ) { c onsole .log("You hit t he dra gon a nd did " + da m a ge ThisRound + " da m a ge !"); t ot a lD a m a ge + = da m a ge ThisRound ; if (t ot a lD a m a ge > = 4) { c onsole .log("You did it ! You sle w t he dra gon!"); sla ying = f a lse ; } e lse { youH it = M a t h.f loor (M a t h.ra ndom () * 2); } } e lse { c onsole .log("The dra gon burnina t e s you! You' re t oa st ."); sla ying = fa lse ; }} ?
  • 4. Commenting Comments can be their own line or added to the end of a string.
  • 5. Commenting Comments can be used as a form of pseudocode to outline intention prior to writing the actual code. In this case it should explain the logic behind the code rather than the code itself.
  • 6. Commenting in various languages Javascript / / Visual Basic C / * */ ‘
  • 7. General Rules for Commenting Not every line should be commented, but any line that performs an operation should. Any line that causes confusion should be commented. At the top of the program there should be comments on its purpose and scope of the program. Another common comment is a last revised date and version number at the top of the program.