Program documentation

Slides:



Advertisements
Similar presentations
Exceptions1 Syntax, semantics, and pragmatics. Exceptions2 Syntax, semantics, pragmatics Syntax –How it looks, i.e. how we have to program to satisfy.
Advertisements

HTML5 and CSS3 Illustrated Unit B: Getting Started with HTML
Chapter 6 Multiform Projects Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
16-Jun-15 javadoc. 2 Javadoc placement javadoc comments begin with /** and end with */ In a javadoc comment, a * at the beginning of the line is not part.
Object-Oriented Enterprise Application Development Javadoc Last Updated: 06/30/2001.
1 Doc Comment Conventions. 2 Write for your audience Rule 32: Write documentation for– those who must use your code Users should not need to care how.
1 More on Arrays Arrays of objects Command line arguments The ArrayList class Javadoc Review Lecture 8 notes and L&L 7.1 – 7.2 Reading for this lecture:
System Implementation
Apply Sub Procedures/Methods and User Defined Functions
Computer Science 340 Software Design & Testing Design By Contract.
3.1 Documentation & Java Language Elements Purpose of documentation Assist the programmer with developing the program Assist other programers who.
1 Sandcastle Documentation Compilers For Managed Class Libraries common) Enabling managed class library developers throughout the world to easily create.
Module 1: Introduction to C# Module 2: Variables and Data Types
Using the Actions Pane, Host Controls, and Smart Tags
07 Coding Conventions. 2 Demonstrate Developing Local Variables Describe Separating Public and Private Members during Declaration Explore Using System.exit.
Program documentation Using the Doxygen tool Program documentation1.
Program documentation using the Javadoc tool 1 Program documentation Using the Javadoc tool.
1 Documenting with Javadoc. 2 Motivation  Why document programs? To make it easy to understand, e.g., for reuse and maintenance  What to document? Interface:
Lecture Set 11 Creating and Using Classes Part B – Class Features – Constructors, Methods, Fields, Properties, Shared Data.
Tutorial 11 Five windows included in the Visual Basic Startup Screen Main Form Toolbox Project Explorer (Project) Properties.
Web User Controls This presentation will cover the basics of defining, creating and using a web user control. Presented to Twin Cities.NET user group By.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Multiform Projects.
Documentation and Programming Style Appendix A © 2015 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Javadoc Comments.  Java API has a documentation tool called javadoc  The javadoc tool is used on the source code embedded with javadoc-style comments.
Javadoc A very short tutorial. What is it A program that automatically generates documentation of your Java classes in a standard format For each X.java.
Classes Representing Non-Trivial Objects. Problem Write a program that reads a temperature (either Fahrenheit or Celsius), and displays that same temperature.
1 Programming Environment and Tools VS.Net 2012 First project MSDN Library.
CSCI 1100/1202 April 1-3, Program Development The creation of software involves four basic activities: –establishing the requirements –creating.
COP INTERMEDIATE JAVA Designing Classes. Class Template or blueprint for creating objects. Their definition includes the list of properties (fields)
Documentation and Style. Documentation and Comments  Programs should be self-documenting.  Use meaningful variable names.  Use indentation and white.
Solving Your Problem by Generalization CS 5010 Program Design Paradigms “Bootcamp” Lesson 7.1 © Mitchell Wand, This work is licensed under a.
SWE 4743 Abstract Data Types Richard Gesick. SWE Abstract Data Types Object-oriented design is based on the theory of abstract data types Domain.
ACT476 CAPSTONE WRITING AN USER MANUAL. Developers VS Users Developers want to write code Have little time to document or write user’s manuals Users on.
Microsoft Code Contracts How to program Pre-conditions, Post-conditions, and Object Invariants Microsoft Code Contracts1.
Documentation Javadocs. Design/Documentation An essential ingredient of good Object Oriented programming is known as design by contract. This means that.
28-Feb-16 How to Write Good Comments. 2 Write for your audience Program documentation is for programmers, not end users There are two groups of programmers,
C. Thomas Wu An Intro O-O Java Programming javadoc Utility.
C# 5.0 Alex Davies 22 nd December What we will cover C# 5.0,.NET 4.5, Visual Studio 11 Caller Info Attributes Upgrade from synchronous to asynchronous.
Today Javadoc. Packages and static import. Viewing API source code. Upcoming Topics: –protected access modifier –Using the debugger in Eclipse –JUnit testing.
3-July-2002cse142-D2-Methods © 2002 University of Washington1 Methods CSE 142, Summer 2002 Computer Programming 1
More on Arrays Review of Arrays of ints, doubles, chars
Advanced Programing practices
More Sophisticated Behavior
Microsoft Visual Basic 2005 BASICS
Multi-Methods in Cecil
Programming the Web Using Visual Studio .NET
Chapter Eleven Handling Events.
Indexer AKEEL AHMED.
How to Write Good Comments
Unit testing C# classes
Web Development in Microsoft Visual Studio 2013
Variables and Arithmetic Operations
Code Snippets, Intellisense, Comments, Type Conversion
Decisions, repetition, Code Snippets, Comments, and Intellisense
Documentation Comments in C#.
ReSharper Dainius Kreivys.
CSE 143 Java Exceptions 1/18/2019.
JavaDoc and Contracts Fall 2008.
Documentation and Style
Advanced Programing practices
How to Write Good Comments
How to Write Good Comments
COP 3330 Object-oriented Programming in C++
How to organize and document your classes
How to Write Good Comments
How to Write Good Comments
Introduction to VB programming
Java Looking at our first console application in Eclipse
Computer Science 340 Software Design & Testing
Presentation transcript:

