210 likes | 334 Views
CSE 222 Systems Programming. Introduction Dr. Jim Holten. Introduction. This is Cramer 239 and the class is CSE 222 – Systems Programming I am: Dr. Jim Holten Regularly visit the class web site: http://www.cs.nmt.edu/~cs222/. CSE 222. 2. 01/21/09. Problems? Talk to me!!.
E N D
CSE 222Systems Programming • Introduction • Dr. Jim Holten
Introduction • This is Cramer 239 and the class is • CSE 222 – Systems Programming • I am: • Dr. Jim Holten • Regularly visit the class web site: http://www.cs.nmt.edu/~cs222/ CSE 222 2 01/21/09
Problems? Talk to me!! • My office hours are in Cramer 210a (or the Fidel Center coffeeshop) on MW at 9:30-10:30 (right after class) • For other times we can arrange a meeting, as I work at ICASA, which is off campus. CSE 222 3 01/21/09
Attendance • Print name • Today's date • User ID (on TCC systems) • Your preferred e-mail address for class correspondence CSE 222 4 01/21/09
Main Course Topics • Systems programming skills/habits • Systems programming concepts • Basic graph theory for use in system design and analysis • "Good" software engineering practices CSE 222 5 01/21/09
Two Guidelines!! • Good system engineering habits are ESSENTIAL. • Computers are stupid. They will do exactly what you tell them to, no matter how wrong it is. • Humans make mistakes, and a computer can easily repeat one mistake 10 million times before a human can stop it. • Communications are essential • How to build your program from source and run it. • What was your intent, problems encountered, decisions made, workarounds done. CSE 222 6 01/21/09
Systems • Computer programs, one or many • Using operating system resources • Activating and coordinating multiple processes • Activating and coordinating remote processes • Concepts and system concerns CSE 222 7 01/21/09
Programming? • Mostly in "C", some in Java and Perl to access system functions • Use the TCC for assigned programming to develop a common baseline for all code • Extensive use of the "C" systems call library -- and similar libraries for Java and Perl • Writing "solid" code • Use the defined style guide for all code! CSE 222 8 01/21/09
Grading Your Programs • Did you include a usage guide (UG)? • Did you include a journal ("lab notes")? • Did you follow the programming style guide and delivery instructions? • Did you achieve the assignment goals? • If not did you document your attempts? • Are your results in a clear form? CSE 222 9 01/21/09
Assignment(ID is your user id) • Log into (ssh to) the TCC computer "pi" • ssh ID@pi.nmt.edu • Perform the command sequence given in assignment MP1. • Tar up the required files and e-mail them to me. CSE 222 10 01/21/09
Class Coding Style Highlights • Prettyprint indenting • Code blocks in curly braces • Naming conventions • Comments in code CSE 222 11 01/21/09
Prettyprint Indenting • 3 spaces per block level • NO tabs for indentation • One or part of one statement per line • Continuation lines are indented even more CSE 222 12 01/21/09
Code Blocks in Curly Braces • Even a single line after a conditional is a block and should be enclosed. • Curly braces, “{“ and “}”, indented same as the enclosed block. • No code on the line with either curly brace. CSE 222 13 01/21/09
Naming Conventions • Variables • Structs and Classes • Functions • Macros CSE 222 14 01/21/09
Variables • Lower case • Underscores between words CSE 222 15 01/21/09
Structs and Classes • Upper case • Underscores between words • See the guide for “typedef” naming CSE 222 16 01/21/09
Functions • Mixed case • Each word capitalized • First “word” may be lowercase to designate module context and for disambiguation CSE 222 17 01/21/09
Macros • Upper case • Underscores between words CSE 222 18 01/21/09
Class Roadmap • Time and error handling • File I/O • Processes and communications • Graph Theory review • Coordinating multiple processes • Distributed and parallel computing concepts CSE 222 19 01/21/09
Some "C" pointers • If you are running in circles because of a problem talk to me (or e-mail). • There are many techniques and approaches to solving code problems, but until you have the need, discussing them would bore you to tears. CSE 222 20 01/21/09
C Topics of Concern • Dynamic allocation/deallocation • Pointers vs direct references • Linked list manipulation • Parsing text strings