Download presentation
Presentation is loading. Please wait.
Published byZain ul Modified over 7 years ago
1
© 2015 Pearson Education, Inc., Hoboken, NJ. All rights reserved
2
Zain ul islam Adil(BSSE 5th) Mehwish Irshad(BSSE 5th) Kehkishan Senam(BSSE 5th)
3
Zain ul islam Adil
5
Name should suggest use of variable Follow practice/convention of other programmers Variable names start with lower case Class names start with upper case If variable has multiple words, each word starts with capital letter Constant names in all caps © 2015 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved
6
Documentation for a program describes what the program does and how it does it Clean style, well-chosen names make program purpose and logic clear Programs also need explanation to make completely clear. © 2015 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved
7
internal external documentation
8
how it works on the inside what is the problem it’s trying to solve.
9
Internal documentation is the one that talks in detail about how the code does whatever it function is. It describes the data structures, algorithms, and control flow in the programs.
10
External documentation, on the other hand, focuses on what the problem to be solved is, and which approach is used in solving it. This can be a graph detailing the execution, a list of algorithms, dependencies, as well as meta-data such as the author, the date, and so forth.
12
External documentation means the documentation for the other people or clients to get understanding about the software or project that how the system will flow. It Includes things like flow charts, UML Diagrams, etc.
13
1. Unit Development Folder(UDF) 2. Detailed-Design Document
14
A unit-development folder (UDF), or software- development folder (SDF), is an informal document that contains notes used by a developer during construction. The main purpose of a UDF is to provide a trail of design decisions that aren’t documented elsewhere. A “unit” is loosely defined, usually to mean a class, although it could also mean a package or a component.
15
The detailed-design document is the low- level design document. It describes the class-level or routine-level design decisions, the alternatives that were considered, and the reasons for selecting the approaches that were selected.
16
Mehwish Irshad
17
Programing Style
18
style is a set of rules or guidelines used when writing the source code for a computer program
19
Programming Style Requirements -- A one- page summary (PDF format) of the documentation requirements of the course. I recommend that you keep a copy of this handy for reference as you write your programs. Failure to document your programs in accordance with these requirements will result in a loss of points when I grade your program. Programming Style Requirements
20
How to Develop a Simple Java Program -- Designed for students just learning Java, this document takes a simple programming assignment and shows, step by step, how to go about developing a Java program to solve the problem, how to document the program, and how to produce a printout suitable for handing in. NOTE: The commenting templates in this example are a bit different from what I now require. How to Develop a Simple Java Program Block Comment Templates with Examples -- Doing internal and external block comments is much easier if you have a template to fill in with the details. Here is an HTML version of the templates, for Java, along with directions on how to include them in your program and an example or two. Block Comment Templates with Examples For indentation, even though C and Java are not the same, they are similar enough that I think my Indenting C Programs document is adequate to get the points across for Java, too.Indenting C Programs Oracle's Java Code Conventions -- Sun's Java style guide, based on a C style document from AT&T and Sun (and available below). Oracle's Java Code Conventions
21
How to Develop a Simple Python Program -- Designed for students just learning Python, this document takes a simple programming assignment and shows, step by step, how to go about developing a Python program to solve the problem, and how to document the program. How to Develop a Simple Python Program Unlike Java and C, Python programs are required to be indented consistently (or else the program can't be run!). That's why, unlike the Java and C sections below, I don't have a page of suggestions for documenting Python. Stick with 4 spaces per level of indentation, and you'll be fine. Style Guide for Python Code -- Guido van Rossum's Python programming style guide. Guido is the father of Python; the man knows of what he writes. Yes, it's long. Consider that to be an indication of the importance of good programming style. Style Guide for Python Code
22
How to Develop a Simple C Program -- Designed for students just learning C/C++, this document takes a simple programming assignment and shows, step by step, how to go about developing a C program to solve the problem, how to document the program, and how to produce a printout suitable for handing in. How to Develop a Simple C Program Toward Developing Good Programming Style -- The C language version of a document that shows how to apply the rules given in the Programming Style Requirements document to a sample C program. Toward Developing Good Programming Style Block Comment Templates with Examples -- Doing internal and external block comments (as demonstrated in the style examples, above) is much easier if you have a template to fill-in with the details. Here is an HTML version of the templates, along with directions on how to include them in your program and an example or two. NOTE: This includes both C and Pascal templates. Block Comment Templates with Examples Indenting C Programs -- Some students just don't seem to catch on to the idea of indenting program statements to improve code clarity, so I created this page. It shows how to acceptably indent a variety of common C control structures. Indenting C Programs Recommended C Style and Coding Standards -- This is an HTML version of an updated version of the classic Indian Hills C Style and Coding Standards paper. It covers a wide range of topics. Recommended C Style and Coding Standards Recommended C Style and Coding Standards (Postscript version) -- Same as the above, but in Postscript format. Recommended C Style and Coding Standards (Postscript version) C Style and Coding Standards (Postscript) -- a style document created by programmers at AT&T Information Systems and Sun Microsystems. C Style and Coding Standards (Postscript) Sun Microsystem's Java Code Conventions -- The previous document, being available only in Postscript, may be hard for you to access. But, here is their Java style guide, and it is based on that C document. Java does have many similarities to C, so reading through these documents can still be beneficial to C programmers. Sun Microsystem's Java Code Conventions
23
Toward Developing Good Programming Style -- The Pascal language version of a document that shows how to apply the rules given in the Programming Style Requirements document to a sample Pascal program. Toward Developing Good Programming Style Block Comment Templates with Examples -- Doing internal and external block comments (as demonstrated in the style examples, above) is much easier if you have a template to fill-in with the details. Here is an HTML version of the templates, along with directions on how to include them in your program and an example or two. NOTE: This includes both Pascal and C templates Block Comment Templates with Examples
24
In contrast to external documentation, internal documentation is found within the program listing itself. It’s the most detailed kind of documentation. It’s most closely associated with the code. The main contributor to code-level documentation isn’t comments, but good programming style.
25
Style Includes Good program structure. use of straight forward and easily understandable approaches. good variable and routine names. minimization of control-flow and data-structure complexity
26
Java Example of Poor Documentation Resulting from Bad Programming Style for ( i = 2; i <= num; i++ ) { meetsCriteria[ i ] = true; } for ( i = 2; i <= num / 2; i++ ) { j = i + i; while ( j <= num ) { meetsCriteria[ j ] = false; j = j + i; } for ( i = 2; i <= num; i++ ) { if ( meetsCriteria[ i ] ) { System.out.println ( i + " meets criteria." ); }
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.