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.

Slides:



Advertisements
Similar presentations
Lecture 10 Flow of Control: Loops (Part 2) COMP1681 / SE15 Introduction to Programming.
Advertisements

Revealing the Secrets of Self-Documenting Code Svetlin Nakov Telerik Corporation For C# Developers.
Code Correctness, Readability, Maintainability Svetlin Nakov Telerik Corporation
P5, M1, D1.
Unit 6 Assignment 2 Chris Boardley.
Chapter 1: Computer Systems
Communicating in Code: Layout and Style Programming Studio Spring 2012 Note: several examples in this lecture taken from The Practice of Programming by.
Chapter 3: Modularization
Chapter 2: Modularization
By Justin Hendrix. Design Challenges Design is the activity that links requirements to coding and debugging. Good design is useful on small project and.
1 University of Utah – School of Computing Computer Science 1021 "Programming with Style"
Coding Standards for Java An Introduction. Why Coding Standards are Important? Coding Standards lead to greater consistency within your code and the code.
Communicating in Code: Layout and Style Programming Studio Spring 2009 Note: several examples in this lecture taken from The Practice of Programming by.
Chapter 10 THINKING IN OBJECTS 1 Object Oriented programming Instructor: Dr. Essam H. Houssein.
SYSTEM ANALYSIS & DESIGN (DCT 2013)
Programming Style a programs language gives you a lot of freedom how to write a program – too much? but some programming style is good goal: it must be.
1 Introduction to Software Engineering Lecture 42 – Communication Skills.
Aalborg Media Lab 21-Jun-15 Software Design Lecture 1 “ Introduction to Java and OOP”
Chapter 1 Principles of Programming and Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Algorithm Programming Coding Advices Bar-Ilan University תשס " ו by Moshe Fresko.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Chapter 7 Designing Classes. Class Design When we are developing a piece of software, we want to design the software We don’t want to just sit down and.
1 Web Based Programming Section 6 James King 12 August 2003.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Design-Making Projects Work (Chapter7) n Large Projects u Design often distinct from analysis or coding u Project takes weeks, months or years to create.
Programming Style and Documentation Objective(s) F To become familiar with Java Style and Documentation Guidelines.
Chapter 13: Implementation Phase 13.3 Good Programming Practice 13.6 Module Test Case Selection 13.7 Black-Box Module-Testing Techniques 13.8 Glass-Box.
Object-Oriented Modeling and Design
Implementation 1. Software Implementation – transforming design into code Requirements Analysis Software Design Implementation Testing Deployment Evolution.
1 ENERGY 211 / CME 211 Lecture 26 November 19, 2008.
SE: CHAPTER 7 Writing The Program
Improving the Quality of Existing Code Svetlin Nakov Telerik Corporation
Refactoring1 Improving the structure of existing code.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 5.0.
Programming Principles Spreadsheet-Based Decision Support Systems Chapter 24: Aslı Sencer MIS 463.
CSC 212 – Data Structures Prof. Matthew Hertz WTC 207D /
Scientific Computing Home Assignment #1 Dr. Guy Tel-Zur.
CSCI 125 & 161 / ENGR 144 Lecture 8 Martin van Bommel.
Spreadsheet Engineering Builders use blueprints or plans – Without plans structures will fail to be effective Advanced planning in any sort of design can.
Writing Maintainable code Dr. Susan McKeever DT228/3 GUI Programming.
Designing Classes. Software changes Software is not like a novel that is written once and then remains unchanged. Software is extended, corrected, maintained,
PROGRAMMING GUIDELINES. SYLISTIC GUIDELINES  Meaningful names for identifiers Identifiers identify different parts of C++ programs. Identifiers should.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Chapter 7 Implementation. Implementation Approaches F Big bang –Code entire system and test in an unstructured manner F Top-down –Start by implementing.
Refactoring1 Improving the structure of existing code.
1 COS 260 DAY 12 Tony Gauvin. 2 Agenda Questions? 5 th Mini quiz –Chapter 5 40 min Assignment 3 Due Assignment 4 will be posted later (next week) –If.
Principles of Programming. Achieving an Object-Oriented Design  Abstraction and Information Hiding  Object-Oriented Design  Functional Decomposition.
Chapter 10 Software quality. This chapter discusses n Some important properties we want our system to have, specifically correctness and maintainability.
Designing classes How to write classes in a way that they are easily understandable, maintainable and reusable 6.0.
Principles of Programming & Software Engineering
Principles of Programming and Software Engineering
Objects First with Java
Communicating in Code: Layout and Style
Objects First with Java
PROGRAMMING METHODOLOGY
Chapter 1: Computer Systems
Introduction to SAS A SAS program is a list of SAS statements executed in order Every SAS statement ends with a semicolon! SAS statements can be in caps.
Improving the structure of existing code
Unit 6 Assignment 2 Chris Boardley.
Units with – James tedder
Programming Logic and Design Fourth Edition, Comprehensive
Units with – James tedder
Documentation and Style
CMSC 345 Programming.
Spreadsheet-Based Decision Support Systems
Spreadsheet-Based Decision Support Systems
Chapter 2. Problem Solving and Software Engineering
Chapter 2 Primitive Data Types and Operations
Software Development Chapter 1.
Presentation transcript:

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 outside world does not “see” data) Names: use good self documenting names for variables, methods, classes, packages Indentation not required but help readability – also emphasizes structure, not magic can lead to false assumptions (use care and be consistent)

Program Style continued Blank lines – separate methods improve readability New pages (maybe each new class) Optional Comments // /* … */ /** … */ used for documentation JDK

More Style continued Constants Final pi = ; Star = “*”; only have to change one line in program in constant ever changes Method Size no rule but convention about 40 lines (seat of pants rule too long if you start squirming in your seat after trying to follow logic of method)

Classes : one to two pages (no rule convention) Methods: names self documenting Field order: variables public then private Consistency Be consistent (See James Gosling’s libraries) Nested ifs – avoid if complex and difficult to follow logic Nested loops – keep simple, keep logic clear to reader – just because a program runs does not make it good but if it is easy to follow it probably is a good program (or can be easily fixed)

Complexity: better to simplify so readers can understand Documentation: Program specifications Source code – with comments Design information (hierarchy diagrams) Test schedule – results if available Modification history User manual