259 Park Science Building
gtowell at brynmawr dot edu
|Lecture||9:55 - 11:15 TR||Park 337|
|Lab||12:55 - 2:15 Tue||Park 231|
|Office Hours|| Monday 10AM - Noon. Thurs 12:01pm-1:01pm
Also by appointment
232 840 6920.
|Password: given in class|
An introduction to the study of programming languages. Where do programming languages come from and how do
they evolve? And why should a programmer choose one over another? This course explores these topics by
covering programming language features and paradigms, including object-oriented, functional, and imperative.
The course will focus on general structures common to programming languages; focusing on why those
structures exist, the various ways in which those structures are implemented, and how to use them.
In addition, the course will look at programming techniques in two languages new to most students: Go and Rust.
|Computer Lab||Park 230 & 231||Instructions for using the lab
Remote accessible lab computer status
Programming Language Pragmatics
by M. Scott
Not required But I have found VERY useful
The Go Programming Language
by A. Donovan and B. Kernighan
Not required but useful and free at https://doc.rust-lang.org/stable/book/ The Rust Programming Language
by S. Klabnik and C. Nichols
Also, if you install rust on your laptop, you got the book. Execute:
rustup docs --book
- Sep 5, First class
- Oct 12, first midterm
Note in 2023 we did not read "the semi-colon wars" so q1 does not apply.
questions from midterm1 of 2021
Answers for midterm1 of 2021
Answers for midterm1 of 2022 Note that these are student answers that got full marks (and were typed). This does not mean that the answers were perfect or even error free.
- Nov 9, Second Midterm Some practice questions for second midterm from 2021 (where you see "kotlin", read "Rust")
The second midterm from 2021 This test focused on functional programming in Kotlin which is a very different language than Rust. You should make the following adjustments to the numbered question. Indeed, while Rust can be written in a functional style, that will not be the emphasis of the Rust discussions
- Answer for Rust.
- Translate to Rust and answer
- No adjustment
- skip entirely
- answer just for Rust. Ignore Dijkstra.
- use Rust
- use Rust
Some sample questions. Note that these questions are of the form you might see on the final, but they are questions that I rejected from the final. (Where you see "kotlin", read "Rust")
Final from 2021 The following translations should make the questions apply to this year
- Q3. There is not a good translation.
- Q6. There is not a good translation.
- Q7. Substitute Rust for Kotlin
- Q9. Substitute Rust for Kotlin
- Q10. Substitute Rust for Kotlin
All assignments must be turned in on time. If there are compelling reasons why you cannot turn in an assignment on time, you must ask for permission at least 48 hours in advance of the due date.
Despite my best efforts, homeworks may have sections that are not quite correct. If you find an error, let me know. If I agree that the issue is an issue and you have told me of the issue at least 48 hours prior to the due date then I will give bonus points as follows:
3 points for the first issue reported 2 points for the second issue reported 1 point for the third issue reportedOrdering is based on date of email receipt. One bonus per person per assignment.
All programming assignments must abide by the standards set forth here Design Principles Posted code samples will -- almost always -- adhere to these standards. To the extent the code samples do not, it will almost always be in the are of naming of variables. I can be lazy and I write a lot of code (most of which you do not see). (Code shown in class may not adhere to these principles, usually in the interest of brevity.)
All programming assignments must be accompanied by a README file. I will read, and often will respond, to all README text. See the file for a description of the expected contents.
- Homework 0 (ish) watch at least the first 30 minutes of The worst programming language ever. Bring "- one statement that you did not understand or thought was really funny" to class on Sep 12.
- Homework 1 Due Sep 12, before 11:59:59pm
- Homework 2 Due Sep 26, before 11:59:59pm
- Lab 1: Sep 5. Access and Login.
- Lab 2: Sep 12. factors from prime factors (and other things) in Java
- Lab 3: Sep 19. Go Practice
- Lab 4: Sep 26 Sorting and implementing interfaces in Go
This course is intended to be fairly free-flowing with a lot of discussion. Therefore, I will not normally publish powerpoint lecture notes. I will try to restrict my commentary to topics covered in the text.
- Sep 5: Introductory remarks.
- Sep 7: Scott 1.1-1.4
- Topic 3, Programming in Go
- rough notes
- Hello World
- Definite assignment in Java
- pass by value
- tuple assignment and functions
- fibonacci and if and loops
- arrays in Go
- structs in Go
- binding methods to structures
- function bining to classes in Java
- ++ expression in Java
- NO ++ expression in Go
- command line args
- Money types, methods and toString
- unused example more with slices
- unused example structs, structs inside structs
- Topic 4, Names, Scopes and Bindings. Ch 3 from Scott (not 3.4)
- rough notes
- Static declaration of Integers in Java
- Dynamic Method dispatch in Java
- Static Method dispatch in Go
- java recursion depth Testing recursion depth with Java is an exercise in frustration. The same code, with all the same settings can show changes by a factor of 2 between runs.
- go recursion depth See notes at top of program
- tail recursion in Go Althought he Go compiler does not implement TR (at least not in 2023)
- variable lifetimes in Go
- block nesting in Go
- function nesting in Go
- aliases in Go. More than one reference to same object.
- Pair of classes resulting in hiding in JavaAAAB
- Closures in Go
- Object Closures in Java
- Linked list in Go
- Topic 5:
Chapter 6 in Scott
- rough notes
- Order of eval of passed params in Go
- slices and pointers in Go
- pointers in Go
- pointers in function calls in Go
- null pointers in Go
- Swift: a language with NO null pointer exceptions
- Definite assignment in Java
- labelled breaks
- the switch statement in Go
- switch in Java
- Tail recursion
- Covariance and java arrays
- intro to covariance
- Covariance and java generics
- Topics 6 and 7:
Another programming approach: Rust
- Topic 8:
Types: Scott: Ch 7
- Topic 9:
Composite Types: Scott Ch 8
- Topic 10:
Subroutines: Scott Ch 9
- Topic 11: Not this year
- Topic 12:
Concurrency: Scott Ch 13:
skip: 13.1.2, 13.2.3 (except fork/join and Box 13.3) 13.3 except 13.3.5, 13.4.1, 13.4.2, 13.4.4, 13.4.5
Attendance and active participation are
expected in every class. Participation includes asking questions,
contributing answers, proposing ideas, and providing constructive
Please stay in touch with me, particularly if you feel stuck on a topic or assignment and can't figure out how to proceed. Often a quick e-mail, or face-to-face conference can reveal solutions to problems and generate renewed creative and scholarly energy. It is essential that you begin assignments early.
GradingGrades will be awarded based on the number of points earned and according to the percentage breakdowns shown.
Mid-terms will be take-home and intended to be completed in the time of a single class session. All exams will be open everything. The only restriction is that you may not discuss the exam, in any way, with anyone until 24 hours after the exam (unless you are told otherwise by me).
Incomplete grades will be given only for verifiable medical
illness or other such dire circumstances. Incomplete grades must be approved through the Dean's
ALL work submitted for grading should be entirely YOUR OWN (except for labs). Sharing of programs, code snippets, etc. is not permitted under ANY circumstances. That said, I encourage you to discuss assignments at an algorithmic level with other students. That is, talk about the problem, and general approaches to problems. Do not share or discuss actual code.
- Kernighan's book on programming style. Most of the examples in this book are in languages rarely if ever used, but the lessons still apply.
Learning AccommodationsStudents requesting accommodations in this course because of the impact of disability are encouraged to meet with me privately early in the semester with a verification letter. Students not yet approved to receive accommodations should also contact Deb Alder, Coordinator of Accessibility Services, at 610-526-7351 in Guild Hall, as soon as possible, to verify their eligibility for reasonable accommodations. Early contact will help avoid unnecessary inconvenience and delays.
This class may be recorded.
Creating a Welcoming EnvironmentAll members of the Instruction Staff are dedicated to the cause of improving diversity, equity, and inclusion in the field of computing, and to supporting the wellness and mental health of our students.
Diversity and InclusionIt is essential that all members of the course community – the instructor, TAs, and students – work together to create a supportive, inclusive environment that welcomes all students, regardless of their race, ethnicity, gender identity, sexuality, or socioeconomic status. All participants in this course deserve to and should expect to be treated with respect by other members of the community. Class meetings, lab sessions, office hours, and group working time should be spaces where everyone feels welcome and included. In order to foster a welcoming environment, students of this course are expected to: exercise consideration and respect in their speech and actions; attempt collaboration and consideration, including listening to opposing perspectives and authentically and respectfully raising concerns, before conflict; refrain from demeaning, discriminatory, or harassing behavior and speech.
WellnessAdditionally, your mental health and wellness are of utmost importance to the course Instruction Staff, if not the College as a whole. All members of the instruction staff will be happy to chat or just to listen if you need someone to talk to, even if it’s not specifically about this course. If you or someone you know is in distress and urgently needs to speak with someone, please do not hesitate to contact BMC Counseling Services: 610-526-7360 (610-526-7778 nights and weekends). If you are uncomfortable reaching out to Counseling Services, any member of the Instruction Staff will be happy to contact them on your behalf. We understand that student life can be extremely difficult, both mentally and emotionally. If you are living with mental health issues such as anxiety, depression, ADHD, or other conditions that may affect you this semester, you are encouraged to discuss these with the Instructor. Although the details are up to you to disclose, the Instruction Staff will do their best to support and accommodate you in order to ensure that you can succeed this course while staying healthy.
Created on August 2023. Subject to constant revision.