Self-Expressive Code. A handbook of write readable code. Stephen Wang. This book is for sale at

Size: px
Start display at page:

Download "Self-Expressive Code. A handbook of write readable code. Stephen Wang. This book is for sale at"

Transcription

1

2 Self-Expressive Code A handbook of write readable code. Stephen Wang This book is for sale at This version was published on This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many iterations to get reader feedback, pivot until you have the right book and build traction once you do Stephen Wang

3 Tweet This Book! Please help Stephen Wang by spreading the word about this book on Twitter! The suggested hashtag for this book is #Software Programming, Code Readability. Find out what other people are saying about the book by clicking on this link to search for this hashtag on Twitter: Programming, Code Readability

4 Contents Introduction Acknowledgement What Is Self-Expressive Code Part I Readability Chapter 1 Annoyance of Lower Readability Annoying Bugs Hard To Understand Hard To Change Or Extend Easy To Make Bugs In Hard To Refactor Further Reading

5 Introduction When we are writing programming code, readability issues happen. People often face some hard to read source codes. What kind of codes are lower readability? What caused this happen? How to solve these issues? All the above questions are big. Restricted by the programming language, codes can be written in predefined ways. People might think it is not possible to write source code as certain language. That s true. We could not write certain language, then let computer analyze the commands and run properly, but we can write source code as certain language as we can. Programming language provides some useful symbols allow programmers to write source code easy to understand. Some issues caused by English, some non-native speakers have smaller vocabulary set, they tend to use simple words only to express what they want to do. However, even for native speakers, they can give good names to classes, methods or variables, but when call these classes, methods, variables, problems also appear. That means, code readability is no only depend on the names, but also depend on how it will be called. Plus, the algorithm, the structure, the architecture will affect the readability of codes. Improve code s readability is not so easy. In this book, I would like to introduce a new way to write source code - Self-Expressive Code. As implied in its name, Self-Expressive Code means, the code itself can express what it will do. Programmers can understand the meaning of source code faster and easier. Self-Expressive Code is chasing for the way to write source code that could be understood at a glance. Java is still popular and influential. This book picked Java as its sample language.

6 Acknowledgement There is a list who helped editing this book. Michael Chen Liu Chengzhang Han Kuikui Thank my family, without their support, this book could not be published. The first edition of this book is published in Chinese on paper. The initial intention for this book is for help non-english speakers write more readable codes. Michael has reviewed the first edition and provided some useful suggestions. He also provided many useful ideas for the second edition. This is the second edition, chapters are re-organized, samples are revised. I hope this book can benefit programmers across the world, not only non-english speakers. This book referred the following books: Design Patterns:Elements of Reusable Object-Oriented Software¹, Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides ISBN: Refactoring², Martin Folwer Clean Code³, Robert Martin The Art of Readable Code (Theory in Practice)⁴, Dustin Boswell, Trevor Foucher ¹ ² ³CleanCode:AHandbookofAgileSoftwareCraftsmanship ⁴

7 What Is Self-Expressive Code In assembly language, codes are written for machines, people can hard to read source code and guess its meaning. After decades, programming languages become more and more easy to read. Shortly, codes are written for people. However, in the real world, we could hard to read many codes in C# or Java, even certain words are used to name objects in programming. In a opened source famous platform, one module contains a bunch of lower readable codes. After read that code, it seems the authors of the codes tend to write source code for machines, not for people. We cannot know the real reason, but we could analyze the source code. The source code has: 1. if-else conditions that do not evaluate same object. 2. non-english names. 3. long branches/methods. 4. many duplications/similarities. Those above features show that the programmer were not pay enough attention about the reader s feeling. This third party company shared their source code on that famous platform for brand image or something. Unfortunately, the source code just leads to the opposite way. After read that code I started to worry about the quality of their health care products. Hope they have different process to make the products quality higher. So, what is good way to write readable source code? For instance, in a game application, player can control a hero to fight the enemy in a scene. The code could seem like: 1 scene.fight(hero, enemy, Kongfu.FIST); In the code above, readers cannot understand the fight direction between hero and enemy. An revised version could seem like: 1 hero.fight(enemy, Kongfu.FIST); For the restriction of programming language, constant should have its class name. The meaning of this code is clear, but the code still seems like to be a machine language, not human language. Then the ace version is appear:

8 What Is Self-Expressive Code 4 1 hero.fight(enemy).with("fist"); The fight() method returns a Fight object that has with() method. The with() method passed by a Kongfu name that allows a KongfuFactory to create a Kongfu object and calculate the damage. This process makes more classes, but it also make the source code more readable. Implement functionality is the basic responsibility of source code, but keep it readable, extensible, changeable are also important. As mentioned in the head of this section, codes are written for people. I suggest to write source code as certain language as possible. I named that method Self-Expressive Code. Before the word Self-Expressive Code appear in the world, there are two similar words: Self- Documenting Code⁵ and Self-Describing Code⁶ already existed. They might have the same meaning, but I think the word expressive is more expressive, so I named this way of writing code as Self- Expressive Code. ⁵ ⁶

9 Part I Readability Chapter 1 Annoyance of Lower Readability When programmers read others code, they would have feelings about the code. Just like users access a website. If website makes user unsatisfied, user will go away. If the code is not good for read, what would the reader do? The most frequently occurred thing might be spitting out dirty words. The worst thing is that after spit out, the reader noticed that the source were written by himself/herself. Apparently, lower readable codes make programmers unsatisfied. Lower readable codes may be a:

10 Part I Readability 6 1. Mouse Wheel Tester Long file, long method, long branch, those force readers to roll their mouse wheel continuously. The source code, in other side, is a mouse wheel tester. 2. Eye Tester Similar codes make user confused about the nuances. Similar codes force user to look inside with caution. 3. Memory Tester Name variables as a, b, c or count1, count2 to force readers remember meaning of these variables. 4. Patience Tester Long names hide the key information that forces user stop and think. Unformatted source make user to keep big patience to read. Deep nested source makes reader think the relationship harder. or, it may have such features: 1. Names Make No Sense Method names like : doprocess, invokemethod, executeservice. Variable names like : returnvalue, tempvalue, list, result. 2. Dialects Using other languages other than English, makes other readers totally have no idea about the names. Even they share the same language. YouYu in Chinese have at least eight possible meanings. ikou in Japanese have at least four possible meanings. 3. Made Up Words Using ambiguous words that misguide readers, such as float DBL. That leads readers to think DBL is the abbreviation of double. 4. Quiz Using complicated expressions to make things more complex. Lower readability also makes code hard to change, hard to extend, hard to fix bugs. Lower readability codes share one feature - forces readers stop and think, that causes lower productivity, lower quality.