Program documentation

Program documentation C# comment styles The C# compiler recognizes a number of comment styles, including // the rest of the line is a comment /* this is a comment */ /// the rest of the line is a comment, XML style The 3-slash comment style is the most interesting Called XML documentation by Microsot Program documentation

Program documentation What to document All public and protected parts of a program should be documented using /// comments Private parts are not that important to document since they are only for internal use Classes Write a /// comment in front of the class declaration. Mention class invariants, if any. Thread safety, etc. Methods Write a /// comment in from of the method declaration. Document parameters, returned values, and exceptions thrown Program documentation

Program documentation Documenting methods Document the contract between the method and its callers Focus on what the method does, not how The how might change in the future, while the what should remain constant over time Preconditions Post-conditions Side effects Thread safety Program documentation

Assistance from Visual Studio Visual Studio can help you write 3-slash comments for methods. Just in front of the method declaration, write the 3 slashes and press ‘return’ Visual Studio will now generate a comment template to document parameters, return values, etc. This is a template! You have to fill out the template!! Program documentation

Tags for documentation comments The 3-slash comments can include some special tags, like <summary>description of class or method</summary> <param name=“theParametersname”>description</param> <returns>description</returns> <exception cref=“exceptionClass”>description</exception> <value>property description</value> Properties should have summary + value <c>text</c>, code, single word <code>text</code> code, multiple lines http://msdn.microsoft.com/en-us/library/5ast78ax.aspx Program documentation

Other special comments: TODO and HACK Visual Studio recognizes a few other special comments, like // TODO some comment // HACK some comment Note: 2 slashes, not 3 slashes Theses special comments can be viewed in Visual Studio Menu View -> Task List Used for internal developer comments Reference https://msdn.microsoft.com/en-us/library/zce12xx2(v=vs.110).aspx Program documentation

Technical writers vs. programmers Programmers are supposed to writhe the program code and the comments Programmers are usually better writing code than comments. Some companies employ technical writers who write program documentation Comments in the source code Reference documentation User manuals Tutorials etc. Program documentation

References and further reading MSDN Recommended Tags for Documentation Comments http://msdn.microsoft.com/en-us/library/5ast78ax.aspx Program documentation