WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO...
Transcript of WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO...
![Page 1: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/1.jpg)
1
WELCOME TO CIS 1068!
![Page 2: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/2.jpg)
2
This is a difficult course!
![Page 3: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/3.jpg)
3
How to do well in this course
n GO TO CLASSn DO THE READINGn Keep up with the assignments
q The course material is cumulativeq From a former student: “Procrastination will
eventually come around to bite you in the ass!”n If you don’t understand something, ask
questions (especially “WHY?”).
![Page 4: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/4.jpg)
4
We’re here to help
n Ask questionsn Email us, come by our office hoursn We may be nerdy, but we’re not too scary
![Page 5: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/5.jpg)
5
What is computer science?
n computers?n science?n programming?n late lonely nights in front of the computer?
ALGORITHMIC THINKING
al·go·rithm:a step-by-step procedure for solving a problem or accomplishing some end especially by a computer
n How does that relate to programming?
![Page 6: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/6.jpg)
6
Just like Legos…
![Page 7: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/7.jpg)
![Page 8: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/8.jpg)
![Page 9: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/9.jpg)
9
A Simple Model of a Computer
![Page 10: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/10.jpg)
10
The 6 Parts
![Page 11: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/11.jpg)
Random Access Memory (RAM, or just memory)n Volatile storage
q Each card can store up to a few gigabytes of dataq Storage only lasts while computer has power
n Organization: Matrixq Some number of columns, either 32 or 64q Each cell stores a binary integer (bit): a 1 or a 0q Each row has an address, or row number
Row Bit 1
Bit 2
Bit 3
Bit 4
Bit 5
Bit 6
Bit 7
… Bit 64
1 0 1 0 …2 1 1 0 …3 … … … …456…
![Page 12: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/12.jpg)
Central Processing Unit (CPU)
n Little chip, big deal: it does all the computingn Think of it as a place where some instructions
are stored, and carried out 1 by 1n Instructions can do basic math, and copy
data and move it around (and that’s pretty much it) Copy 1 to 7 *Start*
Add 4 and 7, store in 8Multiply 1 and 8…………
![Page 13: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/13.jpg)
Hard Disk (Disk, Hard Drive)
n Permanent (more or less) storageq Like memory, stores binary dataq Unlike memory, it doesn’t forget anything when
power is turned off.n Organization: files, blocks, etc.
q Complicated, we won’t get into itq The important point for us:
It’s slow! (compared to memory)
![Page 14: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/14.jpg)
Other computer components
n Monitorn Keyboardn Mousen Graphics processorsn Busses n Fann Disk controller n …n All sorts of things, but for this course, we’ll
just concentrate on a few of them.
![Page 15: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/15.jpg)
kilo 103 1,000mega 106 1,000,000giga 109 1,000,000,000tera 1012 1,000,000,000,000peta 1015 1,000,000,000,000,000exa 1018 1,000,000,000,000,000,000zetta 1021 1,000,000,000,000,000,000,000yotta 1024 1,000,000,000,000,000,000,000,000
“large” units
![Page 16: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/16.jpg)
milli 10
�3
micro 10
�6
nano 10
�9
pico 10
�12
femto 10
�15
atto 10
�18
zepto 10
�21
yocto 10
�24
units < 1
![Page 17: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/17.jpg)
some names for large numbers
kilo 10
3thousand
mega 10
6million
giga 10
9billion
tera 10
12trillion
peta 10
15quadrillion
exa 10
18quintillion
zetta 10
21sextillion
yotta 10
24septillion
![Page 18: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/18.jpg)
powers of 10 powers of 2
kilo 103 1,000 210 1,024mega 106 1,000,000 220 1,048,576giga 109 1,000,000,000 230 1,073,741,824tera 1012 1,000,000,000,000 240 1,099,511,627,776peta 1015 1,000,000,000,000,000 250 1,125,899,906,842,624exa 1018 1,000,000,000,000,000,000 260 1,152,921,504,606,846,976zetta 1021 1,000,000,000,000,000,000,000 270 1,180,591,620,717,411,303,424yotta 1024 1,000,000,000,000,000,000,000,000 280 1,208,925,819,614,629,174,706,176
kilo: 1,000 or 1,024?
usually use:n powers of 2 for storagen powers of 10 for just about everything else
![Page 19: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/19.jpg)
proposed prefixes for powers of 2
n haven’t exactly taken the world by storm
powers of 10 powers of 2
kilo 103 kibi 210 1,024mega 106 mebi 220 1,048,576giga 109 gibi 230 1,073,741,824tera 1012 tebi 240 1,099,511,627,776peta 1015 pebi 250 1,125,899,906,842,624exa 1018 exbi 260 1,152,921,504,606,846,976zetta 1021 zebi 270 1,180,591,620,717,411,303,424yotta 1024 yobi 280 1,208,925,819,614,629,174,706,176
![Page 20: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/20.jpg)
20
Basic Java programs
![Page 21: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/21.jpg)
21
Your first Java program!
n Java is a programming language.
public class Hello {public static void main(String[] args) {System.out.println("Hello, world!");}
}
n What does this code output (print to the user) when you run (execute) it?
![Page 22: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/22.jpg)
Java code and machine code
Notice: Java instructions don’t look like CPU instructions!
n CPU instructions (aka, machine code)q Written in binaryq Easy and fast for machines to work withq Hard for programmers to work with
n Java codeq Written in Java, a “high-level” (English-like)
programming languageq We use the Java compiler and virtual machine to
translate from Java to machine code
![Page 23: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/23.jpg)
23
Compiling a program
n Before you run a program, you must compile it.n compiler: Translates a computer program
written in one language (i.e., Java) to another language (i.e., byte code)
Compile (javac) Execute (java)
outputsource code(Hello.java)
byte code(Hello.class)
![Page 24: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/24.jpg)
The Java Virtual Machine (JVM, or VM)n The Java Virtual Machine executes byte code
q Use the “java” command to execute itq It only understands byte code (“.class” files)
n The VM makes Java a bit different from older programming languages (C, C++)q It’s an extra step; compilers for other languages
directly produce machine codeq It’s slowerq But it allows the same byte code to run on any
machine with a VM
![Page 25: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/25.jpg)
25
Program execution
n The output is printed to the console.n Some editors pop up the console as another
window.
![Page 26: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/26.jpg)
26
Another Java program
public class Hello2 {
public static void main(String[] args) {
System.out.println("Hello, world!");
System.out.println();
System.out.println("This program produces");
System.out.println("four lines of output");
}
}
![Page 27: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/27.jpg)
27
Writing your own Java programs
public class <name> {public static void main(String[] args) {
<statement>;<statement>;…<statement>;}
}
n Every executable Java program consists of a classq that contains a method called main
n that contains the statements (commands) to be executed
![Page 28: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/28.jpg)
28
Syntax
n syntax: The set of legal structures and commands that can be used.
n Examples:q Every basic statement ends with a semi-colon.q The contents of a class occur between curly
braces.
![Page 29: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/29.jpg)
29
Syntax Errors
n syntax error: A problem in the structure of a program.
1 public class Hello {2 pooblic static void main(String[] args) {3 System.owt.println("Hello, world!")4 }5 }
2 errors found:File: Hello.java [line: 2]Error: Hello.java:2: <identifier> expectedFile: Hello.java [line: 3]Error: Hello.java:3: ';' expected
compiler output:
![Page 30: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/30.jpg)
30
Finding syntax errors
n Error messages do not always help us understand what is wrong:
File: Hello.java [line: 2]
Error: Hello.java:2: <identifier> expected
pooblic static void main(String[] args) {
n Why can’t the computer just say “You misspelled ‘public’”?
![Page 31: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/31.jpg)
31
First lesson in computer science
n Computers are stupid.n Computers can’t read minds.n Computers don’t make mistakes.n If the computer is not doing what you want,
it’s because YOU made a mistake.
![Page 32: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/32.jpg)
32
More on syntax errors
n Java is case-sensitiveq Hello and hello are not the same
1 Public class Hello {
2 public static void main(String[] args) {
3 System.out.println("Hello, world!");
4 }
5 }
1 error found:File: Hello.java [line: 1]Error: Hello.java:1: class, interface, or enum expected
compiler output:
![Page 33: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/33.jpg)
33
System.out.println
n System.out.println: A statement to print a line of output to the console.q pronounced “print-linn”
n Two ways to use System.out.println:System.out.println("<message>");q Prints the given message as a line of text to the console.
System.out.println();
q Prints a blank line to the console.
![Page 34: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/34.jpg)
34
Strings
n string: A sequence of text characters.q Start and end with quotation mark characters
n Examples:
"hello"
"This is a string"
"This, too, is a string. It can be very long!"
![Page 35: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/35.jpg)
35
Details about strings
n A string may not span across multiple lines."This is not
a legal string."
n A string may not contain a “ character.q The ‘ character is okay."This is not a "legal" string either."
"This is 'okay' though."
n This begs the question…
![Page 36: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/36.jpg)
36
Escape sequences
n A string can represent certain special characters by preceding them with a backslash \ (this is called an escape sequence).q \t tab characterq \n newline characterq \" quotation mark character
n Example:System.out.println("Hello!\nHow are \"you\"?");
n Output:Hello!How are "you"?
n which brings up another question…
![Page 37: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/37.jpg)
37
Questions
n What is the output of each of the following println statements?
System.out.println("\ta\tb\tc");System.out.println("\\\\");System.out.println("'");System.out.println("\"\"\"");System.out.println("C:\nin\the downward spiral");
n Write a println statement to produce the following line of output:
/ \ // \\ /// \\\
![Page 38: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/38.jpg)
38
Questions
n What println statements will generate the following output?
This program prints aquote from the Gettysburg Address.
"Four score and seven years ago,our 'fore fathers' brought forth on this continenta new nation."
n What println statements will generate the following output?
A "quoted" String is'much' better if you learnthe rules of "escape sequences."
Also, "" represents an empty String.Don't forget to use \" instead of " !'' is not the same as "
![Page 39: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/39.jpg)
39
Comments
n comment: A note written in the source code to make the code easier to understand.q Comments are not executed when your program runs.q Most Java editors show your comments with a special color.
n Comment, general syntax:/* <comment text; may span multiple lines> */or,// <comment text, on one line>
n Examples:/* A comment goes here. *//* It can even span
multiple lines. */// This is a one-line comment.
![Page 40: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/40.jpg)
40
Comments: Where do you go?
n … at the top of each file (also called a "comment header"), naming the author and explaining what the program does
n … at the start of every method, describing its behavior
n … inside methods, to explain complex pieces of code
![Page 41: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/41.jpg)
41
Comments: Why?
n Comments provide important documentation.
n Later programs will span hundreds or thousands of lines, split into many classes and methods.
n Comments provide a simple description of what each class, method, etc. is doing.
n When multiple programmers work together, comments help one programmer understand the other's code.
![Page 42: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/42.jpg)
42
That thing called style…
n What is style?q Indentationq Capitalizationq Formatting / spacingq Structured codeq No redundancyq …
n Why is it important?
![Page 43: WELCOME TO CIS 1068! - Temple Universityjfiore/2017/spring/1068/handouts/slides/01... · WELCOME TO CIS 1068! 2 This is a difficult course! 3 How to do well in this course nGO TO](https://reader031.fdocuments.net/reader031/viewer/2022021900/5b6bd1dc7f8b9af64d8dcb37/html5/thumbnails/43.jpg)
Reading
n Please read chapter 1n Don’t worry about the graphics supplement