Successful course participants will:
Internalize an accurate understanding of what functional and object-oriented programs mean
Develop the skills necessary to learn new programming languages quickly
Master many specific language concepts such that they can recognize them in strange guises
Learn to evaluate the power and elegance of programming languages and their constructs
Attain reasonable proficiency in the OCaml and Racket languages — and, as a by-product, become more proficient in languages they already know
To demonstrate your learning in this in this course, you'll have the opportunity to complete:
Approximately 7 homework assignments, combined worth 70% of your final grade.
Please make sure your homework submissions compile and run without crashing!
Submissions that crash or do not compile will be penalized 30%.
A midterm exam worth 15% of your final grade.
A final exam worth 15% of your final grade.
“Challenge problems” are designed to have little (but some) impact on your grade whether you do them or not.
Challenge problems provide an opportunity to work on something interesting and optional.
Challenge problems will typically allow you to get approximately 5% of additional credit on an assignment, yet they will typically be much more difficult than this credit amount suggests.
You should only attempt a challenge problem after finishing the rest of an assignment.
Challenge problems may be less carefully specified and less carefully calibrated for how difficult/time consuming they are.
All homework is due at 5:00pm Pacific Time on the due date. This deadline is strict.
You can use up to two late days for each assignment. Submitting any time after the deadline uses at least one full late day. No credit will be granted after two late days. Course staff will not be answering homework questions on the message board during the two day period after it is due. However, they will answer questions during office hours.
You are strongly advised to turn homework assignments in early to avoid any issues due to emergencies. Do not skip class or section to work on homework — this will cost you time in the long run.
You are encouraged to discuss the homework assignments with your classmates. However, the work you submit must be your own. Do not look directly at anyone else's work or solution. Do not show your work or solution to anyone else.
Any attempt to misrepresent the work you did will be dealt with via the appropriate University mechanisms. The guidelines for this course and more information about academic integrity are in a separate document linked on the course homepage. You are responsible for knowing the information in that document. Please also carefully review the UW Academic Misconduct Process which provides the following policy:
Engineering is a profession demanding a high level of personal honesty, integrity and responsibility. Therefore, it is essential that engineering students, in fulfillment of their academic requirements and in preparation to enter the engineering profession, shall adhere to the University of Washington’s Student Code of Conduct.
Any student in this course suspected of academic misconduct (e.g., cheating, plagiarism, or falsification) will be reported to the College of Engineering Dean’s Office and the University’s Office of Community Standards and Student conduct. (See CoE website for more detailed explanation of the academic misconduct adjudication process). Any student found to have committed academic misconduct will receive a 0-grade on impacted academic work (e.g., assignments, project, or exams).
If there is any chance you have violated this policy, you must clearly indicate in your submission what work was not entirely your own. If you do, the worst that will happen is you may lose some points on an assignment. This is much better than the alternative.
Your instructor aims for lecture and section to be some of the most enriching hours of your college career. We will start promptly, and you should arrive punctually and well-rested.
In every course, there is a danger that you will not learn much and thus lose the most important reason to take the course. In 341, this danger is severe because it is easy to get “distracted by unfamiliar surroundings” and never focus on the concepts you need to learn. These surroundings include new syntax, editors, error messages, etc. Becoming comfortable with them is only one aspect of this course, so you must get past it. When we use a new language, you must spend time on your own “getting comfortable” in the new setting as quickly as possible so you do not start ignoring the course material.
If you approach the course by saying, “I will have fun learning to think in new ways,” then you will do well. If you instead say, “I will try to fit everything I see into the way I already look at programming,” then you will get frustrated. By the end, it will relate back to what you know, but be patient.
Syntax vs. semantics vs. idioms vs. libraries vs. tools
OCaml basics (bindings, conditionals, records, functions)
Recursive functions and recursive types
Benefits of no mutation
Algebraic datatypes, pattern matching
Tail recursion
Higher-order functions; closures
Lexical scope
Currying
Syntactic sugar
Equivalence and effects
Parametric polymorphism and container types
Type inference
Abstract types and modules
Racket basics
Dynamic vs. static typing
Laziness, streams, and memoization
Implementing languages, especially higher-order functions
Macros
Eval
Abstract types via dynamic type-creation and simple contracts
Object-oriented programming is dynamic dispatch
Pure object-orientation
Implementing dynamic dispatch
Multiple inheritance, interfaces, and mixins
OOP vs. functional decomposition and extensibility
Subtyping for records, functions, and objects
Class-based subtyping
Subtyping vs. parametric polymorphism; bounded polymorphism
To learn these topics using real programming languages and well-suited for them, we will use:
OCaml (a statically typed, mostly functional language) (approximately 5 weeks)
Racket (a dynamically typed, mostly functional language) (approximately 5 weeks)
There are thousands of languages not on this list, many programming styles not represented, and many language constructs and concepts that would be great to study, but 10 weeks is short! The languages above will serve as representatives for entire programming styles and paradigms.