variable Holds values, e.g., integers (int), strings (string) and reals (float, double). Two warnings: (1) declare all variable together at the top of a function and (2) assign values before using. declaration At the top of the function, state your variables' types. types int, float, double, string; arrays thereof assignment "x = 5;" MAKE SURE TO USE O N E EQUAL SIGN! comparison "(x == 5)" MAKE SURE TO USE T W O EQUAL SIGNS! Or, "(x > 5)", etc. loop Use "for" or "while" to make it repeat a block. conditional An if-statement. boolean Something that is true or false, e.g., a comparison. condition A boolean expression used to control conditionals and loops. comments /* Label your code, write yourself a note! */ formatting Indent stuff nicely, etc. Compiler ignores it; TAs don't. nesting Putting stuff inside other stuff, e.g., a conditional in a loop. flag A boolean variable to convey true-false info. In C, an int. operators A built-in function such as *, +, -, /, for, while, if, = comparison operators include ==, <, <=, >=, != function Something that is called with parentheses, e.g., sqrt(). Specifically, A portion of code that is designed for one mini-task, e.g., draw a line, draw a square, compute the square root, or find the largest value. In Java, functions are called "methods". statement A command line that ends with a semicolon. expression Anything that has a value, e.g., "a + b" or "(a == b)" or "c++" Boolean expressions can be built with && (and) and || (or) block Chunk of code between curly braces {} algorithm process/routine/method to solve a problem evaluate to find the value of an expression syntax grammar defining a programming language compiler error an error that causes the compiler to produce an error message and fail run-time error an error that does not disrupt compiling, but causes your program to abort with an error message when running, e.g., "segmentation fault" and "floating point exception" logic error an error that the computer never notices, but that you notice because your darn program doesn't do what you want it to do. module A portion of source code that has a specific job, e.g., a module of code to maintain an alphabetical list of names. Often, the module is put into its own source code file class A portion of source code in an object-oriented programming language such as Java; one class per source code file. The concepts of object-orient design are outside the scope of this course. nesting When you put one thing inside another, e.g., a conditional inside a loop, a loop inside a conditional, a loop inside a loop, etc. stepwise refinement The "divide and conquer" strategy to computer programming. Start with the main goal, and break it down into subparts. Then, break each subpart down into smaller parts. Once you have broken it down into small enough parts, each part is programmed as ither a class or a function. This is considered "top-down" design, since the main goal is the "high level" goal, and then the designer works her way down to the details. modular decomposition The design that results from stepwise refinement, since your design has been "decomposed" into modules encapsulation The physical separation of different subtasks, e.g., into separate classes, source code files or modules. conceptual abstraction The ability for people to create different points of view on a design, depending on the relevant degree of detail. Through stepwise refinement, one traverses multiple levels of abstraction. Similarly, in digital circuitry, the details of creating AND, OR and NOT gates with transistors is at one level of abstraction, and use of 1-ADD circuits to build a full adder is at a higher level of abstraction.
email: evs at cs dot columbia dot edu