CSE 701: Foundations of Modern Scientific Programming
McMaster University, Fall 2024
Course Logo

Table of contents

Course overview ^

CSE 701 is intended to give the students a good understanding of computing, solid programming skills in C and C++, experience with debugging, optimization, algorithm design, and numerical calculations, and the ability to produce high-quality and well-organized scientific software, both on their own and in collaboration with others. Please see the table of contents of the lecture notes for a detailed outline of the course.

This is an advanced graduate-level course, and is not intended to be a first introduction to programming. Therefore, students must possess basic prior knowledge of some programming language (any language will do) in order to take this course.

Course syllabus ^

The course website also doubles as the course syllabus. If you need the syllabus in PDF format, simply click here to print it and choose "Save to PDF".

About the professor ^

The professor for this course is Dr. Barak Shoshany (ħe/ħim). I did my BSc in mathematics and physics at Tel Aviv University in Israel and my MSc and PhD at Perimeter Institute for Theoretical Physics in Waterloo, Ontario. I then taught at the University of Toronto for a short time. I joined Brock University as Assistant Professor in September 2020, and I also regularly teach scientific computing at McMaster University.

I am a theoretical, mathematical, and computational physicist. My research focuses on the nature of time and causality in general relativity and quantum mechanics, as well as symbolic and high-performance scientific computing. I'm always happy to talk about my research, and theoretical physics in general, so please feel free to ask me about it, both in and out of class!

I also love teaching. I developed 10 full-term undergraduate and graduate courses from scratch since 2020, including 5 physics courses, 3 astronomy courses, 1 scientific computing course, and 1 mathematics course. My devotion to teaching won me the Brock University Faculty of Mathematics & Science Award for Excellence in Teaching in 2023.

When I'm not teaching or doing research, I love composing music, playing video games, board games, and tabletop role-playing games, and reading or watching science fiction and fantasy. Please see my personal website for details on my research, teaching, talks, media interviews, music compositions, and more.

Contacting the professor ^

I will hold my office hours immediately after every lecture; I will not physically be at the university at any other time. You are strongly encouraged to attend the office hours if you want to talk about anything related to the course.

The best way to ask questions about the material outside of class and office hours is to post them on Microsoft Teams so that other students can also see the question and add their own answers. I will answer any question posted on Teams as soon as I can.

For personal matters, please do not hesitate to email me directly at shoshanb@mcmaster.ca. If you need to meet outside of class and office hours, please let me know and we can schedule a video chat on Teams.

Schedule and logistics ^

The course will take place during the Fall 2024 term, from September 3 to December 5, 2023. The lectures will take place in person at room ETB 227 in the Engineering Technology Building. There will be one 2.5-hour lecture every week:

  • Mondays 11:30-14:00.

The following lectures will be canceled:

  • Monday, September 23, due to the professor attending a conference abroad. There will be a makeup lecture on Thursday, December 5, at 14:30-17:00, at room BSB 104 in the Burke Science Building.
  • Monday, September 30, due to National Truth and Reconciliation Day. There will be a makeup lecture on Monday, December 9 at the usual time and place.
  • Monday, October 14, due to Reading Week.

We will have a total of 12 lectures and 36 lecture hours. For your convenience, here is the full list of lecture days, times, and locations:

  • Lecture 1: Monday, September 9, 11:30-14:00, PC 335 (note: this was before the room changed to ETB 227)
  • Lecture 2: Monday, September 16, 11:30-14:00, ETB 227
  • Lecture 3: Monday, October 7, 11:30-14:00, ETB 227
  • Lecture 4: Monday, October 21, 11:30-14:00, ETB 227
  • Lecture 5: Monday, October 28, 11:30-14:00, ETB 227
  • Lecture 6: Monday, November 4, 11:30-14:00, ETB 227
  • Lecture 7: Monday, November 11, 11:30-14:00, ETB 227
  • Lecture 8: Monday, November 18, 11:30-14:00, ETB 227
  • Lecture 9: Monday, November 25, 11:30-14:00, ETB 227
  • Lecture 10: Monday, December 2, 11:30-14:00, ETB 227
  • Lecture 11: Thursday, December 5, 14:30-17:00, BSB 104 (note: different day, time, and room!)
  • Lecture 12: Monday, December 9, 11:30-14:00, ETB 227

Students should bring their laptops to class, in order to run code examples during the lectures by copying and pasting from the lecture notes. However, this is not mandatory, as some students may prefer to focus on listening to the lecture itself and run the code examples on their own time later.

Please make sure to bring your laptops to the first lecture, as we will be installing the software required to take the course (IDE and compiler), and I would like to make sure every student is able to install the software successfully during the lecture.

Note that some of the lecture time may be used for exams. If you plan to miss a lecture, please make sure there is no exam scheduled for that lecture!

Lecture notes ^

There is no textbook for this course. The official course lecture notes, written by the professor, contain everything you need to know. They are available to view directly on this website in HTML format.

View the lecture notes
(HTML format)
Last updated: 2024-09-11

I originally wrote these notes while teaching this course in 2020, and they were updated and expanded every year since then. I will continue to update them as needed this year as well. The lectures in this course will follow the notes very closely. If you choose to download the notes for offline use, please make sure to always have the most up-to-date version.

