Comp 401: Foundations of Programming

Contents

Course Overview.. 1

Course Syllabus in UNC Format 2

Assignments and Associated Resources by Topics. 2

Instructor. 6

Teaching Assistants. 6

Learning Assistants. 6

Lectures Time and Location. 6

Recitations and Associated Material 6

Exams. 7

Exam Schedule (Subject to change) 7

Old Exams. 7

Exam Information. 7

Resources. 8

Getting Help and Class Discussion. 8

Source Code of Class Examples. 8

YouTube Video Play List 8

Downloads. 8

Starting Up Background Material 9

Reference Material 11

Comp 401 and Object Editor Papers. 15

 

Course Overview

This course is intended for people who have learned to program. Its goal is to teach 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

 

Assignments and Associated Resources by Topics

Unit

PPT Slides and Exported PDF and Videos

Chapters

Relevant Videos

Assignments

(Please scroll to see the first assignment)

Source Code of Examples (Java Package)

Course Information

PowerPoint

PDF

YouTube

Bridge Scene - 1st day (long)

 

Bridge Scene - 2nd day (short)

 

 

Scanning

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

Scanning Visualization

A1. Number Scanner

 

A1. Checks File

lectures.scanning Package

Git (Scanning)

 

Class Dual Role

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

A2. Number And Word Scanner Bean

 

A2.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

 

A3. Token Beans and Interfaces

 

A3. Checks File

lectures.interfaces Package

Git (Interfaces)

User Interfaces

PowerPoint

PDF

YouTube

Docx

PDF

Drive

 

A4. Commands and Graphics

 

A4. Checks File

lectures.ui Package

Git (UI)

lectures.graphics Package

Git (Graphics)

Composite Objects

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

A5. Composites

 

A5. 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

 

A6. Completing the Bridge Scene

 

A6. 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

 

 

A7. Command Interpreter

 

A7. Checks File

lectures.arrays.collection_kinds Package

Git (Collection Kinds)

MVC

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

 

A8. MVC

 

A8. Checks File

lectures.mvc.monolithic Package (No praxis)

Git (Monolithic)

lectures.mvc.interactor Package (no praxis)

Git (Interactor)

lectures.mvc Package (no praxis)

Git (MVC)

Component Notifications

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

 

lectures.mvc.properties.atomic Package (observer praxis)

Git (Propertie)

lectures.mvc.collections (no praxis)

PackageGit (Collections)

MVC and Toolkits

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

 

A9. Toolkit and Graphics

 

A9. Checks File

lectures.mvc.toolkit Package (mvc toolkit praxis)

Git (Toolkits)

MVC and Graphics

PowerPoint

PDF

YouTube

Mix

Docx

PDF

Drive

 

 

lectures.mvc.graphics Package (mvc graphics praxis)

Git (Graphics)

Assertions

PowerPoint

PDF

YouTube

Mix

Assertions Chapter

 

A10. Assertions, Commands, Threads

 

A10. 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

 

A11. Mainly Parsing

 

A11. 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

A12 Checks

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

 

 

 

 

 

 

 

Instructor

Prasun Dewan (Lectures)

Office: FB 150

See  Course Syllabus in UNC Format on how to contact the instructor.

Office Hours: Tuesday 12:15 to 13:30, Thu 15:30 to 16:30

Teaching Assistants

 

 

 

 

Learning Assistants

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Lectures Time and Location

Room AR 121

Time: TR 11am-12:15pm (Bring your laptop to class)

 

Recitations and Associated Material

401 609

401 610

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

SN 014, Friday 2:30pm-3:20pm

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 16th, 2018 (during class hours, in class)

Final

12pm, Thu Dec. 13 (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.       No solutions will be posted for these exams. Posting solutions encourages students to not try and solve problems. The corollary of this is that you should not distribute your solutions to old exam problems. You can discuss in English individual aspects of the exams, and you can use Eclipse and checkstyle – with the latest assignment checks- for validating that your solutions follow general style rules.

5.       The solved examples in the course material are what you should look at if you want to learn from solutions. I strongly encourage you to do these solved problems, consulting the solutions only when necessary.

6.       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.

7.       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.

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

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

10.   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.

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

12.   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.

13.   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.

14.   You can look at the quiz questions and answers, which distill what you have learned from the course material.

15.   You can look at your diaries for additional information, though these questions and answers are not exhaustive.

16.   The exams will require you to follow style rules. The whole course is a bunch of style rules and principles. (What you learned in the previous class was enough to write any program. ) The  setoff specified assignment constraints is the obvious first place to look for easy to follow rules.

 

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/fall2018/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 21

oeall21

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

oeall22

ObjectEditor with Graphs (huge!)

oeall-huge

Checkstyle

UNCChecks_6.5.0.jar

Checkstyle 6.5 zip

Runtimechecks (Includes oeall22.jar)

Comp401LocalChecks (Git code)

 

Comp401LocalChecks.jar (Library)

Runtimechecks without oeall22.jar (for TAs)

Comp401LocalChecksNoOE (For TAs)

Consent Form

ConsentForm

Images

images.zip

 

Starting Up Background Material

Unit

PPT Slides and Exported PDF and Videos

Chapters

Algorithm Videos

Guide to Learning Resources: PowerPoint to Praxes and Autocheckers

PowerPoint

PDF

Youtube

 

 

 

 

JDK Download

PowerPoint

PDF

 

 

 

 

Eclipse Install & Use

PowerPoint

PDF

Installing JDK on Mac

PDF

 

 

 

Difficulty Plugin

PowerPoint

PDF

GoogleDoc

 

 

 

 

Checkstyle with UNC Checks : Install and Use

PowerPoint

PDF

GoogleDoc

 

 

 

 

Runtime local checks: Install and Use

PowerPoint

PDF

 

 

 

 

ObjectEditor Install

PowerPoint

PDF

PDF

 

 

 

Grading Server

PowerPoint

PDF

 

 

 

 

Importing Git Project (JavaTeaching)

PowerPoint

PDF

 

 

 

 

Eclipse Project Searches (e.g. JavaTeaching )

PowerPoint

PDF

 

 

 

 

Diary Posts

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

 

 

 

 

ObjectEditor Use

PowerPoint

PDF

 

 

 

 

Local Checks from Git (For TAs mainly)

PowerPoint

PDF

 

 

 

 

Complete Grader from Git (TAs mainly)

PowerPoint

PDF

 

 

 

 

 

 

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