Good Programming Practices rules every programmer should know and follow.

Slides:



Advertisements
Similar presentations
Reading and writing reports
Advertisements

VARIABLES AND DEBUGGING Beginning Programming. Assignment Statements  Used to hold values in a variable  Calculates a result and stores it in a variable.
P3, P4, P5, P6.
P5, M1, D1.
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
Chapter 3: Modularization
Chapter 2: Modularization
Programming Logic and Design Fourth Edition, Introductory
JAVA BASICS SYNTAX, ERRORS, AND DEBUGGING. OBJECTIVES FOR THIS UNIT Upon completion of this unit, you should be able to: Explain the Java virtual machine.
Debugging Techniques1. 2 Introduction Bugs How to debug Using of debugger provided by the IDE Exception Handling Techniques.
Lecture Roger Sutton CO331 Visual programming 15: Debugging 1.
Passing Arguments Question Example: IS1102 Exam Autumn 2001.
1 Lecture 1: Course Overview Course: CSE 360 Instructor: Dr. Eric Torng TA: Huamin Chen.
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
Chapter 2: Input, Processing, and Output
How to Debug VB .NET Code.
Using the Visual Basic Editor Visual Basic for Applications 1.
Modules, Hierarchy Charts, and Documentation
JavaScript, Fourth Edition
Testing a program Remove syntax and link errors: Look at compiler comments where errors occurred and check program around these lines Run time errors:
PRE-PROGRAMMING PHASE
Exploring Microsoft Excel 2002 Chapter 8 Chapter 8 Automating Repetitive Tasks: Macros and Visual Basic for Applications By Robert T. Grauer Maryann Barber.
CH07: Writing the Programs Does not teach you how to program, but point out some software engineering practices that you should should keep in mind as.
Unit 16 Procedural Programming
Bret Juliano. Introduction What Documentation is Required? – To use a program – To believe a program – To modify a program The Flow-Chart Curse Self-Documenting.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
Programming Logic and Design Sixth Edition Chapter 2 Working with Data, Creating Modules, and Designing High-Quality Programs.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 11 1 Microsoft Office Access 2003 Tutorial 11 – Using and Writing Visual Basic for Applications.
King Fahd University of Petroleum & Minerals Department of Management and Marketing MKT 345 Marketing Research Dr. Alhassan G. Abdul-Muhmin Editing and.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 6 Functions.
Subprograms CE 311 K - Introduction to Computer Methods Daene C. McKinney.
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
23-Oct-15 Abstract Data Types. 2 Data types A data type is characterized by: a set of values a data representation, which is common to all these values,
Functions, Procedures, and Abstraction Dr. José M. Reyes Álamo.
I Power Higher Computing Software Development Development Languages and Environments.
Covenant College November 27, Laura Broussard, Ph.D. Professor COS 131: Computing for Engineers Chapter 5: Functions.
Week 14 Introduction to Computer Science and Object-Oriented Programming COMP 111 George Basham.
IBM-Mainframes COBOL Class-1. Background and History  COBOL is an acronym for: Common Business Oriented Language  COBOL was developed in 1959 by the.
Protocols Software Engineering II Wirfs Brock et al, Designing Object-Oriented Software, Prentice Hall, Mitchell, R., and McKim, Design by Contract,
Page 1 – Autumn 2009Steffen Vissing Andersen SDJ I1, Autumn 2009 Agenda: Java API Documentation Code Documenting (in javadoc format) Debugging.
M4 BTEC Level 3 Subsidiary Diploma in ICT. Technical Documentation The technical documentation may be a section in the user documentation or could be.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
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.
5.01 Understand Different Types of Programming Errors
Copyright Ó Oracle Corporation, All rights reserved Debugging Triggers.
Oracle9i Developer: PL/SQL Programming Chapter 5 Functions.
Chapter 7 What’s Wrong with It? (Syntax and Logic Errors) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Introduction to Law Elements of an Office Memorandum.
Interface specifications At the core of each Larch interface language is a model of the state manipulated by the associated programming language. Each.
 Problem Analysis  Coding  Debugging  Testing.
Sub Procedures and Functions Visual Basic. Sub Procedures Slide 2 of 26 Topic & Structure of the lesson Introduction to Modular Design Concepts Write.
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
More Sophisticated Behavior
Computer Programming (BCT 1113)
Chapter 2: Input, Processing, and Output
Chapter 2- Visual Basic Schneider
Software Design and Development
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.
TRANSLATORS AND IDEs Key Revision Points.
Unit# 9: Computer Program Development
Problem Solving Techniques
Functions, Procedures, and Abstraction
Tonga Institute of Higher Education
Chapter 2- Visual Basic Schneider
Chapter 2: Input, Processing, and Output
Good programming practices
Functions, Procedures, and Abstraction
Presentation transcript:

Good Programming Practices rules every programmer should know and follow.

Documentation Comment your code such that it is clear what you code does You should be able to figure out your code years after it’s written A good programmer should be able to figure out what your code does from your comments. Scheme comments start with ; ;this is a comment ;this is another comment

Documenting a procedure Include: 1.A description of what the procedure does 2.Type of arguments -> type of return value 3.Constraints that need to be satisfied by arguments (requires clause) 4.Expected state of computation at key states You should also include notes on what a particular chunk of code does if it may be confusing to a reader.

Documenting a procedure Example:

Documenting an ADT Whenever you make an ADT, you should include some comments giving an overview of the ADT You should describe each sub-unit of the ADT, including the type of the sub- unit

Documenting an ADT Example:

Debugging: Using Test Cases Whenever you make a procedure, you should write tests for it. –Test the procedure on limits of legal values –Test the procedure with arguments that span legal values –Include a comment with each test case indicating what you are testing

Debugging: Useful techniques Sometimes, you can use display or print to print out values of your variables at key stages of computation Useful for isolating problem spots In Dr. Scheme, debugger is useful for checking values of variable in the middle of a computation.