Comp 401: Foundations of Programming

Contents

Course Overview.. 1

Course Syllabus in UNC Format. 2

Instructor. 2

Teaching Assistants. 2

Lectures Time and Location. 3

Recitations and Associated Material 3

Exams. 3

Exam Schedule (Subject to change). 3

Old Exams. 3

Exam Information. 3

Resources. 4

Getting Help and Class Discussion. 4

Source Code of Class Examples. 4

YouTube Video Play List. 5

Downloads. 5

Resources by Topics. 5

Reference Material 9

Comp 401 and Object Editor Papers. 13

 

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.

Course Syllabus in UNC Format

Background Course Examples

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

Email: help401-002-f16@cs.unc.edu

Office Hours: Tuesday and Thursday: 3:30-4:30PM

Teaching Assistants

Andrew Ghobrial

Office: SN372

Email: help401-002-f16@cs.unc.edu,

Office Hours: Monday and Wednesday, 12:15-2:15pm

Semion A Piskarev

Email: help401-002-f16@cs.unc.edu,

Office Hours: Tuesday 10-12am (SN 252), Friday 9-11am (SN 155)

 

Lectures Time and Location

Room: GS 200

Time: TR 2-3:15pm (Bring your laptop to class)

 

Recitations and Associated Material

401 605

401 606

SN 014, Friday 1:25pm-2:15pm

SN 014, Friday 3:35pm-4:25pm

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

Recitation material: Recitations

Exams

Exam Schedule (Subject to change)

Midterm

Tuesday Oct 18th, 2016 (during class hours, in class)

Final

12pm, Saturday Dec. 10 (in class)

Old Exams

 

Exam 1

Exam 2

Exam Information

1.       In general I like to ask some obvious and subtle questions that have been directly answered in class; and some questions requiring creativity.

2.       This means you should both study well and get a good night s sleep.

3.       Look at the old exams to get an idea of what form these questions can take.

4.       This is a big class, so it will be difficult to have everyone start and stop at the same time. So please come early - I plan to be there 15 minutes early and will start distributing the exam then. As you may have another engagement before that, I will also probably take 15 minutes to collect the exams and you can be one of those who return exams at the end.

5.       Usually my exams are not a test of your speed. Though most people wait until the end to return them, and that is a good idea in general, some students take less than 30 minutes and get almost perfect scores.

6.       There will be no assignment due the week of the exam.

7.       You can of course listen to all of the audio recordings, but that will probably take more time than you have. To reduce this time you can do several things.

8.       You can read the word documents in the Chapters column. These are dated but most of the students in my previous classes have found them very useful.

9.       You can of course listen to the recordings of only the slides you do not understand.

10.   Without going to the slide show mode, you can click on the recording associated with a slide and use the controls to skip over material you understand.

11.   You can execute Slide Show-->Setup Slide Show and ask for the slide show to be created in a resizable window and do other work when the playback addresses something you already now.

 

Resources

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-001@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/fall2016/comp401002

Source Code of Class Examples

Zipped Directory (dated)

JavaToHTML

Git Repository (current)

 

YouTube Video Play List

Comp 401 Play List

 

Downloads

ObjectEditor Version 3 (used in comp110)

oeall3

ObjectEditor Version 19 (used last year)

oeall19

ObjectEditor Version 21

oeall21

ObjectEditor Version 22 (latest, use this unless it fails on you)

oeall22

Checkstyle

UNCChecks_6.5.0.jar 

Checkstyle 6.5 zip

Runtimechecks (Includes oeall22.jar)

Comp401LocalChecks (Git code)

 

Comp401LocalChecks.jar (Library)

Consent Form

ConsentForm

Images

images.zip

 

Resources by Topics

Unit

PPT Slides and Exported PDF and Videos

Chapters

Algorithm Videos

Assignments

(Please scroll to see the first assignment)

Source Code of Examples (Java Package)

Course Information (8/23)

PowerPoint

PDF

YouTube

Mix

Bridge Scene - 1st day (long)

 

Bridge Scene - 2nd day (short)

 

 

Lecture Structure (8/25)

PowerPoint

PDF

YouTube

Mix

 

 

 

 

JDK Download

PowerPoint

PDF

 

 

 

 

Eclipse Install & Use

PowerPoint

PDF

Installing JDK on Mac

PDF

 

 

 

Checkstyle with UNC Checks : Install and Use

PowerPoint

PDF

 

 

 

 

Runtime local checks: Install and Use

PowerPoint

PDF

 

 

 

 

ObjectEditor Install

PowerPoint

PDF

PDF

 

 

 

Importing Git Project (JavaTeaching)

PowerPoint

PDF

 

 

 

 

Specifying Main Args in Eclipse

PowerPoint

PDF

PDF

 

 

 

Debugging in Eclipse

PowerPoint

PDF

PDF

 

 

 

Relevant Java Syntax

PowerPoint

PDF

PDF

 

 

lectures.java_basic_overview Package

