This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Basic Programming Conventions Readability and Maintainability Lecture 4 ENGR 101 Section 100 Winter 2012 Standard Disclaimer: These lecture notes are provided as a SERVICE to you to help you study for this class. At no time are we obligated to provide notes for every lecture. Understand that these notes are NOT a replacement for either coming to lecture or for the class readings. Indeed, these notes represent only a PARTIAL SET, which means it's up to you to attend class (or to find someone else's notes) to fil in the SUBSTANTIAL fraction of the lecture that has been left out of these notes. Indeed, these notes may represent only a draft and may be based on last term's lectures (which may or may not be repeated in their entirety for this term.) If it turns out that attendance to the class drops below 80%, I reserve the right to reduce the amount of content in these notes. If it turns out that attendance to the class drops below 80%, I also reserve the right to discontinue the distribution of these notes either before or after lecture. Copyright: 2012, Jason M Daida. Al Rights Reserved. Preview Announcements, Q & A In the News Basic Programming Conventions Example Announcements Midterm One (of Three) Open book / open notes / closed calculator Covers the following: Chapters 1 4, with emphasis on 2 and 3 Self-Guided Problems: MATLAB Simple Programs Lab 1 Parts A & B Lectures 1 4 Thursday, 26 January 2012 Regular Time 7 9 PM Announcements Rooms for Midterm One Labs 101, 103, 108 (Cassie): 1003 and 1500 EECS Labs 102, 106, 109 (Dan): 1109 FXB Labs 104, 105, 107 (Taylor): 1504 GGBL Announcements Alternative Time A Midterm One Thursday, 26 January 2012 2246 SRB 8:30 PM 10:30 PM Signup is via Piazza Alternative Time A Midterm One Thursday, 26 January 2012 TBD in SRB 9:30 PM 11:30 PM Signup is via Piazza Announcements Q & A Other? In the news Why it matters The action is a protest against the Stop Online Piracy Act (SOPA) While the goals of SOPA might be commendable, this proposed law is poorly written As a result, there are many unintended (negative) consequences Todays lecture has nothing to do with SOPA, but ! Poorly written code, like poorly written laws, can have unintended consequences This lecture is a step towards writing good code Basic Programming Conventions Use words for variables and function names Indent for hierarchy Limit work done per line Use functions for readability Remove magic numbers Document for maintainability Vet Use l words z for variable & function names Example: What does this function do?...
View Full Document
- Winter '07
- C Programming