ITM 352 - © Port, Kazman 1 ITM 352 How to Think Like a Programmer.

Slides:



Advertisements
Similar presentations
How to be a good Programmer
Advertisements

Lecture 4 Basic Scripting. Administrative  Files on the website will be posted in pdf for compatibility  Website is now mirrored at:
Internal Documentation Conventions. Kinds of comments javadoc (“doc”) comments describe the user interface: –What the classes, interfaces, fields and.
Overview Reference parameters Documenting functions A game of craps. Design, code, test and document.
Requirements and Design
Problem Solving and Program Design. COMP104 Problem Solving / Slide 2 Our First Program // a simple program #include using namespace std; int main() {
Chapter 1 Program Design
20 February Detailed Design Implementation. Software Engineering Elaborated Steps Concept Requirements Architecture Design Implementation Unit test Integration.
Chapter 3 Planning Your Solution
BPC.1 Basic Programming Concepts
CMSC 104, Version 8/061L18Functions1.ppt Functions, Part 1 of 4 Topics Using Predefined Functions Programmer-Defined Functions Using Input Parameters Function.
Fundamentals of Python: From First Programs Through Data Structures
Fundamentals of Python: First Programs
Fruitful functions. Return values The built-in functions we have used, such as abs, pow, int, max, and range, have produced results. Calling each of these.
1 Shawlands Academy Higher Computing Software Development Unit.
Simple Program Design Third Edition A Step-by-Step Approach
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
Implementation Considerations Yonglei Tao. Components of Coding Standards 2  File header  file location, version number, author, project, update history.
Microsoft Excel 2007 © Wiley Publishing All Rights Reserved. The L Line The Express Line to Learning L Line.
Programming. What is a Program ? Sets of instructions that get the computer to do something Instructions are translated, eventually, to machine language.
GCSE OCR 3 A451 Computing Professional standards
General Programming Introduction to Computing Science and Programming I.
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
07 Coding Conventions. 2 Demonstrate Developing Local Variables Describe Separating Public and Private Members during Declaration Explore Using System.exit.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 3 Simple.
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
Advanced Computer Science Lab Coding Style & Documentation.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
HTML Table and PHP Array
B065: PROGRAMMING Sub Procedures I. Starter  Identify the separate tasks to be performed in the programming task below (break it down into numbered sections).
CSC 212 – Data Structures Prof. Matthew Hertz WTC 207D /
Python Functions.
The Software Development Process
Javadoc. Purpose of javadoc javadoc is a program that reads your Java program and produces great-looking documentation in HTML format Without any help,
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 6 Functions.
Starting Out with C++ Early Objects ~~ 7 th Edition by Tony Gaddis, Judy Walters, Godfrey Muganda Modified for CMPS 1044 Midwestern State University 6-1.
CSD 340 (Blum)1 Starting JavaScript Homage to the Homage to the Square.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Intermediate 2 Computing Unit 2 - Software Development.
1 Printing in Python Every program needs to do some output This is usually to the screen (shell window) Later we’ll see graphics windows and external files.
WHAT IS THE VALUE OF X? x = 0 for value in [3, 41, 12, 9, 74, 15] : if value < 10 : x = x + value print x.
The Hashemite University Computer Engineering Department
Intro to Loops 1.General Knowledge 2.Two Types of Loops 3.The WHILE loop 1.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Feb 10th, 2009 Introduction to Programming.
Algorithms and Pseudocode
1 UMBC CMSC 104, Section Fall 2002 Functions, Part 1 of 3 Topics Top-down Design The Function Concept Using Predefined Functions Programmer-Defined.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Lecture 4 – Function (Part 1) FTMK, UTeM – Sem /2014.
While loops. Iteration We’ve seen many places where repetition is necessary in a problem. We’ve been using the for loop for that purpose For loops are.
Functions, Part 1 of 3 Topics  Using Predefined Functions  Programmer-Defined Functions  Using Input Parameters  Function Header Comments Reading 
© Peter Andreae Java Programs COMP 102 # T1 Peter Andreae Computer Science Victoria University of Wellington.
CSCI 161 Lecture 3 Martin van Bommel. Operating System Program that acts as interface to other software and the underlying hardware Operating System Utilities.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
CMSC 104, Section 301, Fall Lecture 18, 11/11/02 Functions, Part 1 of 3 Topics Using Predefined Functions Programmer-Defined Functions Using Input.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Functions. What is a Function?  We have already used a few functions. Can you give some examples?  Some functions take a comma-separated list of arguments.
Concepts of Engineering Module 2 Test Review. Review Questions Design problems are broken down into sub- problems because smaller problems must be solved.
ICS 3UI - Introduction to Computer Science
Introduction to Computing Science and Programming I
COSC 1306 COMPUTER SCIENCE AND PROGRAMMING
1. Systems and Software Development
Lecture 2 Introduction to Programming
Chapter 3 Simple Functions
Problem Solving Techniques
Introduction to Classes and Objects
PROGRAMMING Sub Procedures I.
CHAPTER 6: Control Flow Tools (for and while loops)
Presentation transcript:

ITM © Port, Kazman 1 ITM 352 How to Think Like a Programmer

ITM © Port, Kazman 2 Coding Tips and Tricks

ITM © Port, Kazman 3 Coding Advice r Know exactly what you want before starting to code r Have some idea of how to implement what you want before writing code r Start small and evolve gradually m Break down into basic parts, simplify, do one part, test, expand until satisfied r Write comment first explaining what is needed then write code to implement it r Do not write too much code before testing r Make a backup of your program after any substantial amount of effort r Backup only “working” versions, if program gets broken, revert to that last known working version

ITM © Port, Kazman 4 Defensive Programming r Always use meaningful variable and file names r Keep code neat, clean, and easy to read AS YOU GO r Follow code formatting conventions (e.g. indent under if and loop statements) r Anticipate errors! Always expect data may be bad or invalid – test to ensure data is valid when first used. r Add “debugging” statements (e.g. print out important variable values) – comment out when not needed r Think of small validation tests as you go and perform tests – make sure you get what you expect at every step

ITM © Port, Kazman 5 Follow Along Exercise Participation is MANDATORY – you are expected to ask questions and make suggestions!

ITM © Port, Kazman 6 Programming from Concept to Testing r Concept: write a program that prints a 2D “star field” *…*.*…*…* …*…**..*….*.*…*….*.* Basic S teps F or starting a program from scratch: 1. Establish objectives, constraints, and priorities 2. Build simple prototype (esp. UI) 3. Negotiate requirements 4. Analyze information and data needs 5. Design program structure (modules, algorithms, …) 6. Implement designs (code) 7. Test and debug

ITM © Port, Kazman 7 1. Establish Objectives, Constraints, and Priorities Objective 1: Working program that displays stars on screen Objective 2: Some form of user adjustable parameters (e.g. length and height, density, different characters) Constraint 1: Complete in less than 20 mins. Constraint 2: use only PHP and HTML Priorities: - Objective 1 is top, 2 is “if there is time”

ITM © Port, Kazman 8 2. Build a Simple Prototype

ITM © Port, Kazman 9 3. Negotiate Requirements - User interface? - Max / min number of stars? - Density definition?

ITM © Port, Kazman Analyze Information and Data Needs

ITM © Port, Kazman Design Program Structure (Modules, Algorithms, …)

ITM © Port, Kazman Implement Designs (Code)

ITM © Port, Kazman Test and Debug