Lecture 5 - Organizing Programs and Data

Lecture 5 - Organizing Programs and Data -...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Organizing Programs and Data Lecture 5 Hartmut Kaiser hkaiser@cct.lsu.edu http://www.cct.lsu.edu/˜ hkaiser /fall_2011/csc1254.html  
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Abstract We will discuss functions as the main means of  organizing computation. We rework the student  grades example to be more modularized. 9/6/20 11,  Lecture  5 CSC 1254,  Fall 2011,  Organizing  Programs  and Data 2
Background image of page 2
Programming Principle of the Day DRY - Don’t repeat yourself (DIE – Duplication is  Evil) The probably single most fundamental tenet in  programming is to avoid repetition.  Many programming constructs exist solely for that  purpose (e.g. loops, functions, classes, and more).  As soon as you start repeating yourself - create a  new abstraction.  Every piece of knowledge must have a single,  9/6/20 11,  Lecture  5 CSC 1254,  Fall 2011,  Organizing  Programs  and Data 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Programming Principle of the Day I wish I had been taught more about the importance of variable and  method naming in school. About writing code that speaks to the  reader. Code that is clear and concise. Code that solves the problem  in an efficient way but also communicates what it does and why  from the perspective of the user. I wish I had been taught more about how to write components that  could be changed without actually changing that specific code at all.  I wish I had been taught more about polymorphism and  composition. About how to structure applications not with a focus on  reuse but on change. About why abstractions matter. I’ve written and  seen code that is super DRY but that doesn’t contain a single  abstraction and that group things in huge inheritance hierarchies.  Code that is about as flexible and reusable as a sunken ship. 9/6/20 11,  Lecture  5 CSC 1254,  Fall 2011,  Organizing  Programs  and Data 4
Background image of page 4
Building a program Analysis Refine our understanding of the problem Think of the final use of our program Design Create an overall structure for the program Implementation Write code Debug 9/6/20 11,  Lecture  5 CSC 1254,  Fall 2011,  Organizing  Programs  and Data 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Writing a program: Strategy What is the problem to be solved? Is the problem statement clear? Is the problem manageable, given the time, skills,  and tools available? Try breaking it into manageable parts
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/29/2011 for the course CSC 1254 taught by Professor Blanks,l during the Fall '08 term at LSU.

Page1 / 28

Lecture 5 - Organizing Programs and Data -...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online