SlideShare a Scribd company logo
1 of 14
CODE DOCUMENTATION
DEFINITION OF TERMS
What is Code ?
DEFINITION OF TERMS
 What is Code ?
What is Documentation ?
DEFINITION OF TERMS
 What is Code ?
 What is Documentation ?
What is Code documentation ?
REASONS FOR CODE DOCUMENTATION
You will be using your code months later
You want people to use your code
 You want people to help out
 It makes your code better
 You want to be a better writer
HOW TO DOCUMENT CODE
Types of Documentation
Requirement documentation
Commenting
Mark-down/README.md
End-User Documentation
Requirement documentation ?
Commenting ?
Commenting ?
Types Of Commenting
 Inline Commenting
 Descriptive Blocks
What is Mark-down ?
Basic writing for mark-down
 Paragraphs
 Headings
 Block
 Styling text
Lists
 Code formatting
README.md file ?
 What to write
 What problem your project solves
 A small code example
 A link to your code & issue tracker
 Frequently Asked Questions (FAQ)
 Information for people who want to contribute back
 Installation instructions
 Your project’s license
End-User Documentation ?
CONCLUSION
Code documentation is required for any project embarked on, for the
benefit of the programmer and every other person involved.
A programmer that properly documents code will find the debugging
process easier, even thou the problem isn’t fixed by them, it could be
fixed by another programmer because the code could be easily
understood because it was properly documented.
THANK YOU

More Related Content

What's hot

Authentication
AuthenticationAuthentication
Authenticationsoon
 
Front-End Testing: Demystified
Front-End Testing: DemystifiedFront-End Testing: Demystified
Front-End Testing: DemystifiedSeth McLaughlin
 
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...Edureka!
 
Validation Controls in asp.net
Validation Controls in asp.netValidation Controls in asp.net
Validation Controls in asp.netDeep Patel
 
This keyword in java
This keyword in javaThis keyword in java
This keyword in javaHitesh Kumar
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQLEhsan Hamzei
 
Java Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaJava Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaEdureka!
 
JavaScript - Chapter 15 - Debugging Techniques
 JavaScript - Chapter 15 - Debugging Techniques JavaScript - Chapter 15 - Debugging Techniques
JavaScript - Chapter 15 - Debugging TechniquesWebStackAcademy
 
Large Table Partitioning with PostgreSQL and Django
 Large Table Partitioning with PostgreSQL and Django Large Table Partitioning with PostgreSQL and Django
Large Table Partitioning with PostgreSQL and DjangoEDB
 
L9 wrapper classes
L9 wrapper classesL9 wrapper classes
L9 wrapper classesteach4uin
 

What's hot (20)

Authentication
AuthenticationAuthentication
Authentication
 
Front-End Testing: Demystified
Front-End Testing: DemystifiedFront-End Testing: Demystified
Front-End Testing: Demystified
 
Domain Driven Design 101
Domain Driven Design 101Domain Driven Design 101
Domain Driven Design 101
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Scrum + bdd + ddd
Scrum + bdd + dddScrum + bdd + ddd
Scrum + bdd + ddd
 
PHP FUNCTIONS
PHP FUNCTIONSPHP FUNCTIONS
PHP FUNCTIONS
 
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
 
8. sql
8. sql8. sql
8. sql
 
Generics
GenericsGenerics
Generics
 
Validation Controls in asp.net
Validation Controls in asp.netValidation Controls in asp.net
Validation Controls in asp.net
 
Introduction to JavaScript Basics.
Introduction to JavaScript Basics.Introduction to JavaScript Basics.
Introduction to JavaScript Basics.
 
This keyword in java
This keyword in javaThis keyword in java
This keyword in java
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Java Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaJava Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | Edureka
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 
Angular overview
Angular overviewAngular overview
Angular overview
 
JavaScript - Chapter 15 - Debugging Techniques
 JavaScript - Chapter 15 - Debugging Techniques JavaScript - Chapter 15 - Debugging Techniques
JavaScript - Chapter 15 - Debugging Techniques
 
QSpiders - Jdk Jvm Jre and Jit
QSpiders - Jdk Jvm Jre and JitQSpiders - Jdk Jvm Jre and Jit
QSpiders - Jdk Jvm Jre and Jit
 
Large Table Partitioning with PostgreSQL and Django
 Large Table Partitioning with PostgreSQL and Django Large Table Partitioning with PostgreSQL and Django