11 Part I Readability Annoying Bugs Programmers are inevitable to face bugs. If it is easy to be fixed, programmers might not hate bugs too much. In the real world, however, bugs are hard to be reproduced, hard to be traced, hard to be fixed, or easy to degrade. Not reproducible One possible reason is that there are too many factors to make it happens again. And these factors are existing in the source code, but not in the business process. This reflects the code appended inner factors, and if possible, eliminate them to make bugs reproducible. Not traceable One possible reason is that the bug caused by one complicated line code. If user got an NullPointerException at the following code. Which is the root cause of the problem? 1 product.setupdater(user.getfullname()); Another possible reason is that the bug were produced by mis-use of third party framework. For example, Spring framework allows user to configure their xml to run system, but it is not easy to find if xml has mistake. Third possible reason is that the error message does not indicate the real reason. For example, Ebean allows user to access db easier. If the server name of Ebean is not set properly, User would get a message of NullPointerException. and user could not easily to solve this problem without reading the source code of Ebean. Not Fixable Degrade After tried so hard, programmer found the reason of the source code, but cannot fix that bug. Because it is a very influential place. If it changes, too much tests are required, but time is limited. After fixed the bug, it works. Unfortunately, another bug appears according to this fix. All those above annoyance occur frequently with lower readable codes.

