COMP 1405 / COMP 1005 - Lecture 1: Comprehensive Study Notes
Slide Structure and Pedagogical Mechanics
Lecture Slide Organization:
Slide 1: Title slide.
Slide 2: Learning Outcomes. These are short imperative phrases structured like commands. They serve as a self-assessment tool for students to gauge content absorption. If a student cannot perform the tasks listed on Slide 2 by the end of a lecture, it acts as an explicit signal to reach out for assistance via discussion forums, teaching assistants, or during/after class.
Slide 3: Textbook references, reading assignments, and suggested exercises.
Course Logistics and Administrative Overview
Instructor Information:
Name: Robert Collier.
Email Policy: Use email strictly for personal or confidential issues. All general or technical questions must be posted to the public discussion forums.
Teaching Background: \,years of teaching experience at Carleton University, previously taught at the University of Calgary for a couple of years, and taught his first course at the University of Guelph.
Course Sections: Instructor manages \,sections of COMP 1405 (and COMP 1005).
Teaching Assistants: \,teaching assistants (TAs) assist across all sections.
Student Demographic:
Approximately of enrolled students have no prior programming experience, while have prior experience (ranging from high school courses up to to \,years of coding).
The course assumes zero prior programming experience.
Delivery Format (Hybrid Approach):
In-Person Lecture: \,session per week held physically in the classroom (utilizing blackboard and slides for interactive face-to-face instruction).
Online Lecture: \,session per week held synchronously via Zoom (accessed through Brightspace; optimizes live coding demonstrations and remote workspace setups).
Schedule Breakdown:
Week 1: Single in-person session on Wednesday.
Week 2 Onward: Mondays in-person, Wednesdays online via Zoom.
Course Modality: Synchronous. Attendance at both modes is required across the three available section slots.
Communication Channels:
Daily monitoring of official Carleton email is mandatory.
Brightspace: Learning Management System (LMS) containing slide decks, code demonstrations, assignments, tutorials, course outlines, and schedules.
Discussion Forums: Located directly inside Brightspace to enable rapid communication across all \,sections and \,TAs.
Assessment Scheme and Course Policies
Weekly Tutorials:
Schedule: Start in Week 2 (Introductory Tutorial in Week 2 carries no mark).
Release Time: Every Monday at \,AM (one minute past midnight).
Format: A instructional video walking through a concept, followed by a hands-on coding task.
Completion Time: Takes for average students (up to for absolute beginners).
Weighting: Each marked tutorial is worth exactly of the final grade.
Assignments:
Structure: \,assignments total across the term, operating on a rotation schedule.
Project Scope: All \,assignments build upon a single cumulative project: creating a retro educational game.
Deadlines and Submission Buffer Policy:
Standard Due Date: Fridays at for both tutorials and assignments.
Automatic Extension Buffer: Dropboxes remain open for an additional until Sunday at . No request or permission is required to use this buffer.
Missed Assignment Policy:
If an assignment deadline is missed, students may complete a "Missed Assignment Submission" by the end of the term.
Missed submissions receive a non-graded evaluation (satisfactory/unsatisfactory).
If all \,assignments are submitted and evaluated as satisfactory by the end of the semester, the single lowest assignment grade will be dropped.
If an assignment is completely omitted or evaluated as unsatisfactory, its grade remains and cannot be dropped.
Examinations:
Midterm Exams: \,midterms administered online via Brightspace, spaced at approximately the one-third and two-thirds points of the semester. Each midterm is worth of the final grade. Delivered over a availability window. Duration: .
Final Exam: Delivered online via Brightspace over a window scheduled by the Registrar's Office around Week or . Worth of the final grade. Duration: .
Exam Design Philosophy: High-weight final exams are intentionally avoided to ensure grades reflect consistent long-term learning rather than high-stakes testing pressure.
Code Execution and Marking Mandates:
Non-Negotiable Rule: Submitted code must execute without crashing.
TA Marking Restrictions: Teaching assistants are strictly forbidden from altering student code by even a single character. If code fails to execute or crashes immediately, TAs must assign a grade of
Mandatory Verification Procedure: After uploading any assignment file to Brightspace, students must immediately re-download the uploaded file from the server and run it to verify file integrity and functionality.
Practical Problem-Solving Case Study: PowerPoint Processing
Context and Motivation:
Textbook selected: Automate the Boring Stuff with Python (free online resource linked under Brightspace "Other Resources").
Objective: Demonstrate practical benefits of Computer Science (answering why non-majors and majors take CS beyond degree requirements/employment).
Scenario Description:
The course material was distributed across \,individual PowerPoint (
.pptx) files.The instructor manually integrated updated reading assignments and suggested exercises onto Slide 3 of each file.
A colleague requested a single consolidated document summarizing all readings and exercises to synchronize offerings across sections.
Manual approach: Open \,files individually and copy-paste text from Slide 3 (\,times)—tedious, inefficient, and error-prone.
Programmatic approach: Develop a script to automate file parsing and text extraction.
The Four Steps to Problem Solving:
Understand the Problem: Conduct research and brainstorming. Identify technical prerequisites (e.g., determine if Python can interact with
.pptxfiles).Devise a Plan: Formulate high-level, language-independent design; impose structure on logic.
Carry Out the Plan: Write source code and implement the design.
Look Back / Reflect: Test execution, diagnose errors, refactor design, and maintain the system.
Implementation Steps of the Case Study:
Step 1 (Understanding): Researched Python libraries and discovered
python-pptx(PowerPoint parsing module). Found documentation example titled Extract all text from slides in presentation.Step 2 (Planning):
Loop through all presentation files in a designated directory one at a time.
Extract slide text specifically targeting Slide 1 (title) and Slide 3 (readings and exercises).
Apply text filtering (string processing) to remove headers, instructor names, and slide numbers, preserving only reading assignments and exercise lists.
Step 3 (Carrying Out the Plan via Divide and Conquer):
Decomposed the main task into three distinct, trivial sub-problems (Problem Decomposition / Divide and Conquer):
Sub-problem A: Iterate files in a directory (reused existing code snippet from an auto-marker tool).
Sub-problem B: Read text from slides using the library function.
Sub-problem C: Perform string filtering to delete unwanted text.
Step 4 (Looking Back & Errors Encountered):
Syntax Errors: Typographical errors in code grammar (e.g., incorrect API function call syntax).
Logical Errors: Program executed without crashing but extracted unexpected text blocks that had not been accounted for in initial filtering rules.
Iteratively resolved both error types to generate a final consolidated command-line output document.
Software Engineering Dynamics: Debugging, Flow States, and Environment Setup
Nature of Programming Errors:
Errors are an integral, required component of software engineering.
Writing hundreds of lines of code that run perfectly on the first try is unrealistic.
Syntax Errors: Grammatical mistakes in source code (e.g., missing brackets, typos, illegal punctuation).
Logical Errors: Grammatically correct code that executes successfully but yields incorrect results due to flawed reasoning.
Flow State ("The Zone") Trap:
Programmers frequently enter a flow state where time perception is lost.
Risk: Spending continuously tweaking broken code line-by-line without analyzing the underlying logical flaw.
Correct Strategy: Step away from the computer, analyze the design on paper, adjust the plan, and fix the root problem in .
Industry Reality Metric: Programmers historically spent coding and debugging; misuse of automated tools can result in spending generating code and debugging it.
Development Environment & Version Requirements:
Operating System: Student code is evaluated on Windows OS; submissions must run cleanly on Windows.
Python Version: Use Python 3.13.
Version Exception Warning: Avoid Python 3.14. Python 3.14 is too recent and lacks full compatibility with the multimedia/graphics library used in this course.
Development Tools (IDEs vs. Text Editors): Integrated Development Environments (IDEs) like Visual Studio Code are optional optimization tools. Plain text editors (e.g., Notepad++) are fully sufficient. Code can be written in any basic text environment.
Artificial Intelligence and Large Language Models (LLMs)
Technical Nature of LLMs:
Systems like ChatGPT and Copilot are Large Language Models (LLMs), not true artificial intelligence.
LLMs function as productivity tools designed to model conversational patterns, similar to interactive document templates.
Proper Mental Model for Working with LLMs:
Treat an LLM like an inexperienced high school student ( to \,years younger than an undergraduate).
Never assign an LLM a problem that you cannot solve manually.
Use LLMs only for sub-tasks where you can immediately evaluate and verify the output.
Mechanics and Vulnerabilities:
Conversational Modeling vs. Truth: LLMs do not possess intent, factual understanding, or an explicit desire to answer questions correctly. They generate text based on statistical frequency in their training data (what is plentiful, not what is correct).
Hallucination: When an LLM invents false information to make a response match expected conversational patterns (e.g., inventing citations for academic papers that real authors never wrote).
Security and Code Vulnerabilities: Blindly accepting AI-generated code introduces security flaws, malware injection via poisoned third-party library calls, copyright violations, and data leakage.
Course Policy on AI Tools:
Graded Work: Generative AI usage is strictly prohibited on all assignments, tutorials, midterms, and final exams (unless explicitly specified in an assignment prompt).
Specific Exception: One course assignment will explicitly require students to conduct and submit a transcript of a conversation with ChatGPT.
Ungraded Practice: Allowed for non-graded suggested exercises to compare personal solutions or interrogate concepts conceptually.
Theory of Computation: Algorithms, Languages, and Translators
Definition of an Algorithm:
Verbatim Formal Definition: A finite ordered set of unambiguous instructions defining a process that will eventually terminate.
Simplified Definition: A sequence of steps designed to accomplish a specific task.
Everyday non-computing examples: Recipes, equipment assembly instruction manuals.
Analysis of Instructions (The Paper Airplane Case Study):
Example of Bad Instructions: Step 1: Three colored sheets of paper. Step 2: A single mountain fold past center. Step 3: A completed plane.
Flaw: Extreme ambiguity and oversimplification. Unambiguous instructions must leave zero doubt about the precise step to execute at any given moment.
Core Properties of Algorithms:
Finite: Consists of a countable number of discrete steps.
Ordered: Must be executed in a strict, deterministic sequence.
Unambiguous: Instructions are clear, precise, and completely unambiguous.
Terminating: The execution must stop after a finite number of steps without trapping the interpreter in an infinite loop.
Hierarchy of Languages:
Natural Language: Languages used for human-to-human communication (e.g., English, French, Spanish, Mandarin). Unsuitable for direct machine execution.
Pseudocode / Flowcharts: Structured, language-independent intermediate representations of logic.
High-Level Programming Languages: Artificial languages designed for human readability while maintaining formal structure (e.g., Python, Java, C++). Python is classified as a general-purpose, high-level language.
Low-Level / Machine Language: Binary or hardware-specific instruction sets used directly by electronic components. High-level code must be translated into machine language for hardware execution.
Translators: Compilers vs. Interpreters:
Installing a programming language actually means installing a translation program (compiler or interpreter).
Interpreter: Translates and executes source code dynamically, one statement at a time (analogous to a live spoken-language translator).
Compiler: Reads, translates, and converts an entire source code file into machine language at once prior to execution (analogous to translating an entire book).
Python's Translator Architecture: Uses a hybrid compiler-interpreter mechanism (compiles source code into intermediate bytecode, which is then interpreted).
Algorithm Design vs. Coding:
Computer programs (software solutions) are machine-executable representations of algorithms.
Algorithm design is entirely independent of specific programming languages.
Proper Workflow: First solve the problem and design the algorithm at a high level; subsequently select the programming language best suited to implement that specific algorithm.
Questions & Discussion
Question on Python Versioning:
Prompt: A student asked about having Python 3.14 installed when Python 3.12/3.13 was mentioned.
Response: Uninstall Python 3.14 and install Python 3.13. Python 3.14 is too recent, and the multimedia/graphics library utilized throughout the course does not yet support version 3.14.
Question on Exam Durations:
Prompt: Clarification on the length of midterms and the final exam.
Response: Midterm quizzes are long (accessible within a window). The final exam is long (accessible within a window).
Question on Completion Speed for Exams:
Prompt: How long will exams realistically take for students who pay attention?
Response: Allocated time is deliberately generous to accommodate students with zero prior programming experience. Students with prior experience typically finish much faster.
Question on Academic Accommodations:
Prompt: How are extra time accommodations managed for online exams?
Response: Time multipliers are managed directly through the Paul Menton Centre (PMC) for Students with Disabilities and applied automatically to Brightspace tests approximately one week prior to the exam date.
Question on Operating Systems:
Prompt: Is a specific operating system required for coursework?
Response: Marking is performed on Windows, so code must execute on Windows. Specific platform questions should be posted on the forum or sent via email.
Question on Instructor Availability:
Prompt: How are meetings with the instructor organized?
Response: Office hours with the instructor are held by individual appointment via email. Additionally, \,TAs hold regular drop-in office hours across the week as listed on Brightspace.
Question on AI Benchmarking:
Prompt: Can AI be used to benchmark or compare against personal code?
Response: Forbidden for any graded assignment or assessment. Allowed for non-graded suggested exercises as a private study tool.
Question on IDE Requirements:
Prompt: Is Visual Studio Code mandatory?
Response: No IDE is mandatory. Code can be written in a plain text editor like Notepad++ without installing complex development environments.