Large Table Partitioning with PostgreSQL and Django
 
L9 wrapper classes
L9 wrapper classesL9 wrapper classes
L9 wrapper classes
 

Similar to code documentation

Documenting code yapceu2016
Documenting code yapceu2016Documenting code yapceu2016
Documenting code yapceu2016Søren Lund
 
Topic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolutionTopic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolutionHoa Le
 
Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016Søren Lund
 
The Anatomy of a Code Review
The Anatomy of a Code ReviewThe Anatomy of a Code Review
The Anatomy of a Code ReviewGuilherme Garnier
 
Tdd vs bdd vs atdd — developers’ methodologies to navigate complex developmen...
Tdd vs bdd vs atdd — developers’ methodologies to navigate complex developmen...Tdd vs bdd vs atdd — developers’ methodologies to navigate complex developmen...
Tdd vs bdd vs atdd — developers’ methodologies to navigate complex developmen...Katy Slemon
 
Code & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven DesignCode & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven DesignFrank Levering
 
BDD presentation
BDD presentationBDD presentation
BDD presentationtemebele
 
Ideal 2007 BEAM Overview
Ideal 2007 BEAM OverviewIdeal 2007 BEAM Overview
Ideal 2007 BEAM Overviewidealsys
 
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...MongoDB
 
The BDD Process (Behavior-driven development)
The BDD Process (Behavior-driven development)The BDD Process (Behavior-driven development)
The BDD Process (Behavior-driven development)GleecusTechlabs1
 
Frontend Development vs Backend Development | Detailed Comparison
Frontend Development vs Backend Development | Detailed ComparisonFrontend Development vs Backend Development | Detailed Comparison
Frontend Development vs Backend Development | Detailed ComparisonMariya James
 
Rhapsody Leveraging Software For Reuse
Rhapsody Leveraging Software For ReuseRhapsody Leveraging Software For Reuse
Rhapsody Leveraging Software For ReuseBill Duncan
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven DevelopmentAdam Englander
 
What Do Developers Discuss about Code Comments?
What Do Developers Discuss about Code Comments?What Do Developers Discuss about Code Comments?
What Do Developers Discuss about Code Comments?Pooja Rani
 
Programming vs Coding: Unveiling The Key Differences
Programming vs Coding: Unveiling The Key DifferencesProgramming vs Coding: Unveiling The Key Differences
Programming vs Coding: Unveiling The Key DifferencesFredReynolds2
 
WordCamp Pune 2017- WordPress Coding standards
WordCamp Pune 2017- WordPress Coding standardsWordCamp Pune 2017- WordPress Coding standards
WordCamp Pune 2017- WordPress Coding standardsSwapnil Patil
 
Why Codeigniter Development Services are preferred?
Why Codeigniter Development Services are preferred?Why Codeigniter Development Services are preferred?
Why Codeigniter Development Services are preferred?NCode Technologies Inc.
 

Similar to code documentation (20)

Documenting code yapceu2016
Documenting code yapceu2016Documenting code yapceu2016
Documenting code yapceu2016
 
Topic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolutionTopic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolution
 
Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016
 
The Anatomy of a Code Review
The Anatomy of a Code ReviewThe Anatomy of a Code Review
The Anatomy of a Code Review
 
Tdd vs bdd vs atdd — developers’ methodologies to navigate complex developmen...
Tdd vs bdd vs atdd — developers’ methodologies to navigate complex developmen...Tdd vs bdd vs atdd — developers’ methodologies to navigate complex developmen...
Tdd vs bdd vs atdd — developers’ methodologies to navigate complex developmen...
 
Code & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven DesignCode & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven Design
 
BDD presentation
BDD presentationBDD presentation
BDD presentation
 
Introduction to CodeFactory
Introduction to CodeFactoryIntroduction to CodeFactory
Introduction to CodeFactory
 
Ideal 2007 BEAM Overview
Ideal 2007 BEAM OverviewIdeal 2007 BEAM Overview
Ideal 2007 BEAM Overview
 
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
MongoDB World 2019: Building Flexible and Secure Customer Applications with M...
 
The BDD Process (Behavior-driven development)
The BDD Process (Behavior-driven development)The BDD Process (Behavior-driven development)
The BDD Process (Behavior-driven development)
 
