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

Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer scienceumardanjumamaiwada
 
Rpg Pointers And User Space
Rpg Pointers And User SpaceRpg Pointers And User Space
Rpg Pointers And User Spaceramanjosan
 
Telephone directory using c language
Telephone directory using c languageTelephone directory using c language
Telephone directory using c languageMauryasuraj98
 
Chapter 2.4
Chapter 2.4Chapter 2.4
Chapter 2.4sotlsoc
 
Introduction to Compiler Development
Introduction to Compiler DevelopmentIntroduction to Compiler Development
Introduction to Compiler DevelopmentLogan Chien
 
Vendredi Tech_ la programmation fonctionnelle.pptx
Vendredi Tech_ la programmation fonctionnelle.pptxVendredi Tech_ la programmation fonctionnelle.pptx
Vendredi Tech_ la programmation fonctionnelle.pptxGuillaume Saint Etienne
 
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.docxfaithxdunce63732
 
JavaScript: Core Part
JavaScript: Core PartJavaScript: Core Part
JavaScript: Core Part維佋 唐
 
Fundamentals of programming)
Fundamentals of programming)Fundamentals of programming)
Fundamentals of programming)jakejakejake2
 
The Sieve of Eratosthenes - Part 1
The Sieve of Eratosthenes - Part 1The Sieve of Eratosthenes - Part 1
The Sieve of Eratosthenes - Part 1Philip Schwarz
 
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.pdfInSync2011
 
Fundamentals of prog. by rubferd medina
Fundamentals of prog. by rubferd medinaFundamentals of prog. by rubferd medina
Fundamentals of prog. by rubferd medinarurumedina
 
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 correctionsPhilip Schwarz
 

Similar to The Importance of Documentation in Programming (20)

Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
 
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
 
Switch case looping
Switch case loopingSwitch case looping
Switch case looping
 

More from Casey Robertson

Introduction to Typography
Introduction to TypographyIntroduction to Typography
Introduction to TypographyCasey Robertson
 
Concerns with Technology
Concerns with TechnologyConcerns with Technology
Concerns with TechnologyCasey Robertson
 
Production and Manufacturing Planning
Production and Manufacturing PlanningProduction and Manufacturing Planning
Production and Manufacturing PlanningCasey Robertson
 
Investigating Graphic Image Design
Investigating Graphic Image DesignInvestigating Graphic Image Design
Investigating Graphic Image DesignCasey Robertson
 
Types of Production and Manufacturing
Types of Production and ManufacturingTypes of Production and Manufacturing
Types of Production and ManufacturingCasey Robertson
 
Human Resource Management
Human Resource ManagementHuman Resource Management
Human Resource ManagementCasey Robertson
 
Introduction to Layouts in Graphic Design
Introduction to Layouts in Graphic DesignIntroduction to Layouts in Graphic Design
Introduction to Layouts in Graphic DesignCasey Robertson
 
Features in Graphic and Publication Design
Features in Graphic and Publication DesignFeatures in Graphic and Publication Design
Features in Graphic and Publication DesignCasey Robertson
 
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 PartnershipCasey Robertson
 
Forms of Business Organization
Forms of Business OrganizationForms of Business Organization
Forms of Business OrganizationCasey Robertson
 
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 EconomyCasey Robertson
 
Classification of Economic Conditions
Classification of Economic ConditionsClassification of Economic Conditions
Classification of Economic ConditionsCasey Robertson
 
The Systems Approach to Design
The Systems Approach to DesignThe Systems Approach to Design
The Systems Approach to DesignCasey Robertson
 
Measuring Economic Activity
Measuring Economic ActivityMeasuring Economic Activity
Measuring Economic ActivityCasey 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

Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
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.pdfQucHHunhnh
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
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.pptxMaritesTamaniVerdade
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 

Recently uploaded (20)

Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.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
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
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
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

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.