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 2010 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: MW 3:30-4:45

Teaching Graduate Assistants

Ben Newton

Office: SN 043

Phone:

Email: bn@cs.unc.edu

Office Hours: W 2- 2:30, F 12:30-2

Wade Gobel

Office: SN 043

Phone:

Email: wgobel@cs.unc.edu

Office Hours: Tuesday 2-3, Thursday 3-4

Teaching Undergraduate Assistants

William Hipschman

Office: SN 043

Email: whipsch2@email.unc.edu

Office Hours: Thu 10-12

Jose Labra

Office: SN 043

Email: Jose jlabrae@live.unc.edu

Office Hours: W 1-2, F 3-4

 

Lectures

Room: Gardner 105

Time: MW 11-12:15pm

 

Schedule

 

Unit ( Start Date)

Recorded Slides

Chapters

Assignments

1

Intro and Conventional Programming in Java (8/24, 8/29)

PowerPoint 2007

 

Number List Processor

Number and Command Scanner

2

Objects (8/29, 8/31)

PowerPoint 2007

Objects Chapter

4

State (8/31, 9/7, 9/12 )

PowerPoint 2007

State Chapter

Stateless and Stateful Objects

5

Interfaces (9/12, 9/14, )

PowerPoint 2007

Interfaces Chapter

Interfaces and Constructors

7

Graphics (9/14, 9/19, 9/21)

PowerPoint 2007

Graphics Chapter

Object Composition Galore

14

Variable-Sized Collections (Sep 26, 28)

PowerPoint 2007

Collections Chapter

Collections

17

Inheritance (Oct 3, 5, 10, 17 )

PowerPoint 2007

Inheritance Chapter

Inheritance Galore

Midterm 1 Grade Distribution (Oct 26)

PowerPoint 2007

8

Static (Oct 24)

PowerPoint 2007

 

Complex Object Interaction

21

Grammars and More Inheritance (Oct 24, 26, 31, Nov 2)

Original slides have been divided into:

Abstract Classes, Grammars, Recursive Descent

Dynamic Dispatch and Abstract Methods

Initialization and Inheritance

PowerPoint 2007

 

PowerPoint

PowerPoint

PowerPoint

More Inheritance Chapter

Parsing

23

Generics and Adapters (Nov 2, 9)

PowerPoint 2007

Generics chapter

Generics

15

MVC (Nov 9, 16 )

PowerPoint 2007

MVC Chapter

Delegation and Observers

24

Command Objects (Nov 16, 22, 28 )

PowerPoint 2007

Commands Chapter

Commands

18

Iterators (Nov 28, Dec 5)

PowerPoint 2007

Iterator Chapter

Iterator, Exceptions, and Assertions

19

Exceptions (Dec 5, 7)

PowerPoint 2007

Exceptions Chapter

 

20

Assertions(Dec 7)

PowerPoint 2007

Assertions Chapter

Midterm 2 Grade Distribution (Dec 5)

PowerPoint 2007

 

Recitations

Gardner 105

Friday 11am-12:15pm

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

Recitation material: Recitations

Downloads

ObjectEditor Version 3

oeall3

ObjectEditor Version 17

oeall17

ObjectEditor Version 18

oeall18

ObjectEditor Version 19

oeall19

ObjectEditor Version 20

oeall20 (after class was completed)

Final Grades

Exams

 

Exam 1

Exam 2

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

25

Recursion

Recursion Chapter

 

Comp 401 and Object Editor Papers (Will need to download papers when logged in to UNC network to get access to ACM Digital Library)

Topic

Paper

Talk

 

The design patterns taught in Comp 401

Prasun Dewan, Teaching Inter-Object Design Patterns to Freshmen. Proceedings of ACM SIGCSE. 2005

PPT

The use of ObjectEditor in Comp 110 and 401

Prasun Dewan, How a Language-based GUI Generator Can Influence the Teaching of Object-Oriented Programming, Proceedings of ACM SIGCSE, 2012.

Recorded PPTX

How ObjectEditor is different from other generators of user-interfaces

Prasun Dewan, Increasing the Automation of a Toolkit without Reducing its Abstraction and User-Interface Flexibility, Proceedings of ACM EICS, 2010

PPTX

How ObjectEditor can be customized

Prasun Dewan, A Demonstration of the Flexibility of Widget Generation, Proceedings of ACM EICS, June 2010

 

ObjectEditor and Mobile Device User Interfaces

Olufisayo Omojokun and Prasun Dewan. Automatic Generation of Device User-Interfaces?. IEEE Percom 2007