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

Fall 2012 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

Wait List Policy

In case you are wait listed for the lecture or the recitation, please come to class and recitation for the first two weeks if there is room, and look at the material online if there is not. In either case, fill out a sheet at the start of lectures on the first day, which will be distributed at the start of class. Usually about 20% of the class drops within the first two weeks - partly because the first assignments checks if you have the pre-requisite. Usually the number of people who are willing to take the risk of not getting enrolled is less than this number, so anyone who waits usually gets in, though of course there is no guarantee. So if you really need the course or want to take it, you should wait.

If you are transfer student who did not get a chance to enroll early and cannot afford to skip 401 this semester, please send mail to Jodie Turnbull at: turnbull@cs.unc.edu.  You can also post at: https://piazza.com/unc/fall2013/comp401 to share discussion of this issue with others. Please do not send mail to me, as I cannot add you directly.

 

Instructor

Prasun Dewan (Lectures)

Office: FB 150

Phone: 919-962-1823

Email: help401@cs.unc.edu, dewan@cs.unc.edu

Office Hours: TR 3:30-4:30pm

Teaching Graduate Assistants

?????

Office:

Phone: 919 ??????

Email: help401@cs.unc.edu, sajal@cs.unc.edu

Office Hours:

??????

Office:

Phone: 919 ?????

Email: help401@cs.unc.edu, yumeng@cs.unc.edu

Office Hours: MW 2-3pm

Office: SN 008

Phone:

Email: help401@cs.unc.edu,

Office Hours:

 

Office: SN 008

Phone:

Email: help401@cs.unc.edu,

Office Hours:

 

 

Getting Help and Class Discussion

We will be using Piazza for class discussion and getting help. The system is highly catered to getting you help fast and efficiently from classmates, the TA, and myself. Rather than emailing questions to the teaching staff, I encourage you to post your questions on Piazza. If you do not get a response within a day or two on Piazza, please send mail to help401@cs.unc.edu. But try Piazza first. Do not send mail to an individual instructor, as that can overwhelm him - such mail will be ignored.

Before posing a question, please check if this question has been asked before. This will reduce post clutter and reduce our burden. Repeat questions will be ignored by the instructors.

Piazza allows anyone to respond. So if you see a question that you think you can respond to, please do so, as that will reduce our burden and help you "teach" your fellow students.

This will be a form of class participation that will be noted when I allocate my fudge points!

Hope it works well

If you have any problems or feedback for the developers, email team@piazza.com.

Find our class page at: https://piazza.com/unc/fall2013/comp401

 

Lectures

Room: MY G202

TR 11-12:15pm

 

Source Code of Class Examples

Zipped Directory

JavaToHTML

Downloads

ObjectEditor Version 3 (used in comp110)

oeall3

ObjectEditor Version 21 (used last year)

oeall20

ObjectEditor Version 22 (untested in class, use it unless it fails)

oeall22

 

 

 

 

 

Recitations

Section 601: 11-11:50 ( SN 14)

Section 602: 12-12:50 (SN 14)

Friday 11am-12:15pm

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

Recitation material: Recitations

 

Schedule (Current Year and Last Year Dates are Mixed)

Audience

Unit

Recorded PPTX Slides

PDF Slides

 

Chapters (Not always current with PPT)

Videos

Assignments

(Please scroll to see the first assignment)

Source Code of Examples (Java Package)

401

Course Information (8/22)

PowerPoint

PDF

Course Overview

Oz Project Demo

 

 

110 and 401

Eclipse Install and Basic Use (Look on your own)

PowerPoint

PDF

Warm-up Chapter

 

 

 

110 and 401

ObjectEditor Install (Look on your own)

PowerPoint

PDF

Warm-up Chapter

 

 

 

401

Specifying Main Args in Eclipse (Look on your own)

PowerPoint

PDF

Warm-up Chapter

 

 

 

401

Debugging in Eclipse (Look on your own)

PowerPoint

PDF

Warm-up Chapter

 

 

 

401

Conventional programming in Java for those who know conventional programming (Look on your own)

PowerPoint

PDF

Warm-up Chapter

 

 

lectures.java_syntax_overview Package

401

Scanning (8/27)

PowerPoint

PDF

Warm-up Chapter

 Scanning Visualization

Word Scanner

Multiple Token Types

lectures.scanning Package

110 (401 Prerequisite)

Theater Model of the Computer

PowerPoint

PDF

Theater Chapter

 

 

 

110 and 401

Object-first Introduction to Programming (8/27, 8/29)

PowerPoint

PDF

Objects Chapter

 

lectures.objects Package

110 and 401 (look on you own)

Packages

