9
CSC 230: C and Software CSC 230: C and Software Tools Tools Rudra Dutta Computer Science Department Course Introduction

CSC 230: C and Software Tools Rudra Dutta Computer Science Department Course Introduction

Embed Size (px)

Citation preview

Page 1: CSC 230: C and Software Tools Rudra Dutta Computer Science Department Course Introduction

CSC 230: C and Software ToolsCSC 230: C and Software Tools

Rudra Dutta

Computer Science Department

Course Introduction

Page 2: CSC 230: C and Software Tools Rudra Dutta Computer Science Department Course Introduction

General DescriptionGeneral Description

Learn procedural programming in C Stages of program compilation and execution Memory allocation and de-allocation Gain perspective in programming

methodologies Program in “chunks” - recognize successively

higher levels of organization Work from the command line with simple tools Overarching gain from course - conceptual

Page 3: CSC 230: C and Software Tools Rudra Dutta Computer Science Department Course Introduction

Instructional ObjectivesInstructional Objectives Upon successful completion of this course, a student will be

able to...– write small to medium C programs having several separately-

compiled modules.– explain what happens to a program during preprocessing, lexical

analysis, parsing, code generation, code optimization, linking, and execution, and identify errors that occur during each phase. In particular, they will be able to describe the differences in this process between C and Java.

– correctly interpret error messages and warnings from the preprocessor, compiler, and linker, and avoid them.

– find and eliminate runtime errors using a combination of logic, language understanding, trace printout, and gdb or a similar command-line debugger.

– allocate and deallocate memory in C programs while avoiding memory leaks and dangling pointers. In particular, they will be able to implement dynamic arrays and singly-linked lists using allocated memory.

Page 4: CSC 230: C and Software Tools Rudra Dutta Computer Science Department Course Introduction

Instructional Objectives (contd.)Instructional Objectives (contd.)

– use the C preprocessor to control tracing of programs, compilation for different systems, and write simple macros.

– write, debug, and modify programs using library utilities, including, but not limited to assert, the math library, the string library, random number generation, standard I/O, and file I/O.

– use simple command-line tools to design, document, debug, and maintain their programs.

– use an automatic packaging tool, such as make or ant, to distribute and maintain software that has multiple compilation units.

– use a version control tool, such as cvs, to track changes and do parallel development of software.

– distinguish key elements of the syntax (what’s legal), semantics (what does it do), and pragmatics (how is it used) of a programming language.

Page 5: CSC 230: C and Software Tools Rudra Dutta Computer Science Department Course Introduction

Class ParticipationClass Participation

Focus of lectures - concepts– Syntax and lexical correctness hardly need lectures

Concepts can be odd– Different ones are difficult to different people– Repetition helps– Talking it out helps

Some active group exercises may be undertaken as class work

Page 6: CSC 230: C and Software Tools Rudra Dutta Computer Science Department Course Introduction

Recurring ThemesRecurring Themes

Getting closer to the machine

Dealing with memory

(Why C?)

Page 7: CSC 230: C and Software Tools Rudra Dutta Computer Science Department Course Introduction

ResourcesResources

Text Class lecture and notes you take

– Course website

Teaching assistants Instructor Web repositories, other texts, …

Page 8: CSC 230: C and Software Tools Rudra Dutta Computer Science Department Course Introduction

Some Specific FeedbackSome Specific Feedback

Programming experience / background– Reqd. / not reqd. for you– Year (sophomore, junior, senior, …)– Total programming experience– Languages– Answer code snippet questions

Availability of programming platform in class

Why C? (Personal View)

Page 9: CSC 230: C and Software Tools Rudra Dutta Computer Science Department Course Introduction

Code SnippetsCode Snippets Re-write each of the following code snippets, in each case replacing a for statement

by a while statement, or vice-versa, but otherwise completely equivalent.

while (a < b) {a = a + 1;

}

for (counter = n; counter != 0; counter = counter - 1) {result = 2 * result;

}

while (current_value++ < new_num) {create_entry (current_value + i++);

}printf (“%d ¥t %d ¥n”, current_value, i);