Git (Basic  Overview)

Screen Sharing Tool

PowerPoint

PDF

 

 

 

 

Lecture Structure

PowerPoint

PDF

 

 

 

 

Scanning

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

Scanning Visualization

Number Scanner

Checks File

lectures.scanning Package

Git (Scanning)

 

Class Dual Role

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

Number And Word Scanner Bean

Checks File

lectures.class_dual_roles.statics Package

Git (Static)

lectures.class_dual_roles.instances Package

Git (Instances)

Constructors and Pointers

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

 

lectures.constructors_pointers Package

Git (Constructors and Pointers)

 

Programming Interfaces

PowerPoint

PDF

YouTube

Mix

Interfaces Chapter

Drive

 

Token Beans and Interfaces

Checks File

lectures.interfaces Package

Git (Interfaces)

User Interfaces

PowerPoint

PDF

YouTube

Docx

PDF

Drive

 

Commands and Graphics

Checks File

lectures.ui Package

Git (UI)

lectures.graphics Package

Git (Graphics)

Composite Objects

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

Composites

Checks File

lectures.composite.object_shapes.Package

Git (Composite)

Composite: Tree, DAGS & Graphs of Objects and Windows

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

 

lectures.composite.tree_dag_graph_objects_windows Package

Git (Trees, DAGS, Graphs, Windows)

 

Elements of Programming Style

YouTube

Mix

 

 

 

 

Inheritance and Collections

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

Completing the Bridge Scene

Checks File

lectures.inheritance Package

Git (Inheritance)

Inheritance and variables

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

 

lectures.inheritance Package

Git (Inheritance)

IS-A

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

 

lectures.inheritance.is_a Package

Git (IS A)

Collection Kinds

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

 

Command Interpreter

Checks File

lectures.arrays.collection_kinds Package

Git (Collection Kinds)

MVC

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

 

MVC

Checks File

lectures.mvc.monolithic Package

Git (Monolithic)

lectures.mvc.interactor Package

Git (Interactor)

lectures.mvc Package

Git (MVC)

Component Notifications

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

 

lectures.mvc.properties Package

Git (Propertie)

lectures.mvc.collections PackageGit (Collections)

MVC and Toolkits

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

 

Toolkit and Graphics

Checks File

lectures.mvc.toolkit Package

Git (Toolkits)

MVC and Graphics

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

 

lectures.mvc.graphics Package

Git (Graphics)

Documentation: Assertions

PowerPoint

PDF

YouTube

Mix

Assertions Chapter

 

Assertions, Commands, Threads

Checks File

lectures.documentation.assertions Package

Git (Assertions)

Animation: Threads and Command Objects

PowerPoint

PDF

YouTube

Mix

Commands Chapter

Visualization

 

lectures.animation.threads_commands Package

 

Git (Animation, Threads, Commands)

Inheritance: Abstract Classes

PowerPoint

PDF

YouTube

Inheritance Chapter

 

Mainly Parsing

Checks File

lectures.inheritance.abstract_classes Package

Git (Abstract Classes)

Parsing and Grammars

PowerPoint

PDF

YouTube

More Inheritance Chapter

 

 

lectures.parsing_grammars Package

Git (Parsing and Grammars)

Animation and Threads: Synchronized Methods

PowerPoint

PDF

YouTube

Commands Chapter

Visualization

 

lectures.animation.threads.synchronized_methods Package

Git (Synchronized Threads)

Animation and Threads: Wait and Notify

PowerPoint

PDF

YouTube

Commands Chapter

Visualization

12. Wait, Notify, Generics

Checks File

lectures.animation.threads.wait_notify Package

Git (Wait and Notify)

Generics, Adapters, Basic Delegation

PowerPoint

PDF

YouTube

Generics chapter

 

 

lectures.generics_adapters Package

Git (Generics and Adapters)

Exceptions

PowerPoint

PDF

YouTube

Exceptions Chapter

 

 

lectures.exceptions Package

Git (Exceptions)

Conclusion

PowerPoint

PDF

YouTube

 

 

 

 

 

Midterm 1 Grade Distribution

 

 

Final Grade Distribution

 

 

 

Reference Material

Unit

Recorded PPTX Slides

Chapters (Not always current with PPT)

Algorithm Videos

Source Code of Examples (Java Package)

Windows Command Line in general

PowerPoint

PDF

 

 

 

 

Command Line Program Development (Windows)

PowerPoint

PDF

 

 

 

 

Command Line Program Development (Unix, Linux, Mac)

PowerPoint

PDF

 

 

 

 

Install Egit

PPT

PDF

 

 

 

 

Theater Model of the Computer

PowerPoint

PDF

Theater Chapter

 

 

 

Object-first Introduction to Programming

PowerPoint

PDF

YouTube

Objects Chapter

 

lectures.objects Package

Packages

PowerPoint

PDF

Objects Chapter

 

 

lectures.objects Package

Functions

PowerPoint