Frontend Development vs Backend Development | Detailed Comparison
Frontend Development vs Backend Development | Detailed ComparisonFrontend Development vs Backend Development | Detailed Comparison
Frontend Development vs Backend Development | Detailed Comparison
 
Rhapsody Leveraging Software For Reuse
Rhapsody Leveraging Software For ReuseRhapsody Leveraging Software For Reuse
Rhapsody Leveraging Software For Reuse
 
Unit iv
Unit ivUnit iv
Unit iv
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
What Do Developers Discuss about Code Comments?
What Do Developers Discuss about Code Comments?What Do Developers Discuss about Code Comments?
What Do Developers Discuss about Code Comments?
 
Programming vs Coding: Unveiling The Key Differences
Programming vs Coding: Unveiling The Key DifferencesProgramming vs Coding: Unveiling The Key Differences
Programming vs Coding: Unveiling The Key Differences
 
Career Path Planning
Career Path PlanningCareer Path Planning
Career Path Planning
 
WordCamp Pune 2017- WordPress Coding standards
WordCamp Pune 2017- WordPress Coding standardsWordCamp Pune 2017- WordPress Coding standards
WordCamp Pune 2017- WordPress Coding standards
 
Why Codeigniter Development Services are preferred?
Why Codeigniter Development Services are preferred?Why Codeigniter Development Services are preferred?
Why Codeigniter Development Services are preferred?
 

code documentation

  • 3. DEFINITION OF TERMS  What is Code ? What is Documentation ?
  • 4. DEFINITION OF TERMS  What is Code ?  What is Documentation ? What is Code documentation ?
  • 5. REASONS FOR CODE DOCUMENTATION You will be using your code months later You want people to use your code  You want people to help out  It makes your code better  You want to be a better writer
  • 6. HOW TO DOCUMENT CODE Types of Documentation Requirement documentation Commenting Mark-down/README.md End-User Documentation
  • 9. Commenting ? Types Of Commenting  Inline Commenting  Descriptive Blocks
  • 10. What is Mark-down ? Basic writing for mark-down  Paragraphs  Headings  Block  Styling text Lists  Code formatting
  • 11. README.md file ?  What to write  What problem your project solves  A small code example  A link to your code & issue tracker  Frequently Asked Questions (FAQ)  Information for people who want to contribute back  Installation instructions  Your project’s license
  • 13. CONCLUSION Code documentation is required for any project embarked on, for the benefit of the programmer and every other person involved. A programmer that properly documents code will find the debugging process easier, even thou the problem isn’t fixed by them, it could be fixed by another programmer because the code could be easily understood because it was properly documented.

