Comp 401 – Foundations of Programming
|
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. |
|
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) |
|
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) |
|
Room: FB 009 |
Time: TR – 11-12:15pm |
|
|
Unit ( Start Date) |
Slides |
Chapters |
Assignment |
|
1 |
Intro and Conventional Programming in Java (1/13) |
|
||
|
2 |
Objects (1/15) |
|||
|
4 |
State (1/20) |
|||
|
5 |
Style (1/27) |
|
||
|
18 |
Iterator (1/29) |
|||
|
7 |
Representation and Graphics (2/5) |
|||
|
8 |
Pointers (2/10) |
|
||
|
14 |
Variable-Sized Collections (2/12) |
|||
|
17 |
Inheritance (2/17) |
|||
|
Graded Exam Info (3/17) |
PowerPoint 2003 |
|||
|
21 |
More Inheritance (3/17) |
|||
|
15 |
MVC |
|||
|
22 |
Delegation (3/31) |
|||
|
Eclipse Logger (2/2) |
PowerPoint 2007l |
|
||
|
23 |
Generics and
Adapters (2/7) |
|
||
|
24 |
Command Objects
(2/9) |
|
||
|
19 |
Exceptions (2/16) |
|||
|
20 |
Assertions (2/18) |
|
|
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 |
|
|
ObjectEditor |
ObjectEditor
(relatively stable version) |
|
ObjectEditor |
ObjectEditor (latest, also relatively stable
version) |
|
ObjectEditor |
|
|
|
|
Exam 1 |
|
|
|
||
|
1 |
Theater Analogy |
|
|
3 |
Functions |
|
|
6 |
Types |
|
|
10 |
Main and Console |
|
|
11 |
More Types |
|
|
12 |
Conditionals |
|
|
13 |
Loops |
|
|
24 |
Multiple Inheritance, Factories |
|
|
25 |
Recursion |