PDF

Functions Chapter

 

 

lectures.functions Package

State and Properties

PowerPoint

PDF

YouTube

State Chapter

Video

 

lectures.state.properties Package

Interfaces

PowerPoint

PDF

Interfaces Chapter

lectures.interfaces Package

Least Privilege

PowerPoint

PDF

Interfaces Chapter

 

lectures.least_privilege Package

Math Types (401 Prerequisite)

PowerPoint

PDF

Types Chapter

 

 

lectures.types.math Package

Documentation: Comments

PowerPoint

PDF

Types Chapter

 

 

lectures.documentation.comments Package

Documentation: Annotations Meta Circularity

PowerPoint

PDF

 

 

lectures.documentation.annotations Package

Composite: Annotations

PowerPoint

PDF

 

lectures.composite.annotations Package

Patterns, Interfaces and ObjectEditor

PowerPoint

PDF

 

 

 

Static State

PowerPoint

PDF

YouTube

Static Chapter

 

 

lectures.static_state Package

Main and Console Input

PowerPoint

PDF

Main and Console Chapter

 

lectures.main_consoleinput Package

Types: Char, String,

PowerPoint

More Types Chapter

 

 

lectures.types.char_string Package

Types: Enums

PowerPoint

More Types Chapter

 

 

lectures.types.enums Package

Conditionals

PowerPoint

PDF

Conditionals

 

 

lectures.conditionals Package

Loops

PowerPoint

PDF

Loops

 

 

lectures.loops Package

Conditionals: Advanced

PowerPoint

PDF

Conditionals

 

 

lectures.conditionals.advanced Package

Loops: Advanced

PowerPoint

PDF

Loops

 

 

lectures.loops.advanced Package

Animation: Loops

PowerPoint

PDF

Commands Chapter

Video

 

lectures.animation.loops Package

Files

Files Chapter

 

lectures.files Package

Arrays

PowerPoint

PDF

Collections Chapter

 

 

lectures.arrays Package

Arrays: Collection Implementation

PowerPoint

PDF

Collections Chapter

 

 

lectures.arrays.collection_implementation Package

Iterators and Scanning

PowerPoint

PDF

Iterator Chapter

 

lectures.iterator_scanning Package

Arrays: Collection Kinds (10/3)

PowerPoint

PDF

Collections Chapter

 

 

lectures.arrays.collection_kinds Package

Inheritance: Virtual, Abstract Factory Methods

PowerPoint

PDF

Inheritance Chapter

 

lectures.inheritance.virtual_abstract_factory_methods Package

Factories

PowerPoint

PDF

 

lectures.factories Package

Inheritance: Multiple

PowerPoint

PDF

Inheritance Chapter

 

 

lectures.inheritance.multiple Package

Documentation: Assertions

PowerPoint

PDF

Assertions Chapter

 

lectures.mvc.monolithic Package

lectures.mvc.interactor Package

lectures.mvc Package

Reflection

PowerPoint

PDF

YouTube

 

lectures.reflection_action_objects  Package

Recursion (11/19)

PowerPoint

PDF

YouTube

Recursion Chapter

lectures.animation.threads.synchronized_methods Package

Composite: Visitors

PowerPoint

PDF

Assertions Chapter

Video

 

lectures.animation.threads.ui Package

Undoable Command Objects

PowerPoint

PDF

YouTube-1

YouTube-2

Commands Chapter

 

lectures.undo Package

Generics: Advanced

PowerPoint

PDF

Generics chapter

 

lectures.generics Package

Equals Method and Overloading vs. Polymorphism

PowerPoint

PDF

YouTube

Inheritance Chapter

 

lectures.inheritance Package

Clone Method and Deep vs. Shallow Copying (Fall 11 Lecture)

PowerPoint

PDF

YouTube

Inheritance Chapter

 

 

lectures.deep_shallow_copy

Conversion vs. Casting (Fall 11 Lecture)

PowerPoint

PDF

YouTube

Inheritance Chapter

 

 

lectures.casting_vs_conversion

Inheritance vs. Delegation or Indiscriminate Use of Inheritance Considered Harmful

PowerPoint

PDF

YouTube

Delegation Chapter

 

 

lectures.inheritance_vs_delegation

lectures.inheritance_vs_delegation.abstract_method

lectures.inheritance_vs_delegation.mvc

lectures.inheritance_vs_delegation.shared_vars

lectures.inheritance_vs_delegation.wrong_is_a

Assertions: Advanced

PowerPoint

PDF

Assertions Chapter

 

 

lectures.inheritance.deep_shallow_copy Package

Virtual, Abstract and Factory Methods

PowerPoint

PDF

Inheritance Chapter

 

 

lectures.inheritance Package

Animation and Threads: User-Interface Thread

PowerPoint

PDF

YouTube

Commands Chapter

Visualization

 

lectures.animation.threads.ui Package

Factories

PowerPoint

PDF

 

 

 

 

 

 

 

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