IDE, compiler, and linters ^

Throughout the course, we will exclusively use the latest 64-bit versions of:

They are cross-platform and work on all common operating systems (Windows, Linux, and macOS) and CPU architectures (x86 and ARM). Instructions for installing and using them can be found in the lecture notes, and will also be given in the lectures.

To ensure maximum compatibility with the code written by the professor, students are asked to always use the recommended IDE and compilers, and ensure that they are always updated to the latest versions. Please note that the professor cannot provide technical support to students who do not use the recommended IDE and compilers.

In addition, it is highly recommended to use static code checkers, also known as "linters", to check for common programming mistakes in your code. The two tools I recommend the most are:

  • Clang-tidy, which is bundled with the official C/C++ VS Code extension.
    • To enable it, search for C_Cpp.codeAnalysis.clangTidy.enabled in the settings.
  • Cppcheck, which is bundled with the cpp-check-lint VS Code extension.
    • However, make sure to disable the cpplint tool, which is also bundled with the same extension, by disabling the setting cpp-check-lint.cpplint.--enable. The reason is that cpplint is used to check that your code satisfies the Google style guide, which is not useful unless you work for Google.
    • Note that the bundled version is not the latest version. You can download the latest version of cppcheck here.

Exams and final project ^

Exams

There will be two exams during the term. Each exam will test the students' understanding of the material learned up to the exam date. The exams will be given in person during lecture time. You will be notified about the exam dates and material in advance.

The exams may contain some conceptual questions, and may also ask you to analyze or write short pieces of code, up to and including complete programs. All answers, including code, must be written with a pen or pencil on the exam forms; you will not be able to write the code on a computer.

Once the timer starts, you will have exactly 1 hour to solve the exam. If you are late to the exam, you will not get any extra time, so please make sure to be at the exam room at least 15 minutes before the beginning of the exam.

Practice exams

Here are practice versions of each of the two exams. Please solve them as practice for the real exams, and to get an idea of how the exams will look like.

Allowed material and academic dishonesty

The only allowed material during the exams is my lecture notes, in printed form. The notes can be printed directly from this website. To save paper, please print the notes double-sided, with 2 (or even 4) pages per sheet, with the smallest possible margins, and only the specific chapters that are relevant to the exam (a list will be provided). You are not allowed to write anything on the printed notes or modify them in any way before or after printing, but you can use a highlighter.

Computers, phones, tablets, smart watches, and other digital devices cannot be used during the exam. Any students found using a digital device of any kind or modified notes during the exam will be charged with academic dishonesty.

Missed exams

If you miss an exam, please email me within 7 days of the exam. Your email should explain why you missed the exam and include any necessary proof, such as a doctor's note. If your proof is acceptable, we will schedule a day and time for you to take the exam. Of course, you will be forbidden from asking other students about the contents of the exam, which will lead to an academic dishonesty charge.

If you do not email me within 7 days, or your reason for missing the exam is not acceptable, your grade in the exam will be zero.

Final project

In addition, there will be a final project at the end of the term. The final project will require you to write a complete C++ program according to requirements set by the professor. The project description and guidelines can be found at this link.

Grading

Each exam will be worth a third of the final grade, and the final project will be worth another third. After the average is calculated, it will be rounded to the nearest integer, with .5 rounded up. A final grade of 70% or more is required to pass the course.

How to succeed in the exams ^

To succeed in the exams, please make sure to:

  • Attend all the lectures and actively participate in them. If something is unclear, ask for a clarification. If a topic inspires you to ask a followup question, ask it. If I ask the class (or you personally) a question, do your best to answer it. In my experience, the students who participate the most in class are also the students who get the highest grades in the exams!
  • Thoroughly read and understand my lecture notes in order to revise and get a better understanding of what I said in the lectures. This is especially important if you missed a lecture. Also, please note that anything in the lecture notes can appear in the exam, even if I did not cover it directly in the lectures, unless explicitly stated otherwise.
  • You cannot learn to code just by attending the lectures or reading the lecture notes! Writing your own code, experimenting with each new concept we learned, and spending time writing full programs to solve concrete real-world problems (e.g. related to your research) is absolutely crucial for your success in the course.
  • Solve the practice exams posted on this website. They are meant not only to help you practice for the exams, but also to test your general knowledge and understanding of the material.
  • Make use of your greatest resource in this course: the professor. I am available to you during the lectures, during my office hours, on Teams, and by email. Don't be shy to ask for help if you need it - that's what I'm here for!

Intellectual property notice ^

Any and all course materials created by the instructor in this course, including but not limited to notes, slides, homework problems, homework solutions, exams, exam solutions, and photo, audio, and/or video recordings, are the intellectual property of the instructor.

Any student who, without the instructor's express consent, publicly posts or sells the instructor's work, or takes a photo, audio, and/or video recording of the instructor's lectures, will be charged with misconduct under the university's Academic Integrity Policy and/or Code of Conduct, and may also face adverse legal consequences for infringement of intellectual property rights.

© 2024 Barak Shoshany