Programming Style and Documentation Objective(s) F To become familiar with Java Style and Documentation Guidelines.

Slides:



Advertisements
Similar presentations
L2:CSC © Dr. Basheer M. Nasef Lecture #2 By Dr. Basheer M. Nasef.
Advertisements

Chapter 2 Elementary Programming
Coding Standards for Java An Introduction. Why Coding Standards are Important? Coding Standards lead to greater consistency within your code and the code.
Documentation 1 Comprehending the present – Investing in the future.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 2 1 Chapter 2 Primitive.
LESSON 3 - Identifiers JAVA PROGRAMMING. Identifiers All the Java components —classes, variables, and methods— need names. In Java these names are called.
Chapter 2 Primitive Data Types and Operations F Introduce Programming with an Example F Identifiers, Variables, and Constants F Primitive Data Types –byte,
 2003 Prentice Hall, Inc. All rights reserved. 1 Lecture 3 Variables Primitive Data Types calculations & arithmetic operators Readings: Chapter 2.
CSE 222 Systems Programming Introduction Dr. Jim Holten.
Primitive Data Types and Operations. Introducing Programming with an Example public class ComputeArea { /** Main method */ public static void main(String[]
Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 2: Your First Program.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 2 Primitive Data.
Introduction to Java Programming, 4E Y. Daniel Liang.
1. 2 Chapter 1 Introduction to Computers, Programs, and Java.
Java Overview CS2336: Computer Science II1. First Program public class HelloWorld { public static void main(String args[]) { System.out.println("Hello.
Java Programming, 3e Concepts and Techniques Chapter 2 Creating a Java Application and Applet.
Liang, Introduction to Java Programming, Tenth Edition, (c) 2015 Pearson Education, Inc. All rights reserved. 1 Chapter 2 Elementary Programming.
Java Building Elements Lecture 2 Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University
Primitive Data Types and Operations Identifiers, Variables, and Constants Primitive Data Types Byte, short, int, long, float, double, char, boolean Casting.
Chapter 2 Primitive Data Types and Operations F Introduce Programming with an Example  The MyInput class F Identifiers, Variables, and Constants F Primitive.
Simple Programs from Chapter 2 Putting the Building Blocks All Together (corresponds with Chapter 2)
1 Chapter 2 Primitive Data Types and Operations F Introduce Programming with an Example  The MyInput class F Identifiers, Variables, and Constants F Primitive.
Comments are for people Header comments supply basic information about the artifact.
CIS 15 - Advanced Programming Techniques Using C Professor Yedidyah Langsam 525NE icq: AOL IM: BCCISProf.
Good Programming Practices. 2 home back first prev next last What Will I Learn? List examples of good programming practices Accurately insert comments.
Introduction to Java Thanks to Dan Lunney (SHS). Java Basics File names The “main” method Output to screen Escape Sequence – Special Characters format()
/* Documentations */ Pre process / Linking statements Global declarations; main( ) { Local Declarations; Program statements / Executable statements; }
Chapter 2 Elementary Programming
Java Syntax and Style JavaMethods An Introduction to Object-Oriented Programming Maria Litvin Gary Litvin Copyright © 2003 by Maria Litvin, Gary Litvin,
Jaeki Song ISQS6337 Lecture 01 Introduction. Jaeki Song ISQS6337 Instructor Name: Jaeki Song Office: BA 712 Office Hours Tuesday & Thursday 2:00-3:20.
M-1 University of Washington Computer Programming I Program Style © 2000 UW CSE.
Introduction to programming in the Java programming language.
Code Conventions Tonga Institute of Higher Education.
© 2011 Pearson Education, publishing as Addison-Wesley Tuesday After answering the questions after logging in, open BlueJ and the Formula class.
Program Style Chapter 22 IB103 Week 12 (part 2). Modularity: the ability to reuse code Encapsulation: hide data access directly but may use methods (the.
Documentation and Style. Documentation and Comments  Programs should be self-documenting.  Use meaningful variable names.  Use indentation and white.
Coding Conventions  Coding conventions are a set of guidelines for a specific software project that recommend programming style, practices and methods.
A Simple Java Program //This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { public static void main(String[]
CPS120: Introduction to Computer Science Introduction to C++
CPS120: Introduction to Computer Science Variables and Constants.
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Introduction to Computers, Programs,
Introducing Java Chapter 3 Review. Why Program in Java? Java, is an object-oriented programming language. OOP languages evolved out of the need to better.
Familiar concept Names for storage Choosing names Ruby rules Program Variables Click icon to hear comments.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Elementary Programming.
Principles of Programming. Achieving an Object-Oriented Design  Abstraction and Information Hiding  Object-Oriented Design  Functional Decomposition.
Chapter 3 Introducing Java. Objectives and Goals 1. Define terminology associated with object- oriented programming. 2. Explain why Java is a widely used.
Primitive Data Types and Operations F Introduce Programming with an Example F Identifiers, Variables, and Constants F Primitive Data Types –byte, short,
The Essentials of a Java Program JavaMethods An Introduction to Object-Oriented Programming Maria Litvin Gary Litvin Copyright © 2003 by Maria Litvin,
1.  Algorithm: 1. Read in the radius 2. Compute the area using the following formula: area = radius x radius x PI 3. Display the area 2.
Working with Java.
Chapter 1 Introduction to Computers, Programs, and Java
Lecture 3: Operators, Expressions and Type Conversion
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 2 Applications and Data.
Introduction Java Chapter 3.
Coding Design, Style, Documentation and Optimization
Programming Vocabulary.
مساق: خوارزميات ومبادئ البرمجة الفصل الدراسي الثاني 2016/2015
Chapter 1: Computer Systems
Chapter 2: Java Fundamentals
Documentation and Style
Anatomy of a Java Program
Unit 3: Variables in Java
Chap 2. Identifiers, Keywords, and Types
Chapter 2 Primitive Data Types and Operations
Creating Maintainable code
CSCE-221 C++ Coding Standard/Guidelines
Rectangle 1 and 2.
Creating readable code
Presentation transcript:

Programming Style and Documentation Objective(s) F To become familiar with Java Style and Documentation Guidelines

Programming Style and Documentation F Appropriate Comments F Naming Conventions F Proper Indentation and Spacing Lines F Block Styles

Appropriate Comments Include a summary at the beginning of the program to explain what the program does, its key features, its supporting data structures, formulas, and any unique techniques it uses. Include your name, class section, professor’s name, instruction, date, and a brief description at the beginning of the program.

Naming Conventions F Choose meaningful and descriptive names. F Variables and method names: –Use lowercase. If the name consists of several words, concatenate all in one, use lowercase for the first word, and capitalize the first letter of each subsequent word in the name. For example, the variables radius and area, and the method computeArea.

Naming Conventions, cont.  Class names: –Capitalize the first letter of each word in the name. For example, the class name ComputeArea. F Constants: –Capitalize all letters in constants. For example, the constant PI.

Proper Indentation and Spacing  Indentation –Indent two spaces. F Spacing –Use blank line to separate segments of the code.

Block Styles Use end-of-line style for braces.