© 2015 Pearson Education, Inc., Hoboken, NJ. All rights reserved.

Slides:



Advertisements
Similar presentations
Programming for Beginners
Advertisements

Commenting and Naming Conventions
Programming Paradigms and languages
Java Script Session1 INTRODUCTION.
Chapter 1: Computer Systems
CS0007: Introduction to Computer Programming
Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
Chapter 2: Input, Processing, and Output
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Computer Science 101 Introduction to Programming.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
Computer Science 101 Introduction to Programming.
The Java Programming Language
School of Computer Science & Information Technology G6DICP - Lecture 9 Software Development Techniques.
Chapter 4: Loops and Files
Classes CS 21a: Introduction to Computing I First Semester,
By the end of this session you should be able to...
SE: CHAPTER 7 Writing The Program
Copyright © 2010 Pearson Education, Inc. publishing as Prentice HallChapter Writing and Completing Reports and Proposals.
M-1 University of Washington Computer Programming I Program Style © 2000 UW CSE.
Introduction to programming in the Java programming language.
Documentation and Programming Style Appendix A © 2015 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Java The Java programming language was created by Sun Microsystems, Inc. It was introduced in 1995 and it's popularity has grown quickly since A programming.
Designing Classes Prelude © 2015 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures and Abstractions with Java, 4e Frank.
Revealing the Secrets of Self-Documenting Code Svetlin Nakov Telerik Corporation
ANU COMP2110 Software Design in 2003 Lecture 10Slide 1 COMP2110 Software Design in 2004 Lecture 12 Documenting Detailed Design How to write down detailed.
©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. CSC INTRO TO COMPUTING - PROGRAMMING If Statement.
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Algorithms and Pseudocode
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 1: Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science.
1 Problem Solving  The purpose of writing a program is to solve a problem  The general steps in problem solving are: Understand the problem Dissect the.
Implementation Topics Describe –Characteristics of good implementations –Best practices to achieve them Understand role of comments Learn debugging techniques.
A Guide to Dr. Young’s CS331 Project Report Writing
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Summary prepared by Kirk Scott
Chapter 10 Programming Fundamentals with JavaScript
Whatcha doin'? Aims: To start using Python. To understand loops.
3.1 Fundamentals of algorithms
Working with Java.
CS1022 Computer Programming & Principles
Lecture 1 Introduction Richard Gesick.
C++ coding standard suggestion… Separate reasoning from action, in every block. Hi, this talk is to suggest a rule (or guideline) to simplify C++ code.
Documentation Generators
WELCOME to….. The If Statement.
Variables and Primative Types
Topic: Functions – Part 2
Statement atoms The 'atomic' components of a statement are: delimiters (indents, semicolons, etc.); keywords (built into the language); identifiers (names.
CS 240 – Lecture 11 Pseudocode.
Introduction Java Chapter 3.
Recursion 12-Nov-18.
Learning to Program in Python
Chapter 10 Programming Fundamentals with JavaScript
Coding Design, Style, Documentation and Optimization
Introduction to Python
Objects First with Java
A Guide to Dr. Young’s CS331 Project Report Writing
Recursion 2-Dec-18.
Recursion 2-Dec-18.
Chapter 1: Computer Systems
Recursion 29-Dec-18.
Unit 6 Assignment 2 Chris Boardley.
Computing Fundamentals
Anatomy of a Java Program
Tutorial 10: Programming with javascript
Recursion 23-Apr-19.
Classes CS 21a: Introduction to Computing I
Unit 1 Programming - Assignment 3
Review of Previous Lesson
Chapter 4: Writing and Designing a Complete Program
Chapter 9: Implementation
Presentation transcript:

© 2015 Pearson Education, Inc., Hoboken, NJ. All rights reserved

 Zain ul islam Adil(BSSE 5th)  Mehwish Irshad(BSSE 5th)  Kehkishan Senam(BSSE 5th)

 Zain ul islam Adil

 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

 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

 internal  external documentation

 how it works on the inside  what is the problem it’s trying to solve.

 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.

 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.

 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.

1. Unit Development Folder(UDF) 2. Detailed-Design Document

 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.

 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.

 Mehwish Irshad

 Programing Style

 style is a set of rules or guidelines used when writing the source code for a computer program

 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

 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

 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

 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

 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

 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.

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

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." ); }