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: MW
3:30-4:45 |
|
John Hansen |
Office: SN 044 Phone: 962-1960 Email: jbhansen@cs.unc.edu Office Hours:
Friday, 12:30-2:30pm |
|
Robert Mills |
Office: SN044 Phone: 962-1761 Email: rgmills@cs.unc.edu Office Hours: TR, 10-11am |
|
Room: FB 009 |
Time: MW– 11-12:15pm |
|
|
Unit ( Start Date) |
Slides |
Chapters |
Assignments |
|
1 |
Intro and Conventional Programming in Java (8/25, 8/30) |
PowerPoint 2007 |
|
|
|
2 |
Objects (9/1) |
PowerPoint 2007 |
||
|
4 |
State (9/8, 9/13) |
PowerPoint 2007 |
||
|
5 |
Interfaces (9/13, 9/15) |
PowerPoint 2007 |
||
|
7 |
Graphics (9/15, 9/20) |
PowerPoint 2007 |
||
|
8 |
Pointers (9/20) |
PowerPoint 2007 |
|
|
|
14 |
Variable-Sized Collections (Sep 20, 29) |
PowerPoint 2007 |
||
|
17 |
Inheritance (Oct 4, 6, 13) |
PowerPoint 2007 |
||
|
Midterm 1 Grade Distribution (Oct 20) |
PowerPoint 2007 |
|||
|
||||
|
21 |
More Inheritance (Oct 13, 20, 27) |
PowerPoint 2007 |
||
|
23 |
Generics and Adapters (Nov 1, 3) |
PowerPoint 2007 |
||
|
15 |
MVC (Nov 8, 10, 15) |
PowerPoint 2007 |
||
|
24 |
Command Objects (Nov 15, 17, 22) |
PowerPoint 2007 |
||
|
18 |
Iterators (Nov 22, 29) |
PowerPoint 2007 |
||
|
Midterm 2 Grade
Distribution (Dec 6) |
PowerPoint 2007 |
|
||
|
19 |
Exceptions (Nov 29, Dec 6, 8) |
PowerPoint 2007 |
|
|
|
20 |
Assertions (Dec 8) |
PowerPoint 2007 |
||
|
|
||||
|
|
||||
|
FB 009 |
Friday 11am-12:15pm NOTE: Bring your laptops every Friday. You will
use them for programming exercises. |
|
Recitation
material: Recitations |
|
|
ObjectEditor Version 3 |
|
|
ObjectEditor Version 8 |
|
|
ObjectEditor Version 11 |
|
|
ObjectEditor Version 15 |
|
|
ObjectEditor Version 16 |
|
|
ObjectEditor Beta |
|
|
|
||
|
1 |
Theater Analogy |
|
|
3 |
Functions |
|
|
6 |
Types |
|
|
10 |
Main and Console |
|
|
11 |
More Types |
|
|
12 |
Conditionals |
|
|
13 |
Loops |
|
|
25 |
Recursion |