ESC180: Introduction to Computer Programming


99 little bugs in the code

99 little bugs

1 bug fixed, run it again

100 little bugs in the code

Photo by Emile Perron on Unsplash

ESC180 is an introductory computer programming course. The course is taught with the assumption that students have no prior experience in programming. Python will be the only programming language used for this course.

You’ll start by covering fundamental programming concepts, including functions, conditional statements, syntax, and loops. You’ll use these basic concepts to create simple programs, ultimately learn more advanced concepts such as Python data structures and recursion and be introduced to features of computers such as memory storage and time complexity. For assignments, you’ll be writing your own code for interesting applications, practicing the skills and theory from class.  

For experienced programmers, much of this course will be repetition. For newer programmers with less experience, this course will require regular practice to build a new skill set.  


Professor

Professor Michael Guerzhoy [Source]

Professor Michael Guerzhoy

Michael Guerzhoy (pronounced “GER-joy”, with a hard “g”, and with the “j” pronounced like the “s” in “measure”) is teaching both ESC180 and ESC190 this year. He graduated with an Honours Bachelor of Science from the University of Toronto in Computer Science, Mathematics, and Statistics. He went on to earn a Master’s degree in both Computer Science and Statistics. Professor Guerzhoy has taught courses at the University of Toronto for quite some time, including this course in multiple years. He then moved to Princeton where he worked as a lecturer in the Center for Statistics and Machine Learning. In 2021, he returned to teach computer science in EngSci. 


Course Highlights

  • Discovering Python is not a snake; it’s the programming language you’ll be using for this course.
  • That eureka moment when your program works after spending hours debugging it.
  • Generating code that solves a big, real-life problem with very basic concepts. 
  • Figuring out how recursion works!
  • Participating in some programming competitions hosted by Prof. Guerzhoy!

Life of an ESC180 Student

Classes

There are typically three hours of ESC180 lectures per week. There are no tutorials, so be sure to pay attention during lecture! The professor will explain programming concepts and go through example code. Ensure that you attend every lecture, because there will be multiple quizzes throughout the semester! 

There are no tutorials for this course. ESC180 practicals are weekly 3-hour slots held in the Engineering Computing Facility (ECF) Labs. Here, you will work in pairs on assigned programming labs, getting feedback from TAs if needed. 

There are recommended exercises for beginners, which you really should do if this is your first time coding. They will help you catch up with coding in no time. For now they are optional, but they may become mandatory.

Assessments

ESC180 has two types of assignments: labs and projects

Labs are released weekly, and you have three hours to complete them. You will be challenged to program functions that complete specific tasks. The labs can be long and difficult, but they are very beneficial. Try to complete all of them: it is the best way to prepare for the midterm and final exam. They will give you an opportunity to practice coding and build on your programming skills. All labs are graded by TAs, who are also there to help if you get stuck. Don’t be afraid to ask for help, especially if this is your first-time programming. According to the syllabus, “teams that make their best effort toward completing the lab will be awarded full credit.”  
 
Projects are longer than labs and are typically assigned 3-4 weeks before the due date. They are more difficult because their scope is larger. Instead of writing one standalone function, you need to write at least 4-5 functions that accomplish a broader goal. For example, you might need to track a fictional person’s physical activity and happiness levels or build a program that predicts its opponent’s moves in a board game. You may choose to work with a partner on projects. Projects will be automatically graded on Gradescope based on many programming test cases.  

ESC180 usually has a midterm and a final. In these exams you will be asked both conceptual and programming questions. For questions that require you to write code, you will have to do so using pen and paper. The code you write in the exams will be more conceptually challenging, although it will not be as long as code from labs. The challenge is writing it quickly and without external aids. Keeping up with the labs and practicing throughout the semester will reduce your prep time, and past exams are a great source of practice problems.   


How to Succeed

Quick Tips & Equations

  • Know your “if” statements, “for” loops, and “while” loops

  • Indexing Python arrays starts at 0, not 1. This is good to remember because you will be learning MATLAB at the same time, where indexing starts at 1.

  • For assignments (and programming in general) ensure that you have thoroughly debugged and considered boundary cases. If your program produces an error on a boundary case, you will likely fail that particular case, and if your program does not compile at all, you will not receive any marks for the assignment!  