PowerPoint

PDF

Objects Chapter

 

 

 

110 (401 Prerequisite)

Functions

PowerPoint

PDF

Functions Chapter

 

 

lectures.functions Package

110 and 401

State and Properties (9/5, 9/10 )

PowerPoint

PDF

State Chapter

Video

Beans

lectures.state.properties Package

110 and 401

Interfaces (9/10, 9/12)

PowerPoint

PDF

Interfaces Chapter

 

Interfaces

lectures.interfaces Package

110 and 401

Least Privilege (Look on your own)

PowerPoint

PDF

Interfaces Chapter

 

 

lectures.least_privilege Package

110

Math Types (401 Prerequisite)

PowerPoint

PDF

Types Chapter

 

 

lectures.types.math Package

110 and 401

Documentation: Comments

PowerPoint

PDF

Types Chapter

 

 

lectures.documentation.comments Package

110 and 401

Documentation: Annotations Meta Circularity

PowerPoint

PDF

 

 

 

lectures.documentation.annotations Package

110 and 401

Graphics (9/12, 9/17)

PowerPoint

PDF

Graphics Chapter

 

Graphics

lectures.graphics Package

110 and 401

Composite: Objects and Shapes (9/17, 9/19)

PowerPoint

PDF

Graphics Chapter

Types Video

 

lectures.composite.objects_shapes Package

110 and 401

Composite: Annotations

PowerPoint

PDF

 

 

 

lectures.composite.annotations Package

110  and 401

Composite: Tree, DAGS & Graphs of Objects and Windows (9/19, 9/24)

PowerPoint

PDF

 

 

 

lectures.composite.tree_dag_graph_objects_windows Package

110 and 401

Patterns, Interfaces and ObjectEditor (9/24)

PowerPoint

PDF

 

 

 

 

110 (401 Prerequisite)

Static State

PowerPoint

PDF

Static Chapter

 

lectures.static_state Package

110 (401 Prerequisite)

Main and Console Input

PowerPoint

PDF

Main and Console Chapter

 

 

lectures.main_consoleinput Package

110 (401 Prerequisite)

Types: Char, String,

PowerPoint

 

More Types Chapter

 

 

lectures.types.char_string Package

110 (401 Prerequisite)

Types: Enums

PowerPoint

 

More Types Chapter

 

 

lectures.types.enums Package

110 (401 Prerequisite)

Conditionals

PowerPoint

PDF

Conditionals

 

 

lectures.conditionals Package

110 (401 Prerequisite)

Loops

PowerPoint

PDF

Loops

 

 

lectures.loops Package

110 (401 Prerequisite)

Conditionals: Advanced

PowerPoint

PDF

Conditionals

 

 

lectures.conditionals.advanced Package

110 (401 Prerequisite)

Loops: Advanced

PowerPoint

PDF

Loops

 

 

lectures.loops.advanced Package

110 (401 Prerequiste)

Animation: Loops

PowerPoint

PDF

Commands Chapter

Video

 

lectures.animation.loops Package

110

Files

 

 

Files Chapter

 

 

lectures.files Package

110 (401 Prerequisite)

Arrays

PowerPoint

PDF

Collections Chapter

 

 

lectures.arrays Package

110 (401 Prerequisite)

Arrays: Collection Implementation

PowerPoint

PDF

Collections Chapter

 

lectures.arrays.collection_implementation Package

401 (maybe)

Iterators and Scanning

PowerPoint

PDF

Iterator Chapter

 

lectures.iterator_scanning Package

401

Inheritance (9/24, 9/26, 10/1)

PowerPoint

PDF

Inheritance Chapter

 

CompositionAndInheritance

lectures.inheritance Package

401

Inheritance: Type Checking (10/1, 10/3)

PowerPoint

PDF

Inheritance Chapter

 

 

lectures.inheritance Package

110 and 401

Arrays: Collection Kinds (10/3)

PowerPoint

PDF

Collections Chapter

 

Table and Command Interpreter

lectures.arrays.collection_kinds Package

401

Inheritance: Virtual, Abstract Factory Methods

PowerPoint

PDF

Inheritance Chapter

 

lectures.inheritance.virtual_abstract_factory_methods Package

401

Factories

PowerPoint

PDF

 

 

 

lectures.factories Package

110 and 401

Inheritance: Multiple

PowerPoint

PDF

Inheritance Chapter

 

lectures.inheritance.multiple Package

110 (maybe) and 401

MVC  (10/8)

PowerPoint

PDF

MVC Chapter

 

MVC

lectures.mvc.monolithic Package

lectures.mvc.interactor Package

lectures.mvc Package

401

