Comp 401 – Foundations of Programming

Course Overview

This course is intended for people who have learned to program.  Its goal is to teach you how to program well.  The common programming strategy of beginners is to write the first solution they can think of without carefully identifying and weighing different alternatives. For all but the simplest problems, this approach of writing ‘’quick and dirty’’ programs will take you to the debugging stage very quickly, but will make debugging slow. For large, complex programs, you need to identify multiple alternative solutions to the problem, choose an alternative that most directly solves the problem, and think carefully what your solution does, and how it works.  The claim is that, although “quick and dirty’’ programming may produce a program faster, the concepts we teach will help you produce a correct program faster. Moreover, they will lead to programs that are easy to change and reuse.

We assume you have learned the following basic programming concepts: primitive types (integers, real numbers, Booleans), variables, constants, assignments, comments, expressions, arrays, loops, arrays, and procedures/functions/methods. These concepts are taught in most if not all introductory programming courses regardless of whether they teach conventional or object-oriented programming. This course will teach you the next-level programming concepts.  These include objects, classes, interfaces, packages, inheritance, delegation, design patterns, exceptions, assertions, pointers, and formal correctness. These concepts will not help you solve new problems; rather, they will help you solve problems in new ways. The skills that will enable you to use these concepts will form a large part of the challenge you face in this course. After this course, you will have a much deeper understanding of the programming and learn some of the ideas that can make programming a science.  We will be using Java as a vehicle for learning these concepts.

More Detailed Course Overview

Latest Comp 401 Offering

Fall 2007 Comp 110 (Using Object Editor) Offering by Sasa Junuzovic

Fall 2011 Comp 110 (with ObjectEditor and Eclipse Helper) Offering by Jason Carter

Instructor

Prasun Dewan (Lectures)

Office: FB 150

Phone: 919-962-1823

Email: dewan@cs.unc.edu

Office Hours: Tue 12:15-1:15, Thu 3:15-4:15 (or by appointment)

Teaching Assistants

Sami Benzaid (Recitation 601)

Office: SN 044

Phone:  962 1837

Email: benzaids@cs.unc.edu

Office Hours: TR 4:30-5:30 (Both 601 and 602 students are welcome)

Vishal Verma (Recitation 602)

Office: SN 044

Phone: 962 1869

Email: verma@cs.unc.edu

Office Hours: MW 4-5  (Both 601 and 602 students are welcome)

 

Lectures

Room: FB 009

Time: TR – 11-12:15pm

 

 

Unit ( Start Date)

Slides

Chapters

Assignment

1

Intro and Conventional Programming in Java (1/13)

PowerPoint 2007 2003

 

NumberListProcessor

2

Objects (1/15)

PowerPoint 2007 2003

Objects Chapter

4

State (1/20)

PowerPoint 2007 2003

State Chapter

2NumberAndWordScannerObject

5

Style (1/27)

PowerPoint 2007 2003

Style Chapter

 

18

Iterator (1/29)

PowerPoint 2007 2003

Iterator Chapter

3&4Iterators

7

Representation and Graphics (2/5)

PowerPoint 2007 2003

Representation Chapter

5Representation

8

Pointers (2/10)

PowerPoint 2007 2003

Pointers Chapter

 

14

Variable-Sized Collections (2/12)

PowerPoint 2007 2003

Collections Chapter

6Collections

17

Inheritance (2/17)

PowerPoint 2007 2003

Inheritance Chapter

7Inheritance

Graded Exam Info (3/17)

PowerPoint 2003

21

More Inheritance (3/17)

PowerPoint  2007 2003

More Inheritance Chapter

                        8Parsing

15

MVC

PowerPoint 2007 2003

MVC Chapter

9Observables

22

Delegation (3/31)

PowerPoint 2007 2003

Delegation Chapter

10 Delegation

Eclipse Logger (2/2)

PowerPoint 2007l

 

23

                          Generics and Adapters (2/7)

PowerPoint 2007 2003

Generics Chapter

 

24

                         Command Objects (2/9)

PowerPoint  2007 2003

Commands Chapter

 

19

Exceptions (2/16)

PowerPoint 2007 2003

Exceptions Chapter

11 Errors

20

Assertions (2/18)

PowerPoint 2007 2003

Assertions Chapter

 

Recitations

601: FB 009

602: SN 011

Friday 11am (Sami)

Friday 12pm (Vishal)

NOTE: Bring your laptops every Friday. You will use them for programming exercises.

Recitation material: http://www.cs.unc.edu/~dewan/comp401/Recitations

Downloads

ObjectEditor

ObjectEditor (relatively stable version)

ObjectEditor

ObjectEditor (latest, also relatively stable version)

ObjectEditor

Test Version

Final Grades and Ranks

Old Exams

 

Exam 1

Midterm

Exam 2

Final

Background Material

 

Unit

Notes

1

Theater Analogy

Theater Chapter

3

Functions

Functions Chapter

6

Types

Types Chapter

10

Main and Console

Main Chapter

11

More Types

More Types Chapter

12

Conditionals

Conditionals Chapter

13

Loops

Loops Chapter

24

Multiple Inheritance, Factories

Factories Chapter

25

Recursion

Recursion Chapter