More Details

It is totally okay to come into EngSci not knowing how to code yet! Even if ESC180 is your first exposure to programming, you can do well in the course. You will not be alone, and there are many online resources, as well as upper years/peers who will want to help you.

We recommend starting ESC180 projects as soon as they are released. They require a lot of thought and iteration; they cannot be completed in one go, the night before the due date. You will need to brainstorm a solution, try it out, debug, and probably try again. Don’t be fooled by the “simplicity” of the problem statement: even if a function seems easy to write, it might take you several hours to debug.

Some experienced programmers can write their code immediately after seeing a problem. However, we recommend that beginners write an outline in pseudo-code before writing any code. Pseudo-code refers to an informal version of code, written in words explaining what your program does. Plan how your functions will interact and what they need to do to achieve your desired result. This way, you’ll avoid making mistakes, writing unnecessary code, and confusing yourself. Planning and sketching things out on paper is especially important when tackling projects.

Complex programming problems are often difficult to solve using one function. However, they become significantly simpler if you break the problem into smaller sub-problems. You can solve each of these sub-problems with different functions, called “helper functions.” You can then put everything together to obtain a final solution.  Helper functions might be very useful on ESC180 projects!

Everyone wants to write short and efficient programs. However, focusing too hard on elegance or efficiency can stop you from making working code. Always make a program that can produce the results you need before you take it apart to make it more efficient or less ugly. Even professional software developers often show that their initial method works before making small improvements. 

Labs will be released a few days before the practical, so you get a chance to attempt them before asking your TA questions. Always attempt the labs! If you’re stuck on one for too long, take a break and ask your TAs and peers for help. They’re meant to be finished within a certain time frame (about three hours) but getting stuck is completely normal. Sometimes it can be a simple error or a trick you don’t know that prevents you from completing them. If you miss a deadline, don’t stress. Labs are great practice, but you have five other courses with larger assignments to manage. Use your judgment!

Aside from the midterm and the final, you will almost always write and practice coding on an IDE (Integrated Development Environment). While you may become very good at writing, debugging and running code this way as you do the labs, solving problems with just pen and paper without being able to test or debug them on an IDE is a completely different experience. During labs, you may get into the habit of writing, running, and debugging code line-by-line; however, during exams, you will have to go through the program you have written line-by-line in your head and identify the errors yourself. So, it is important to practice without an IDE regularly, so you are better prepared for written assessments along with the labs and projects.

Like any other skill, it will take time and practice to become comfortable at programming. You’ll make mistakes and feel frustrated when you don’t know what to do. The key is regular practice. Looking at code will not be as useful as writing code on your computer. Without actual practice, it’s impossible to improve. Experimenting is the best way to learn coding. You’ll learn to use many useful methods and tools by playing around with code.


Beyond First Year

Through ESC180 you’ll learn how to think like a programmer. You will be introduced to several programming problem-solving techniques. These include sequential, functional, iterative, and recursive programming.

  • Sequential: In basic programming, the computer follows a set of instructions one after the other. By thinking sequentially, the programmer tells the computer what information to save when moving between steps and in what order.

  • Functional: You’ll often need several small, independent functions in your program that come together to solve a problem. Thus, you need to think about the individual components of your problem and how multiple smaller functions can be combined to solve it.  

  • Iterative: By using loops in programming, you can repeat an action as many times as you need to solve a problem. You must therefore understand how to create solutions using these iterative techniques.

  • Recursive: In some cases, it is impractical to solve a problem iteratively. That’s when recursion comes in handy. Recursion is a method in which you break down a larger problem into its smallest subproblem that has a direct solution. Since the solution to the larger problem depends on this direct solution of the smaller subproblem, your program breaks down the large problem, and once it finds the smallest subproblem, it works its way forwards with the solutions from each step. You have then found a solution!

Programming is one of the most essential skills in science and engineering today. Many technical courses will either use programming or teach you to program, and you can always use programming to simplify calculations in assignments and labs. Many internships and jobs require programming experience, so it’s great that EngSci provides a solid introduction in first year. 

Note: The course code for Introduction to Computer Programming used to be CSC180. You may still see it referred to as such on some websites (e.g. courses.skule.ca).