Editor's Notes

  1. What is Code? A set of symbols for representing something. In programming, code is a term used for both the statements written in a particular programming language the source code, and a term for the source code after it has been processed by a compiler and made ready to run in the computer.
  2. What is Documentation? Documentation is a set of documents provided on paper, or online, or on digital or analog media, such as audio tape or CDs. Example are user guides, white papers, on-line help, quick-reference guides. It is becoming less common to see paper (hard-copy) documentation. Documentation is distributed via websites, software products, and other on-line applications  
  3. What is Code documentation? This is the process of using documents to explain what is being accomplished in the program in English, not code, so that anyone can pick up the program and be able to understand what is being done.  
  4. REASONS FOR CODE DOCUMENTATION   1) You will be using your code months later The best reason to write docs is because you will be using your code months later. Code that you wrote 6 months ago is often indistinguishable from code that someone else has written. As you go through this selfless act of untangling things that were obvious or clever months ago, you will start to empathize with your users. If only I had written down why I had done this. Life would be so much simpler. Documentation allows you to transfer the why behind code. Much in the same way code comments explain the why, and not the how, documentation serves the same purpose.   2) You want people to use your code You have written a piece of code, and released it into the world. You have done this because you think that others might find it useful. However, people need to understand why your code might be useful for them, before they decide to use it. Documentation tells people that this project is for them.   3)You want people to help out Open source is this magical thing right? Remember the child hood story of the shoemaker and the gnomes, and how they fixed shoes for him ? You release code, and the code gnomes come and make it better for you. Not quite. There are lots of ways that open source is amazing, but it doesn’t exist outside the laws of physics. You have to put work in, to get work out. Documentation also provides a platform for your first contributions. A lot of people have never contributed before, and documentation changes are a lot less scary than code changes. If you don’t have documentation, you will miss out on a whole class of contributors.   4) It makes your code better There is an old truth that writing things down helps you think. It’s really easy to have an idea in your head that sounds perfect, but the act of putting words to paper requires a distillation of thought. Writing documentation improves the design of your code. Talking through your API and design decisions on paper allows you to think about them in a more formalized way. A nice side effect is that it allows people to contribute code that follows your original intentions as well.   5) You want to be a better writer Writing documentation is a different form of writing than most people have experience with. Technical writing is an art that doesn’t come naturally. Writing documentation will start you down the road to being a better technical writer, which is a useful skill to have as a programmer. Writing also becomes easier over time. If you don’t write for many months, it is a lot harder to start writing again. Keeping your projects documented will keep you writing at a reasonable cadence.        
  5. Requirements documentation is the description of what a particular software does or shall do. Requirements are produced and consumed by everyone involved in the production of software: end users, customers, product managers, project managers, sales, marketing, software architects, usability engineers, interaction designers, developers, and testers, to name a few. Thus, requirements documentation has many different purposes. They also state hardware requirements like the ram required , the hard disk space required to run the software and also software requirements like java environment.
  6. Commenting Commenting is the process, whereby programmers/developers use the inbuilt comment feature of the programming language they are using to explain certain lines of the code they have written.
  7. Mark-down is a way to style text on the web. You control the display of the document; formatting words as bold or italic, adding images, and creating lists are just a few of the things we can do with Markdown. Mostly, Markdown is just regular text with a few non-alphabetic characters thrown in, like # or *. Basic writing for mark-down Paragraphs: for example, On July 2, an alien mothership entered Earth's orbit and deployed several dozen saucer-shaped "destroyer" spacecraft, each 15 miles (24 km) wide. Headings: for example, e.g The number of # you use will determine the size of the heading.# Block-quotes Styling text - You can make text bold or italic. Lists Unordered lists Ordered lists Code formatting Inline formats Multiple lines Links – For example, to create a hyperlink to www.github.com, with a link text that says, Visit GitHub!, you'd write this in Markdown: [Visit GitHub!](https://www.github.com).
  8. README Your first steps in documentation should go into your README. Code hosting services will render your README into HTML automatically if you provide the proper extension. It is also the first interaction that most users will have with your project. So having a solid README will serve your project well. What to write Now we’re getting down to the brass tacks. Making sure that you give your users all the information that they need, but not too much. First, you need to ask yourself who you’re writing for. At first, you generally just need to appeal to two audiences: Users Developers Users are people who simply want to use your code, and don’t care how it works. Developers are people who want to contribute back to your code.   What problem your project solves A lot of people will come to your docs trying to figure out what exactly your project is. Someone will mention it, or they’ll google a phrase randomly. You should explain what your project does and why it exists. Fabric does a great job of this.   A small code example Show a telling example of what your project would normally be used for. Requests does a great example of this.   A link to your code & issue tracker People like to browse the code sometimes. They might be interested in filing bugs against the code for issues they’ve found. Make it really easy for people who want to contribute back to the project in any way possible. I think the Python Guide does a good job with the link to the code portion.     Frequently Asked Questions (FAQ) A lot of people have the same problems. If things happen all the time, you should probably fix your documentation or the code, so that the problems go away. However, there are always questions that get asked about your project, things that can’t be changed, etc. Document those, and keep it up to date. FAQs are generally out of date, but when done well, they are a golden resource. Tastypie did a great job with this, with their “Cookbook” concept.     Information for people who want to contribute back People usually have standards for how they expect things to be done in their projects. You should document these so that if people write code, they can do things in the norm of the project. Open Comparison does a great job of this.   Installation instructions Once people figure out whether they want to use your code or not, they need to know how to actually get it and make it run. Hopefully your install instructions should be a couple lines for the basic case. A page that gives more information and caveats should be linked from here if necessary. I think at Read the Docs we do a good job with this. Your project’s license BSD? MIT? GPL? This stuff might not matter to you, but the people who want to use your code will care about this a whole lot. Think about what you want to accomplish with your license, and please only pick one of the standard licenses that you see around the web.
  9. This gives a description of how the code or project is used. user documentation describes each feature of the program, and assists the user in realizing these features. A good user document can also go so far as to provide thorough troubleshooting assistance.