12 Part I Readability Hard To Understand Negatives When a new programmer joined to a team, he/she needs to read source code before touch it. If the source code has lower readability, it takes long time to understand. Until the new programmer understood the source code, he/she could do nothing about fix bugs or apply changes. This also works for job transfer from a member to another. It depends on the readability, if the codes are easy to read, the time be taken is shorter, otherwise, longer time needed. There is a list that frequently happened in lower readable codes. Negative words contain a NOT information, if put negative variable into a conditional statement, it just like a quiz : not of not is positive. If it happens to be a non-adjective variable, the code becomes harder to read. 1 if ((hardkeyboardhidden == 1) == false) Circular Reference If object A contains an object B, and object B for some reasons needs reference from object A, the two objects have a circular reference, just like below: 1 class Container { 2 Context context; 3 Product product; 4 } 1 class Proudct { 2 //This is for calling of 'container.context' 3 Container container; 4 } In this case, container.product.container.product would be a strange object. In fact this is caused by wrong ownership. Diverse Meanings If a local variable in a method have diverse meanings, readers could not easily check the meaning of the variable at a line. The variable flag in the following code is hard to understand.

13 Part I Readability 9 1 public String registerlesson(long userid, long lessonid) { 2 int flag = 0; 3 4 flag = checkuserexist(userid); 5 6 if (flag == 0) { 7 return "User does not exist."; 8 } 9 10 flag = checklessonexist(lessonid); if (flag == 0) { 13 return "Lesson does not exist."; 14 } return ""; 17 } Diverse Branches Branches may have conditions, but the conditions should have same meaning, different values. If two connected branches have different conditions, it makes no sense. 1 public void method(int flag, String name) { 2 if (flag == 0) { 3 //process 1; 4 } else if (name.equals("abc")) { 5 //process 2; 6 } 7 } Ambiguous Names If the name of a method can not show its meaning, reader should read every and each line of its implementation to determine its real functionality. That takes time. The following is a sample of ambiguous name.

14 Part I Readability 10 1 public class Keyboard { 2 //Pressed the 'alt' key or alter to another keyboard layout? 3 public void alt() { 4 } 5 } Non-Match Documents Many maintenance engineers are confusing about that the source code have nor creditable documents, neither comments, which means the code is the only document. Unfortunately, most of these time, the source code is not readable too. 1.3 Hard To Change Or Extend Software changes. If a requirement change comes, how much time will be taken? The higher the changeability is, the shorter the time is needed. Changeability A widget⁷ place module in a system have magnet effects for widgets. That algorithm is changed frequently because widget have many sizes. But the code is hard to be changed, because the move method is too complicated: 1 private Widget[] widgets; 2 3 private int focus; 4 5 public void move(int dir) { 6 if (dir == 1) {// move right 7 if (widgets[focus].width == 1) { 8 int next = 0; 9 next = findnext(); 10 if (widgets[next].height == 2) { 11 if (widgets[next].y == widgets[focus].y) { 12 //omitted 13 } 14 //..omitted. 15 } else if (widgets[next].height == 3) { 16 if (widgets[next].y == widgets[focus].y) { ⁷

15 Part I Readability //omitted 18 } 19 //..omitted. 20 } 21 } 22 } else (dir == -1) { //move left 23 //omitted 24 } 25 } In this complicated algorithm, programmer try to enumerate every possibility about moving widget. Any new possibility will extend the method. The final version of source is very terrible, and messed up. Even a small change to this algorithm will cause big modification. Extensibility An input method system on android platform is required to have new input device : remote control and game pad. Below is the skeleton of the implemented codes: 1 public class Keyboard { 2 public boolean onkeydown(int keycode, KeyEvent event) { 3 if (hardkeyboardconnected == 0) { 4 //treat with soft keyboard 5 } else { 6 //treat with hard keyboard 7 if (keycode >= KeyEvent.KEYCODE_A 8 && keycode <= KeyEvent.KEYCODE_Z) { 9 } else if (keycode == KeyEvent.KEYCODE_ENTER) { 10 } else if (keycode == KeyEvent.KEYCODE_SPACE) { 11 } else if (keycode == KeyEvent.KEYCODE_SHIFT) { 12 } 13 } 14 } 15 } When add device like remote control and game pad, because it is not detectable for android system, like a physical keyboard plugged in. The code becomes:

16 Part I Readability 12 1 public class Keyboard { 2 public boolean onkeydown(int keycode, KeyEvent event) { 3 if (hardkeyboardconnected == 0) { 4 //treat with soft keyboard 5 } else { 6 //treat with hard keyboard 7 if (keycode >= KeyEvent.KEYCODE_A 8 && keycode <= KeyEvent.KEYCODE_Z) { 9 } else if (keycode == KeyEvent.KEYCODE_ENTER) { 10 } else if (keycode == KeyEvent.KEYCODE_SPACE) { 11 } else if (keycode == KeyEvent.KEYCODE_SHIFT) { 12 } else if (keycode >= KeyEvent.KEYCODE_BUTTON_1 13 && keycode <= KeyEvent.KEYCODE_BUTTON_10) { //for remote control 14 } else if (keycode >= KeyEvent.KEYCODE_BUTTON_A 15 && keycode <= KeyEvent.KEYCODE_BUTTON_C) { //for game pad 16 } else if (keycode >= KeyEvent.KEYCODE_BUTTON_X 17 && keycode <= KeyEvent.KEYCODE_BUTTON_Z) { //for game pad 18 } 19 } 20 } 21 } If follow this trend to modify source code, the source code will be very fatty and buggy. All of the above system has lower readability. 1.4 Easy To Make Bugs In. Not Match It may cause bug when call a one method that declared one behavior, but actually did two. 1 public void update() { 2 reloaddata(); 3 savefile(); 4 } Duplications/Similarities It may cause bug in case that should call method A, but called a similar method B.

17 Part I Readability 13 1 public void clear() { 2 //remove all elements 3 } 1 public void clean() { 2 //remove all dump data. 3 } Ambiguous It is confused when trying to call a method with ambiguous name and implementation. 1 public int[] countdifferentseries(int[][] baskettwodarray) { 2 int count = 0; 3 //omitted. 4 return differentseriescount; 5 } This method start with count, but returns an array. It is not easy to understand the meaning of this code in short. If want to count each item in the array, how about to calculate separately in a loop? Complicated Deeper nested codes makes code hard to read, hard to understand. 1 private Widget[] widgets; 2 3 private int focus; 4 5 public void move(int dir) { 6 if (dir == 1) {// move right 7 if (widgets[focus].width == 1) { 8 int next = 0; 9 next = findnext(); 10 if (widgets[next].height == 2) { 11 if (widgets[next].y == widgets[focus].y) { 12 //omitted

18 Part I Readability } 14 //..omitted. 15 } else if (widgets[next].height == 3) { 16 if (widgets[next].y == widgets[focus].y) { 17 //omitted 18 } 19 //..omitted. 20 } 21 } 22 } else (dir == -1) { //move left 23 //omitted 24 } 25 } When touch this code, it is very easy to make bugs in. 1.5 Hard To Refactor Inconsistent Style Many programmers do not care about the style of source code. In their editor both of below exist. 1 a=a+1; 1 a = a + 1; In this case, if reader want to search something, they do not know which pattern should they use. They have to add additional information into the search box - Make it regular expression. Also, the mixed style exist together makes new joined programmers confused - What rule should I follow if I want to change the source code. Inconsistent Words Not only the coding style, if the terms or words are not inconsistent in one system, readers will also be confused.

19 Part I Readability 15 In one file, save means insert, but in another file, save means update, so why not use insert and update to avoid this? Inconsistent Process Besides, in a system, treat similar objects in different ways may take extra time to understand the difference. In a input method system, typed alphabet will be transferred to certain characters according to the selected transfer rules. The following code shows the design simply. 1 public interface TransferEngine { 2 public List<String> transfer(); 3 } 1 public class InputMethodService { 2 public List<String> transfer() { 3 String text = gettypedalphabets(); 4 TransferEngine engine = getselectedtransferengine(); 5 List<String> candidates = engine.transfer(text); 6 return candidates; 7 } 8 } If added one rule, it should be a implementation of TransferEngine, 1 public class HiraganaEngine implements TransferEngine { 2 public List<String> transfer(string text) { 3 //... 4 } 5 } However, the author changed code as follows:

20 Part I Readability 16 1 public class InputMethodService { 2 3 public List<String> transfer() { 4 String text = gettypedalphabets(); 5 TransferEngine engine = getselectedtransferengine(); 6 7 List<String> candidates = null 8 9 if (engine instanceof SymbolEngine) { 10 candidates = new ArrayList<String>(); 11 candidates.add(text); 12 return candidates; 13 } candidates = engine.transfer(text); 16 return candidates; 17 } 18 }

21 Further Reading Chapter 2. What Makes Readability Lower 2.1 English Skills 2.2 Programming Language Grammar 2.3 Naming 2.4 Architecture 2.5 Structure 2.6 Comment 2.7 Style 2.8 Restrictive Rules Chapter 3. An Unreadable Experience 3.1 Usage Of Words 3.2 Style 3.3 Algorithm 3.4 Revise Part II Improvement Chapter 4. Use English Properly 4.1 Frequently Found Mistakes 4.2 Prefix, Suffix 4.3 Pair Words 4.4 Abbreviation 4.5 Word Class 4.6 Grammar 4.7 Tense 4.8 Negatives Chapter 5. Use Programming Language Features > 5.1 Annotation > 5.2 Exception > 5.3 Reflect > 5.4 Generic > 5.5 Lambda Expression Chapter 6. Naming Improvement 6.1 Package 6.2 Interface 6.3 Class 6.4 Enumeration 6.5 Annotation 6.6 Method 6.7 Variable 6.8 Constant 6.9 Similarities 6.10 Keywords 6.11 Other Improvements Chapter 7. Architectural Improvement 7.1 Task Split 7.2 Inner Classes, Interfaces and Enumerations 7.3 Anonymous Class 7.4 Relationship 7.5 Limited Values 7.6 Avoid Class Explosion 7.7 Abstraction 7.8 Responsibility Chapter 8. Structural Improvement

22 Further Reading Shorten Long Method 8.2 Reduce Parameter Count 8.3 Reduce Nested Depth 8.4 Eliminate Duplications/Similarities 8.5 Decouple 8.6 Reduce Influence of Multi-Factors 8.7 Avoid Class Cast 8.8 Shorten Long Conditions 8.9 Eliminate Useless Codes 8.10 Remove Temporary Variables Chapter 9. Commentary Improvement 9.1 Java Doc 9.2 FIXME, TODO, XXX 9.3 Copyright 9.4 Class Explanation 9.5 Method Comment 9.6 Process Comment 9.7 Comment Out Source Code Chapter 10. Stylistic Improvement 10.1 Indent 10.2 Alignment 10.3 Space 10.4 Code Region 10.5 Line Length and Tab 10.6 New Line 10.7 Braces, Brackets and Parentheses 10.8 Code Region Chapter 11. Scriptic Improvement 11.1 Object Oriented JavaScript 11.2 HTML 11.3 JSP 11.4 SQL 11.5 OS Script Chapter 12. Configurational Improvement 12.1 XML 12.2 JSON 12.3 Properties 12.4 Yaml 12.5 CSS Chapter 13. Symbolic Improvement 13.1 Period 13.2 Logical Operators 13.3 Computing Operators 13.4 Quotations 13.5 String Parameters Chapter 14. Algorithmic Improvement 14.1 Recursion 14.2 Replace List With Map 14.3 Replace Index With List 14.4 Apply Domain Specific Language 14.5 Apply Dynamic Design Patterns Chapter 15. Readability Of Test Code 15.1 Assertion 15.2 Test Case 15.3 Test Fixture 15.4 Stability Of Test Codes Chapter 16. Other Improvements

23 Further Reading URL Log 16.6 Part III Exploring Chapter 17. Code Generator 17.1 Problems Of Code Generator 17.2 Layout Editor 17.3 Dynamic Codes Chapter 18. Help From IDE 18.1 Auto-Formatter 18.2 Spell-Checker 18.3 Style-Checker 18.4 Auto-Complete Chapter 19. Code Review 19.1 Machine s Work 19.2 Quick Read

24 Further Reading S To Codes 19.4 Looks Good 19.5 Convention 19.6 Misunderstanding Chapter 20. Readability Improving of Legacy Code 20.1 Make Sure Test Code Exist 20.2 Apply Tools 20.3 Small Improvement 20.4 Entire Improvement 20.5 Rewrite Chapter 21. Evolutionary Design 21.1 Keep Readability From Line Keep Clean 21.3 Just Enough 21.4 Think How It Would Be Called 21.5 Use Third Party Libraries 21.6 Be Habit 21.7 Time To Test Chapter 22. A Journey To Improving Readability 22.1 Create Android IME Service 22.2 Layout 22.3 Input Device 22.4 Process Button(Input) 22.5 Process Button(Operation) 22.6 Control Input(Touch Screen)

Kotlin for Android Developers

Kotlin for Android Developers Kotlin for Android Developers Learn Kotlin the easy way while developing an Android App Antonio Leiva This book is for sale at http://leanpub.com/kotlin-for-android-developers This version was published

More information

Game keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen

Game keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen Computer Programming Computers can t do anything without being told what to do. To make the computer do something useful, you must give it instructions. You can give a computer instructions in two ways:

More information

Kotlin for Android Developers

Kotlin for Android Developers Kotlin for Android Developers Learn Kotlin the easy way while developing an Android App Antonio Leiva This book is for sale at http://leanpub.com/kotlin-for-android-developers This version was published

More information

Designing with OpenSCAD

Designing with OpenSCAD Designing with OpenSCAD A Young Lady s First Enchiridion Wil Chung Designing with OpenSCAD A Young Lady s First Enchiridion Wil Chung This book is for sale at http://leanpub.com/designing_with_openscad

More information

Git Workbook. Self-Study Guide to Git. Lorna Mitchell. This book is for sale at

Git Workbook. Self-Study Guide to Git. Lorna Mitchell. This book is for sale at Git Workbook Self-Study Guide to Git Lorna Mitchell This book is for sale at http://leanpub.com/gitworkbook This version was published on 2018-01-15 This is a Leanpub book. Leanpub empowers authors and

More information

Dynamic Design Patterns

Dynamic Design Patterns Dynamic Design Patterns Adaptive Design in Uncertain Diverse Environment Stephen Wang This book is for sale at http://leanpub.com/dynamic_design_patterns This version was published on 2013-08-22 This is

More information

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming Intro to Programming Unit 7 Intro to Programming 1 What is Programming? 1. Programming Languages 2. Markup vs. Programming 1. Introduction 2. Print Statement 3. Strings 4. Types and Values 5. Math Externals

More information

CSCI 2101 Java Style Guide

CSCI 2101 Java Style Guide CSCI 2101 Java Style Guide Fall 2017 This document describes the required style guidelines for writing Java code in CSCI 2101. Guidelines are provided for four areas of style: identifiers, indentation,

More information

The compiler is spewing error messages.

The compiler is spewing error messages. Appendix B Debugging There are a few different kinds of errors that can occur in a program, and it is useful to distinguish between them in order to track them down more quickly. Compile-time errors are

More information

FROM 4D WRITE TO 4D WRITE PRO INTRODUCTION. Presented by: Achim W. Peschke

FROM 4D WRITE TO 4D WRITE PRO INTRODUCTION. Presented by: Achim W. Peschke 4 D S U M M I T 2 0 1 8 FROM 4D WRITE TO 4D WRITE PRO Presented by: Achim W. Peschke INTRODUCTION In this session we will talk to you about the new 4D Write Pro. I think in between everyone knows what

More information

Liquibase Version Control For Your Schema. Nathan Voxland April 3,

Liquibase Version Control For Your Schema. Nathan Voxland April 3, Liquibase Version Control For Your Schema Nathan Voxland April 3, 2014 nathan@liquibase.org @nvoxland Agenda 2 Why Liquibase Standard Usage Tips and Tricks Q&A Why Liquibase? 3 You would never develop

More information

Alphabetical Index referenced by section numbers for PUNCTUATION FOR FICTION WRITERS by Rick Taubold, PhD and Scott Gamboe

Alphabetical Index referenced by section numbers for PUNCTUATION FOR FICTION WRITERS by Rick Taubold, PhD and Scott Gamboe Alphabetical Index referenced by section numbers for PUNCTUATION FOR FICTION WRITERS by Rick Taubold, PhD and Scott Gamboe?! 4.7 Abbreviations 4.1.2, 4.1.3 Abbreviations, plurals of 7.8.1 Accented letters

More information

Control Flow. COMS W1007 Introduction to Computer Science. Christopher Conway 3 June 2003

Control Flow. COMS W1007 Introduction to Computer Science. Christopher Conway 3 June 2003 Control Flow COMS W1007 Introduction to Computer Science Christopher Conway 3 June 2003 Overflow from Last Time: Why Types? Assembly code is typeless. You can take any 32 bits in memory, say this is an

More information

Intro. Scheme Basics. scm> 5 5. scm>

Intro. Scheme Basics. scm> 5 5. scm> Intro Let s take some time to talk about LISP. It stands for LISt Processing a way of coding using only lists! It sounds pretty radical, and it is. There are lots of cool things to know about LISP; if

More information

Beginning Style. 16-Nov-15

Beginning Style. 16-Nov-15 Beginning Style 16-Nov-15 Be consistent! Most times, you will enter an ongoing project, with established style rules Follow them even if you don t like them In this course you will be working in teams

More information

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal Lesson Goals Understand the basic constructs of a Java Program Understand how to use basic identifiers Understand simple Java data types

More information

Write for your audience

Write for your audience Comments Write for your audience Program documentation is for programmers, not end users There are two groups of programmers, and they need different kinds of documentation Some programmers need to use

More information

6.170 Laboratory in Software Engineering Java Style Guide. Overview. Descriptive names. Consistent indentation and spacing. Page 1 of 5.

6.170 Laboratory in Software Engineering Java Style Guide. Overview. Descriptive names. Consistent indentation and spacing. Page 1 of 5. Page 1 of 5 6.170 Laboratory in Software Engineering Java Style Guide Contents: Overview Descriptive names Consistent indentation and spacing Informative comments Commenting code TODO comments 6.170 Javadocs

More information

Cocoa Design Patterns. Erik M. Buck October 17, 2009

Cocoa Design Patterns. Erik M. Buck October 17, 2009 Cocoa Design Patterns Erik M. Buck October 17, 2009 Topics n What is a design pattern? n Why Focus on design patterns? n What is the Model View Controller design pattern? n Using MVC n When wouldn t you

More information

Crash course on Reporting Bugs

Crash course on Reporting Bugs Page 1 of 5 Crash course on Reporting Bugs Santhosh Tuppad Test Enthusiast http://tuppad.com Santhosh@testersblog.com Pradeep Soundararajan Test Consultant, Coach, Author and Speaker http://testertested.blogspot.com

More information

Functional Programming in Ruby

Functional Programming in Ruby Functional Programming in Ruby Coding with Style koen handekyn This book is for sale at http://leanpub.com/functionalprogramminginruby This version was published on 2014-04-17 This is a Leanpub book. Leanpub

More information

Text Input and Conditionals

Text Input and Conditionals Text Input and Conditionals Text Input Many programs allow the user to enter information, like a username and password. Python makes taking input from the user seamless with a single line of code: input()

More information

Programming for Kids

Programming for Kids Programming for Kids Peter Armstrong This book is for sale at http://leanpub.com/programmingforkids This version was published on 2016-05-08 This is a Leanpub book. Leanpub empowers authors and publishers

More information

A Primer on Design Patterns

A Primer on Design Patterns A Primer on Design Patterns First Edition Rahul Batra This book is for sale at http://leanpub.com/aprimerondesignpatterns This version was published on 2016-03-23 This is a Leanpub book. Leanpub empowers

More information

Good Coding Practices Spring 2018

Good Coding Practices Spring 2018 CS18 Integrated Introduction to Computer Science Fisler, Nelson Contents Good Coding Practices Spring 2018 1 Introduction 1 2 The Don ts 1 3 The Dos 4 4 CS 18-Specific Practices 5 5 Style 6 1 Introduction

More information

IT Web and Software Developer Software Development Standards

IT Web and Software Developer Software Development Standards IT Web and Software Developer Software Development Standards Definition of terms Identifier An identifier is the name you give variables, methods, classes, packages, interfaces and named constants. Pascal

More information

CS106A, Stanford Handout #30. Coding Style

CS106A, Stanford Handout #30. Coding Style CS106A, Stanford Handout #30 Fall, 2004-05 Nick Parlante Coding Style When writing paper, you can have well-crafted, correctly spelled sentences and create "A" work. Or you can hack out the text in a hurry.

More information

QUIZ Friends class Y;

QUIZ Friends class Y; QUIZ Friends class Y; Is a forward declaration neeed here? QUIZ Friends QUIZ Friends - CONCLUSION Forward (a.k.a. incomplete) declarations are needed only when we declare member functions as friends. They

More information

The Little Mongo DB Schema Design Book

The Little Mongo DB Schema Design Book The Little Mongo DB Schema Design Book Christian Kvalheim This book is for sale at http://leanpub.com/mongodbschemadesign This version was published on 2015-10-09 ISBN 978-1-943846-77-1 This is a Leanpub

More information

Analysis of the Test Driven Development by Example

Analysis of the Test Driven Development by Example Computer Science and Applications 1 (2013) 5-13 Aleksandar Bulajic and Radoslav Stojic The Faculty of Information Technology, Metropolitan University, Belgrade, 11000, Serbia Received: June 18, 2013 /

More information

The first program: Little Crab

The first program: Little Crab Chapter 2 The first program: Little Crab topics: concepts: writing code: movement, turning, reacting to the screen edges source code, method call, parameter, sequence, if-statement In the previous chapter,

More information

CS 142 Style Guide Grading and Details

CS 142 Style Guide Grading and Details CS 142 Style Guide Grading and Details In the English language, there are many different ways to convey a message or idea: some ways are acceptable, whereas others are not. Similarly, there are acceptable

More information

This chapter is intended to take you through the basic steps of using the Visual Basic

This chapter is intended to take you through the basic steps of using the Visual Basic CHAPTER 1 The Basics This chapter is intended to take you through the basic steps of using the Visual Basic Editor window and writing a simple piece of VBA code. It will show you how to use the Visual

More information

Index. Index. More information. block statements 66 y 107 Boolean 107 break 55, 68 built-in types 107

Index. Index. More information. block statements 66 y 107 Boolean 107 break 55, 68 built-in types 107 A abbreviations 17 abstract class 105 abstract data types 105 abstract method 105 abstract types 105 abstraction 92, 105 access level 37 package 114 private 115 protected 115 public 115 accessors 24, 105

More information

WEB ANALYTICS A REPORTING APPROACH

WEB ANALYTICS A REPORTING APPROACH WEB ANALYTICS A REPORTING APPROACH By Robert Blakeley, Product Manager WebMD A web analytics program consists of many elements. One of the important elements in the process is the reporting. This step

More information

Create-A-Page Design Documentation

Create-A-Page Design Documentation Create-A-Page Design Documentation Group 9 C r e a t e - A - P a g e This document contains a description of all development tools utilized by Create-A-Page, as well as sequence diagrams, the entity-relationship

More information

Technical Writing. Professional Communications

Technical Writing. Professional Communications Technical Writing Professional Communications Overview Plan the document Write a draft Have someone review the draft Improve the document based on the review Plan, conduct, and evaluate a usability test

More information

Programming for Beginners

Programming for Beginners Programming for Beginners Learn to Code by Making Little Games Tom Dalling This book is for sale at http://leanpub.com/programming-for-beginners This version was published on 2018-02-23 This is a Leanpub

More information

Rule 1-3: Use white space to break a function into paragraphs. Rule 1-5: Avoid very long statements. Use multiple shorter statements instead.

Rule 1-3: Use white space to break a function into paragraphs. Rule 1-5: Avoid very long statements. Use multiple shorter statements instead. Chapter 9: Rules Chapter 1:Style and Program Organization Rule 1-1: Organize programs for readability, just as you would expect an author to organize a book. Rule 1-2: Divide each module up into a public

More information

THINGS YOU NEED TO KNOW ABOUT USER DOCUMENTATION DOCUMENTATION BEST PRACTICES

THINGS YOU NEED TO KNOW ABOUT USER DOCUMENTATION DOCUMENTATION BEST PRACTICES 5 THINGS YOU NEED TO KNOW ABOUT USER DOCUMENTATION DOCUMENTATION BEST PRACTICES THIS E-BOOK IS DIVIDED INTO 5 PARTS: 1. WHY YOU NEED TO KNOW YOUR READER 2. A USER MANUAL OR A USER GUIDE WHAT S THE DIFFERENCE?

More information

Decisions, Decisions. Testing, testing C H A P T E R 7

Decisions, Decisions. Testing, testing C H A P T E R 7 C H A P T E R 7 In the first few chapters, we saw some of the basic building blocks of a program. We can now make a program with input, processing, and output. We can even make our input and output a little

More information

VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0. L J Howell UX Software Ver. 1.0

VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0. L J Howell UX Software Ver. 1.0 VISUAL GUIDE to RX Scripting for Roulette Xtreme - System Designer 2.0 L J Howell UX Software 2009 Ver. 1.0 TABLE OF CONTENTS INTRODUCTION...ii What is this book about?... iii How to use this book... iii

More information

Programming Lecture 3

Programming Lecture 3 Programming Lecture 3 Expressions (Chapter 3) Primitive types Aside: Context Free Grammars Constants, variables Identifiers Variable declarations Arithmetic expressions Operator precedence Assignment statements

More information

Coding Guidelines. Introduction. General Points. Avoid redundant initialization/assignment

Coding Guidelines. Introduction. General Points. Avoid redundant initialization/assignment Coding Guidelines Introduction General Points Avoid redundant initialization/assignment Use of "!" instead of explicit "== true" and "== false" Anonymous inner classes. Members sort order Naming Abbreviations

More information

Absolute C++ Walter Savitch

Absolute C++ Walter Savitch Absolute C++ sixth edition Walter Savitch Global edition This page intentionally left blank Absolute C++, Global Edition Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents

More information

CPS122 Lecture: From Python to Java last revised January 4, Objectives:

CPS122 Lecture: From Python to Java last revised January 4, Objectives: Objectives: CPS122 Lecture: From Python to Java last revised January 4, 2017 1. To introduce the notion of a compiled language 2. To introduce the notions of data type and a statically typed language 3.

More information

Resource Center & Messaging System

Resource Center & Messaging System SOS 2012 User Manual Resource Center & Messaging System Alpha Omega Publications MMVI Alpha Omega Publications, Inc. Switched-On Schoolhouse 2012, Switched-On Schoolhouse. Switched-On, and their logos

More information

COSC345 Software Engineering. Documentation

COSC345 Software Engineering. Documentation COSC345 Software Engineering Documentation Documentation Self-documenting code Comments Outline Documentation And Comments McConnell Most developers like writing documentation If the standards aren t unreasonable

More information

COMP 202 Java in one week

COMP 202 Java in one week COMP 202 Java in one week... Continued CONTENTS: Return to material from previous lecture At-home programming exercises Please Do Ask Questions It's perfectly normal not to understand everything Most of

More information

STUDENT OUTLINE. Lesson 8: Structured Programming, Control Structures, if-else Statements, Pseudocode

STUDENT OUTLINE. Lesson 8: Structured Programming, Control Structures, if-else Statements, Pseudocode STUDENT OUTLINE Lesson 8: Structured Programming, Control Structures, if- Statements, Pseudocode INTRODUCTION: This lesson is the first of four covering the standard control structures of a high-level

More information

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p.

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p. Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p. 9 Self-Test Exercises p. 11 History Note p. 12 Programming and

More information

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan Lecture 08-1 Programming in C++ PART 1 By Assistant Professor Dr. Ali Kattan 1 The Conditional Operator The conditional operator is similar to the if..else statement but has a shorter format. This is useful

More information

CPS122 Lecture: From Python to Java

CPS122 Lecture: From Python to Java Objectives: CPS122 Lecture: From Python to Java last revised January 7, 2013 1. To introduce the notion of a compiled language 2. To introduce the notions of data type and a statically typed language 3.

More information

ACORN.COM CS 1110 SPRING 2012: ASSIGNMENT A1

ACORN.COM CS 1110 SPRING 2012: ASSIGNMENT A1 ACORN.COM CS 1110 SPRING 2012: ASSIGNMENT A1 Due to CMS by Tuesday, February 14. Social networking has caused a return of the dot-com madness. You want in on the easy money, so you have decided to make

More information

SML Style Guide. Last Revised: 31st August 2011

SML Style Guide. Last Revised: 31st August 2011 SML Style Guide Last Revised: 31st August 2011 It is an old observation that the best writers sometimes disregard the rules of rhetoric. When they do so, however, the reader will usually find in the sentence

More information

Guarantee Application Success Steven Feuerstein PL/SQL Evangelist, Quest Software

Guarantee Application Success Steven Feuerstein PL/SQL Evangelist, Quest Software Guarantee Application Success Steven Feuerstein PL/SQL Evangelist, Quest Software www.stevenfeuerstein.com www.toadworld.com/sf Copyright 2009 Quest Software Obsessed with PL/SQL... Three courses in programming

More information

the gamedesigninitiative at cornell university Lecture 12 Architecture Design

the gamedesigninitiative at cornell university Lecture 12 Architecture Design Lecture 12 Take Away for Today What should lead programmer do? How do CRC cards aid software design? What goes on each card? How do you lay m out? What properties should y have? How do activity diagrams

More information

Input, output, and sequence

Input, output, and sequence Chapter 29 Input, output, and sequence For this chapter, switch languages in DrRacket to Advanced Student Language. In the real world, we don t usually give a computer all the information it needs, all

More information

Reusability Evaluation of a Domain-Specific Web Application Framework

Reusability Evaluation of a Domain-Specific Web Application Framework Reusability Evaluation of a Domain-Specific Web Application Framework Feng Zhou and Takeshi Chusho Abstract Web application is used in various business fields on the Internet and intranets. It is an efficient

More information

If Statements, For Loops, Functions

If Statements, For Loops, Functions Fundamentals of Programming If Statements, For Loops, Functions Table of Contents Hello World Types of Variables Integers and Floats String Boolean Relational Operators Lists Conditionals If and Else Statements

More information

Racket Style Guide Fall 2017

Racket Style Guide Fall 2017 CS17 Integrated Introduction to Computer Science Hughes Racket Style Guide Fall 2017 Contents 1 Introduction 1 2 Naming 1 3 Formatting 1 4 Equality 3 5 Conditionals 4 5.1 Prefer Cond to If......................................

More information

Getting Started. Excerpted from Hello World! Computer Programming for Kids and Other Beginners

Getting Started. Excerpted from Hello World! Computer Programming for Kids and Other Beginners Getting Started Excerpted from Hello World! Computer Programming for Kids and Other Beginners EARLY ACCESS EDITION Warren D. Sande and Carter Sande MEAP Release: May 2008 Softbound print: November 2008

More information

COMP-202: Foundations of Programming. Lecture 6: Conditionals Jackie Cheung, Winter 2016

COMP-202: Foundations of Programming. Lecture 6: Conditionals Jackie Cheung, Winter 2016 COMP-202: Foundations of Programming Lecture 6: Conditionals Jackie Cheung, Winter 2016 This Lecture Finish data types and order of operations Conditionals 2 Review Questions What is the difference between

More information

BEAWebLogic. Portal. Overview

BEAWebLogic. Portal. Overview BEAWebLogic Portal Overview Version 10.2 Revised: February 2008 Contents About the BEA WebLogic Portal Documentation Introduction to WebLogic Portal Portal Concepts.........................................................2-2

More information

Expressions and Data Types CSC 121 Fall 2015 Howard Rosenthal

Expressions and Data Types CSC 121 Fall 2015 Howard Rosenthal Expressions and Data Types CSC 121 Fall 2015 Howard Rosenthal Lesson Goals Understand the basic constructs of a Java Program Understand how to use basic identifiers Understand simple Java data types and

More information

Construction: High quality code for programming in the large

Construction: High quality code for programming in the large Construction: High quality code for programming in the large Paul Jackson School of Informatics University of Edinburgh What is high quality code? High quality code does what it is supposed to do......

More information

Lesson 3: Accepting User Input and Using Different Methods for Output

Lesson 3: Accepting User Input and Using Different Methods for Output Lesson 3: Accepting User Input and Using Different Methods for Output Introduction So far, you have had an overview of the basics in Java. This document will discuss how to put some power in your program

More information

QUIZ. What is wrong with this code that uses default arguments?

QUIZ. What is wrong with this code that uses default arguments? QUIZ What is wrong with this code that uses default arguments? Solution The value of the default argument should be placed in either declaration or definition, not both! QUIZ What is wrong with this code

More information

Name & Recitation Section:

Name & Recitation Section: Name & Recitation Section: Due Wednesday, Jan 5 at 2:10 PM in 34-101. Please print out your code files (homework 1.py, rps.py, loops.py, and any code you wrote for optional problems), staple them to the

More information

Frontend guide. Everything you need to know about HTML, CSS, JavaScript and DOM. Dejan V Čančarević

Frontend guide. Everything you need to know about HTML, CSS, JavaScript and DOM. Dejan V Čančarević Frontend guide Everything you need to know about HTML, CSS, JavaScript and DOM Dejan V Čančarević Today frontend is treated as a separate part of Web development and therefore frontend developer jobs are

More information

EE 382 Style Guide. March 2, 2018

EE 382 Style Guide. March 2, 2018 EE 382 Style Guide March 2, 2018 This is a short document describing the coding style for this class. All code written in this class is assumed to follow this coding style. 1 Indentation Indentations should

More information

QUIZ on Ch.5. Why is it sometimes not a good idea to place the private part of the interface in a header file?

QUIZ on Ch.5. Why is it sometimes not a good idea to place the private part of the interface in a header file? QUIZ on Ch.5 Why is it sometimes not a good idea to place the private part of the interface in a header file? Example projects where we don t want the implementation visible to the client programmer: The

More information

Creating Word Outlines from Compendium on a Mac

Creating Word Outlines from Compendium on a Mac Creating Word Outlines from Compendium on a Mac Using the Compendium Outline Template and Macro for Microsoft Word for Mac: Background and Tutorial Jeff Conklin & KC Burgess Yakemovic, CogNexus Institute

More information

STUDENT LESSON A12 Iterations

STUDENT LESSON A12 Iterations STUDENT LESSON A12 Iterations Java Curriculum for AP Computer Science, Student Lesson A12 1 STUDENT LESSON A12 Iterations INTRODUCTION: Solving problems on a computer very often requires a repetition of

More information

Switched-On Schoolhouse 2014 User Guide Resource Center & Messaging System

Switched-On Schoolhouse 2014 User Guide Resource Center & Messaging System Switched-On Schoolhouse 2014 User Guide Resource Center & Messaging System MMVI Alpha Omega Publications, Inc. Switched-On Schoolhouse 2014, Switched-On Schoolhouse. Switched-On, and their logos are registered

More information

Problem Solving with C++

Problem Solving with C++ GLOBAL EDITION Problem Solving with C++ NINTH EDITION Walter Savitch Kendrick Mock Ninth Edition PROBLEM SOLVING with C++ Problem Solving with C++, Global Edition Cover Title Copyright Contents Chapter

More information

Chapter Twelve. Systems Design and Development

Chapter Twelve. Systems Design and Development Chapter Twelve Systems Design and Development After reading this chapter, you should be able to: Describe the process of designing, programming, and debugging a computer program Explain why there are many

More information

VARIABLES. Aim Understanding how computer programs store values, and how they are accessed and used in computer programs.

VARIABLES. Aim Understanding how computer programs store values, and how they are accessed and used in computer programs. Lesson 2 VARIABLES Aim Understanding how computer programs store values, and how they are accessed and used in computer programs. WHAT ARE VARIABLES? When you input data (i.e. information) into a computer

More information

Chapter 6 Classes and Objects

Chapter 6 Classes and Objects Chapter 6 Classes and Objects Hello! Today we will focus on creating classes and objects. Now that our practice problems will tend to generate multiple files, I strongly suggest you create a folder for

More information

Chapter 4 Lab. Loops and Files. Objectives. Introduction

Chapter 4 Lab. Loops and Files. Objectives. Introduction Chapter 4 Lab Loops and Files Objectives Be able to convert an algorithm using control structures into Java Be able to write a while loop Be able to write a do-while loop Be able to write a for loop Be

More information

the gamedesigninitiative at cornell university Lecture 13 Architecture Design

the gamedesigninitiative at cornell university Lecture 13 Architecture Design Lecture 13 Take Away for Today What should lead programmer do? How do CRC cards aid software design? What goes on each card? How do you lay m out? What properties should y have? How do activity diagrams

More information

Chapter 2 Basic Elements of C++

Chapter 2 Basic Elements of C++ C++ Programming: From Problem Analysis to Program Design, Fifth Edition 2-1 Chapter 2 Basic Elements of C++ At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class Discussion

More information

QueueBlock, ReversalADT, LinkedList,CustomerAccount, not MaintainCustomerData

QueueBlock, ReversalADT, LinkedList,CustomerAccount, not MaintainCustomerData Naming Conventions Rules Classes Use nouns Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML) Begin with upper case

More information

Hello World! Computer Programming for Kids and Other Beginners. Chapter 1. by Warren Sande and Carter Sande. Copyright 2009 Manning Publications

Hello World! Computer Programming for Kids and Other Beginners. Chapter 1. by Warren Sande and Carter Sande. Copyright 2009 Manning Publications Hello World! Computer Programming for Kids and Other Beginners by Warren Sande and Carter Sande Chapter 1 Copyright 2009 Manning Publications brief contents Preface xiii Acknowledgments xix About this

More information

APPENDIX A : Example Standard <--Prev page Next page -->

APPENDIX A : Example Standard <--Prev page Next page --> APPENDIX A : Example Standard If you have no time to define your own standards, then this appendix offers you a pre-cooked set. They are deliberately brief, firstly because standards

More information

COMP-202 Unit 4: Programming with Iterations

COMP-202 Unit 4: Programming with Iterations COMP-202 Unit 4: Programming with Iterations Doing the same thing again and again and again and again and again and again and again and again and again... CONTENTS: While loops Class (static) variables

More information

CS 370 The Pseudocode Programming Process D R. M I C H A E L J. R E A L E F A L L

CS 370 The Pseudocode Programming Process D R. M I C H A E L J. R E A L E F A L L CS 370 The Pseudocode Programming Process D R. M I C H A E L J. R E A L E F A L L 2 0 1 5 Introduction At this point, you are ready to beginning programming at a lower level How do you actually write your

More information

Assignment 6: The Power of Caches

Assignment 6: The Power of Caches Assignment 6: The Power of Caches Due by: April 20, 2018 before 10:00 pm Collaboration: Individuals or Registered Pairs (see Piazza). It is mandatory for every student to register on Piazza. Grading: Packaging

More information

[ the academy_of_code] Senior Beginners

[ the academy_of_code] Senior Beginners [ the academy_of_code] Senior Beginners 1 Drawing Circles First step open Processing Open Processing by clicking on the Processing icon (that s the white P on the blue background your teacher will tell

More information

A PROGRAM IS A SEQUENCE of instructions that a computer can execute to

A PROGRAM IS A SEQUENCE of instructions that a computer can execute to A PROGRAM IS A SEQUENCE of instructions that a computer can execute to perform some task. A simple enough idea, but for the computer to make any use of the instructions, they must be written in a form

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

CS 315 Software Design Homework 3 Preconditions, Postconditions, Invariants Due: Sept. 29, 11:30 PM

CS 315 Software Design Homework 3 Preconditions, Postconditions, Invariants Due: Sept. 29, 11:30 PM CS 315 Software Design Homework 3 Preconditions, Postconditions, Invariants Due: Sept. 29, 11:30 PM Objectives Defining a wellformed method to check class invariants Using assert statements to check preconditions,

More information

CS 3 Introduction to Software Engineering. 3: Exceptions

CS 3 Introduction to Software Engineering. 3: Exceptions CS 3 Introduction to Software Engineering 3: Exceptions Questions? 2 Objectives Last Time: Procedural Abstraction This Time: Procedural Abstraction II Focus on Exceptions. Starting Next Time: Data Abstraction

More information

Seema Sirpal Delhi University Computer Centre

Seema Sirpal Delhi University Computer Centre Getting Started on HTML & Web page Design Seema Sirpal Delhi University Computer Centre How to plan a web development project draft a design document convert text to HTML use Frontpage to create web pages

More information

Introduction to Programming Style

Introduction to Programming Style Introduction to Programming Style Thaddeus Aid The IT Learning Programme The University of Oxford, UK 30 July, 2013 Abstract Programming style is the part of the program that the human reads and the compiler

More information

Siteforce Pilot: Best Practices

Siteforce Pilot: Best Practices Siteforce Pilot: Best Practices Getting Started with Siteforce Setup your users as Publishers and Contributors. Siteforce has two distinct types of users First, is your Web Publishers. These are the front

More information

Interaction Design. Task Analysis & Modelling

Interaction Design. Task Analysis & Modelling Interaction Design Task Analysis & Modelling This Lecture Conducting task analysis Constructing task models Understanding the shortcomings of task analysis Task Analysis for Interaction Design Find out

More information

CT 229 Fundamentals of Java Syntax

CT 229 Fundamentals of Java Syntax CT 229 Fundamentals of Java Syntax 19/09/2006 CT229 New Lab Assignment Monday 18 th Sept -> New Lab Assignment on CT 229 Website Two Weeks for Completion Due Date is Oct 1 st Assignment Submission is online

More information

HTML&CSS. design and build websites

HTML&CSS. design and build websites HTML&CSS design and build websites jon duckett 1 Structure Understanding structure Learning about markup Tags and elements We come across all kinds of documents every day of our lives. Newspapers, insurance

More information

Chrome if I want to. What that should do, is have my specifications run against four different instances of Chrome, in parallel.

Chrome if I want to. What that should do, is have my specifications run against four different instances of Chrome, in parallel. Hi. I'm Prateek Baheti. I'm a developer at ThoughtWorks. I'm currently the tech lead on Mingle, which is a project management tool that ThoughtWorks builds. I work in Balor, which is where India's best

More information