MVC: Properties and Collections (10/10)

PowerPoint

PDF

MVC Chapter

 

 

lectures.mvc.properties Package

lectures.mvc.collections Package

401

MVC and Toolkits (10/12, 10/17)

PowerPoint

PDF

MVC Chapter

 

lectures.mvc.toolkit Package

401

MVC and Graphics/Window Systems (10/17, 10/22, 10/24)

PowerPoint

PDF

MVC Chapter

 

MVC-Windows

lectures.mvc.toolkit Package

110 and 401

Documentation: Assertions (10/24, 10/29)

PowerPoint

PDF

Assertions Chapter

 

 

lectures.documentation.assertions Package

401 (maybe)

Reflection and Action Objects

PowerPoint

PDF

 

lectures.reflection_action_objects  Package

401

Animation: MVC (10/29)

PowerPoint

PDF

Commands Chapter

Video

 

lectures.animation.mvc Package

401

Animation: Threads and Command Objects (10/29, 10/31)

PowerPoint

PDF

Commands Chapter

Video

Assertions, Command Objects, Threads

lectures.animation.threads_commands Package

401

Inheritance: Abstract Classes (10/31, 11/5)

PowerPoint

PDF

Inheritance Chapter

 

lectures.inheritance.abstract_classes Package

401

Parsing and Grammars (11/5)

PowerPoint

PDF

More Inheritance Chapter

 

Recursive Descent Parsing and Thread Synchronization

lectures.parsing_grammars Package

401

Animation and Threads: Synchronized Methods (11/7)

PowerPoint

PDF

Commands Chapter

Video

 

lectures.animation.threads.synchronized_methods Package

401

Animation and Threads: User-Interface Thread (11/7, 11/12)

PowerPoint

PDF

Commands Chapter

Video

 

lectures.animation.threads.ui Package

401

Animation and Threads: Wait and Notify (11/12, 11/14)

PowerPoint

PDF

Commands Chapter

Video

 

lectures.animation.threads.wait_notify Package

401

Composite Design Pattern (11/14, 11/19)

PowerPoint

PDF

 

 

 

lectures.composite_design_pattern Package

110 & maybe 401

Recursion (11/19)

PowerPoint

PDF

Recursion Chapter

 

 

lectures.recursion Package

401

Composite: Visitors (11/26)

PowerPoint

PDF

Assertions Chapter

Video

 

lectures.composite.visitors Package

401

Generics, Adapters, Basic Delegation (11/26, 12/3, 12/5)

PowerPoint

PDF

Generics chapter

 

lectures.generics Package

401

Conclusion (12/5)

PowerPoint

PDF

 

 

 

 

401

Exceptions

PowerPoint

PDF

Exceptions Chapter

 

 

lectures.exceptions Package

401 (maybe)

Undoable Command Objects

PowerPoint

PDF

Commands Chapter

 

 

lectures.undo Package

401

Generics: Advanced

PowerPoint

PDF

Generics chapter

 

lectures.generics.advanced Package

401 (maybe)

Equals, Polymorphism vs. Overloading

PowerPoint

PDF

Inheritance Chapter

 

 

lectures.equals_polymorphism_overloading Package

401 (maybe)

Deep and Shallow Copy

PowerPoint

PDF

Inheritance Chapter

 

 

lectures.inheritance.deep_shallow_copy Package

401 (maybe)

Inheritance vs. Delegation

PowerPoint

PDF

Inheritance Chapter

 

 

lectures.inheritance.deep_shallow_copy Package

401 (maybe)

Inheritance vs. Delegation

Inheritance vs. Delegation: Abstract Methods: Shared Variables

Inheritance vs. Delegation: Abstract Methods: MVC

Inheritance vs. Delegation: Abstract Methods: Wrong Inheritance

PowerPoint

PDF

Inheritance Chapter

 

 

lectures.inheritancevsdelegation Package

lectures.inheritance.inheritancevsdelegation.abstract_methods Package

lectures.inheritance.inheritancevsdelegation.mvc Package

 

lectures.inheritance.inheritancevsdelegation.wrong_is_a Package

401 (maybe)

Initialization and Inheritance

PowerPoint

PDF

More Inheritance Chapter

 

 

 

401 (maybe)

Assertions: Advanced

PowerPoint

PDF

Assertions Chapter

 

lectures.assertions.advanced Package

 

Midterm 1 Grade Distribution (Oct 22)

PowerPoint

 

 

 

Midterm 2 Grade Distribution (Dec 3)

PowerPoint

 

 

 

 

Final Grades

Old Exams

 

Exam 1

Exam 2

 

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

 

 

Access Statistics