TDDD38 Advanced Programming in C++
How to study for the course
TDDD38 is a so-called self-study course. This means that the course doesn't have any mandatory handins or assignments. Every scheduled session is therefore optional to attend.
This type of course puts a lot of emphasis on your own discipline and planning so it is your responsibility to actually learn the content of the course. There are several resources available to aid you in this endeavour, for example: lectures, seminars, assignments, quizzes, office hours etc.
Most other programming courses — at least at this department — are structured in a different way compared to this style of course. This makes it quite likely that a lot of students lack the necessary insight for how one best learns the content.
The aim of the course is not to retain information, or to memorize patterns, it is to learn how to apply the tools presented in the course to real-life programming. The aim is to evolve as a programmer, and you cannot do that without proper study techniques and strategies. This page will present a general outline for how to best study for the course and the exam. This presented strategy is not necessarily a good fit for your particular circumstance, but more than likely some of the points presented here will help you improve your efficiency when studying.
In the text below certain sections will be bolded, these are important things that you should keep in mind. They are bolded to help you review this page and help you navigate all the information presented here. It is NOT a way for you to avoid reading everything, but rather a tool for helping you keep on track.
If you find the bolded sentences to be distracting you can toggle them with this button:
Contents
Strategy during the course
It is important to keep up with your studies over the whole duration of the course, especially since this course primarily focuses on the craft of programming. It is more about skills than knowledge, i.e. the course focuses more on what you can do rather than what you know. To actually learn and digest new programming concepts and tools you need practical experience. But just doing isn't always enough, because you need time to digest and fully solidify the skill, which can't be done during a short period of time. Because of this it is highly recommended that you put in around 10 hours of work each week (including attending lectures and office hours).
Just putting in the time isn't enough though. You have to use your time efficiently, i.e. the time you spend must be meaningful. For your studies to be efficient you must challenge yourself. If you only do things you are already comfortable with you are probably not developing your skills. Please do note that "challenge yourself" doesn't necessarily mean "do things that are hard".
Activities that are recommended during your weekly studies are the following:
- Attend seminars
- Attempt the weekly multiple-answer quiz for the weeks seminar
- Solve exercises related to the seminar
- Solve exercises a different way than you did before
- Attend office hours to get answers to questions that have accumulated during the week (pros/cons of different solutions?)
Below you can find some suggestions for how to approach these activities as well as ideas for how to best utilize the resources available to you. Note that these activities are the primary tools for learning within the course, but there are also things you can do outside the bounds of the course which is briefly discussed under the "Other" section below.
Seminars & Quizzes
The seminars/lectures serves as the primary information gathering resource of the course. Here we will present and discuss the main topics of the course. Because of this it is recommended to attend the seminars and participate in the discussions and polls. Make sure to ask questions whenever one arises.
Once the seminar is over you should — as soon as possible — attempt the associated quiz on the course webpage. If you are unsure about anything in the quiz, write down what you were unsure about. During this process you should check your notes and the published slides to see if you can figure out the answer through that. This way you familiarise yourself with the topic while also reviewing what was covered, thus helping the knowledge stick better in your mind.
Exercises
The exercises associated with each seminar are purposefully designed to demonstrate how the concepts presented can be used. Because of this you should view the exercises as an extension to the seminars, since during the seminars we often cover the what and why of certain topics, but the how is mostly covered in the exercises.
Solutions are available for each exercise. Do not look at the solutions until you have independently solved the exercise yourself. It is one thing to understand the solution, and a completely different thing to be able to produce the solution, but your mind can easily trick itself into equating those two things, i.e. it is very easy for your mind to think "Oh that is how you do that, great! Now I know how to do it in the future!". But that does not further your skills, it only furthers your knowledge which generally doesn't help you to solve different problems using the same tools. In particular, it doesn't help you during the exam, since the exam presents new assignments each time.
When doing the exercises you are free to use any resources available to you to further your learning, but make sure that you yourself understand every nuance in your solution. If you for example get inspiration from StackOverflow or find a piece of helpful code online, it is important that you understand what that piece of code does, why it is written the way it is and what consequences it has for the rest of your code. If you don't understand those things and can't seem to figure it out, write it down in a list of things you want to understand (this list will be important later).
Using generative AI can be a great tool to find different ways to solve problems, but you have to be very careful. A generative AI can — and often does — generate inefficient, incorrect or even incomprehensive code. So you have to be very observant on what it actually does. Check each piece of the code and if there is something you don't understand or find strange, try to understand it. If not, write it down in your list.
There are quite a few exercises available. The idea is not that you should solve all of them, but instead you should solve the ones that seems the most challenging for you. Each week, read all the exercises and make a ranking of them based on how well you think you can solve them. The one that seems the most challenging for your current skills should always take the highest priority. Solving problems you currently are struggling with is where you will learn the most in the shortest time.
Office hours
A couple of times a week there are "Office Hours" scheduled in the course. These are times when the teacher will be available for questions and discussion. This is the best place to get answers to the things you couldn't figure out yourself. Each week, show up to at least one of these sessions with your list of questions and things you are unsure about.
Anecdotally it has been observed that students who frequently attend office hours with meaningful questions tend to do much better at the exam than students who: 1) don't attend at all, 2) only show up to ask knowledge-based questions (i.e. without having explicit questions about the work they've done themselves).
Office hours is generally the best place to get answers since 1) it is based on human-interaction with a teacher which means you can get explanations tailored to your personal needs and you can ask meaningful follow-up questions and 2) the teacher is the one who will examine you and can therefore guide you towards the things that are most relevant to the course. It is of course important to be able to find answers on your own, but no one is alone in the world. Technology is a combined effort, nothing is ever achieved by trying to do everything yourself. It is a highly desirable skill to be able to ask others for help, so please do utilize these sessions for your own good, you will always learn something. Students who attend the office hours don't regret it.
Other
There are many resources for learning C++ online. YouTube, StackOverflow, cppreference.com etc. are all great resources for acquiring knowledge. But as discussed previously, this course focuses on skill over knowledge. This means that primarily using information resources will not be enough. Of course they can be immensely helpful as an initial step for each topic but aren't sufficient.
It is quite easy to trick yourself into feeling productive when you passively watch/read these types of resources. To combat this you should limit the time you spend each week on gathering knowledge.
External resources can also be tricky since they might contain out-dated or factually incorrect information. Because of this it is of utmost importance that you view everything (including the course content of course) with a sceptical lens. Reflect on why something is done, and importantly what consequences it has. Think about which situations the presented information would be useful in.
If you are able to utilize external resources in this manner then they are an effective tool for your learning, but using external resources is riddled with traps for inefficient learning, so you should always reflect on whether you can actually apply the concepts you've learned.
It is not just online resources that fall into the category of resources outside of the course. There are other things that can be relevant. For example:
- Other adjacent courses. Many students take courses such as TDDC78, TDDD56, TDDD95 and a wide variety of other courses. In these courses you can use and practice the skills you develop in this course. Don't think of this course as an isolated entity, the contents are wide and can be applied in many situations outside of TDDD38.
- Personal projects is a great way to further your own skills. If you are working on something in your free-time, why not try to apply the concepts from this course?. If you are interested in starting a personal project in order to help you stay motivated to learn the topics of this course, but you don't know what to do here are some suggestions that might inspire you: a linear algebra library, a computer graphics renderer, some type of game engine, a custom standard library, an interpreter for your own custom programming language, a serialization framework, an Entity-Component-System framework, a Regex engine that can operate on any sequence of objects (not just characters), a simple computer algebra system, a custom database system, and so on. The options are endless, it all depends on your personal interests.
- Challenge sets, for example Advent of Code, Kattis, LeetCode, Project Euler, UVA Online Judge etc. For some of these challenge sets it might be hard to apply the specific topics of this course, but if you try to think a bit more generic than the specifics of the problem you should be able to apply many things.
Do note that none of these things must be done in order to complete the course, but if you have an interest for these things then it can be a great tool to aid in your studies.
Optional Midterm test
At about the halway point of the course there is an optional midterm test given. Please do your very best to attend it, since this is the perfect place to actually test your skills, and by extension how well your study strategy has worked so far. Since this test is given at the halfway point it is a prime opportunity to make changes to your strategy if it is needed and still have time to learn the course. If the test didn't go as well as hoped, please think about how you can change your strategy during the second half of the course.
Strategy for studies before the exam
In a perfect world the main bulk of learning should take place long before it is time to study for the exam. But of course, studying for the exam is a perfect place to fully test how well you've learned the skills necessary for the course.
During your studies for the exam you should of course review all lectures, seminars and excercises to refresh your mind on everything you've done during the course, but that isn't enough. You need to fully solidify your practical skills when it comes to using C++ and the concepts introduced during the course. There is also a second aspect which you've likely not yet practiced: how to actually write the exam.
The exam setting is designed to be as close to a "real-world" programming environment while still being a proper examination. Because of this, the exam setting can be quite artificial in comparison to how you've worked up until this point. When you study by yourself you can use any tools you desire, i.e. any editor, compiler, IDE and debugger, but also any online resources. You can also talk to other people like your peers, the teacher and so on. And you can take as much time as you need to solve each assignment. These things are much more constrained during the exam. Because of this it is important that you train yourself to actually perform in these restricted conditions.
One of the most effective strategies for studying is to emulate the exam setting. It might seem artifical since the purpose of the code is to become a better programmer, not to be able to write the exam. But it is inescapable that an exam will be somewhat artifical since it is about examining students skills. The idea is of course that students who are very familiar with the topics of the course, and students who have developed the required skills will be able to pass the exam without much trouble. But reality is often more complicated than that. It is unnatural to expect yourself to be able to perform in any environment, especially in such a stressful and uncomfortable environment as an exam. So to give yourself better odds at performing at your peak, you should make yourself as comfortable and familiar with the exam setting as possible.
Emulating the exam setting
In this section we will discuss how you can make yourself comfortable with the exam setting. There are a few aspects that make an exam unnatural, specifically:
- The time constraint. During the exam you have a hard time limit, so it is important that you learn to utilize this time efficiently. It is also important to make yourself comfortable with working under the pressure that a time limit often imposes.
- The limited selection of tools. The exam is given in the SU labs, on Linux systems with a restricted selection of editors and compilers. If you are not too familiar with these tools during the exam you will be severly disadvantaged. So it is important to know how to work with the available tools.
- The restricted information and communication. The only information resources you have during the exam is the reference section of cppreference.com (the exam variant of cppreference.com can be found here), and the only people you can communicate with is the examiner and/or teacher, so you must be able to work with the limited information available.
- The pressure to perform. The exam setting by nature will impose a pressure on you to perform. It is your one chance to show what you've learned and that will easily be quite stressful. We are all people so these types of pressures will often make our performance worse rather than better. So it is important that you train yourself to perform even during pressure.
The recommended way to combat these factors is to frequently emulate the exam setting during your studies. To do this follow these steps:
-
Prepare an environment where you can work undisturbed, free of distractions. This can be done in several ways depending on your circumstances:
- If you live in a space with multiple rooms you should use a separate room than the one you usually study in. Prepare a desk or table if possible and keep it as free from clutter as possible. If you cannot prepare a separate room with a table then try some of the suggestions below.
- If you must use the same space you usually study in, then change something about the space. This can be something as easy as you having a desk lamp that you only turn on when you emulate the exam or removing certains items from the desk. It can also be that you sit at a different part of the desk. Maybe you can change the chair you use? If you have a desk with adjustable height you can use that. The main idea at least is to make the space a bit different than what you are used to, primarily to put yourself in a different mindset.
- If you are unable to change the space you study in then you can change aspects about your situation. Maybe you usually listen to music while you study? Then remove that aspect from your study session when you emulate the exam. Maybe you usually have a specific type of snack or drink while you study? Then change your snacks, or maybe even remove snacks entirely (or the other way around, if you usually don't have any snacks, then introduce some type of snack). Many people tend to use differently flavoured gum for similar purposes. Maybe you can introduce some piece of clothing that you usually don't wear while studying? The possibilites are endless and it is encouraged to experiment a bit.
- Change the time of day when you study. If you usually study right after you wake up, then try to emulate the exam before you go to bed instead (or the other way around).
- Maybe change where on campus you sit to study. If you usually go to Studenthuset, try instead to go to the B or C building. Maybe change which SU lab you sit in, and so on.
The purpose of this is to make the environment a bit unfamiliar as this will ensure that you practice your mind to perform in different environments.
- Allocate a certain amount of time where you will work without breaks. This can for example be an hour where you commit yourself to solve a specific problem, assignment or excessive. You could allocate five hours to fully emulate an exam, but that is intimidating enough to postpone forever. Rather do several shorter sessions with limited time on just one assignment.
- During the allocated time, commit yourself to only use cppreference.com (exam variant) as an external tool. Don't look anything up elsewhere during the allocated time. If you get stuck, then try your best to get unstuck. The purpose here is to develop a personalized strategy for how you should operate during the exam. It will also make it blaringly obvious what gaps you have in your knowledge or skills. But remember don't look anything up until after the allocated time.
- Pick one of the prevous exams published on this page. These are all exams that has been given in the past, together with solutions for the practical programming assignments, which means they will be representative of what type of assignments you will be solving during the actual exam. It is very important that you try your very best to solve these assignments without ever looking at the solutions. The solutions should only be used as a self-assessment tool, meaning you should only use them to compare with your own solution. The published solutions are NOT a learning tool. As previously discussed: it is very easy for your mind to trick itself into thinking it is capable of producing the said solution. But understanding a solution and being able to produce a solution are completely different skills.
- Only use the tools available during the exams. That is: try to use a Linux terminal for compilation, using g++ or clang++ as your compiler. Only use Visual Studio Code, emacs or vim as your text editor. Avoid using any particular plugins for your editor. Make sure you are comfortable using these tools since you don't want to get stuck on basic things during the exam.
- When you are solving the assignment make a note every time you get stuck for more than five minutes on one particular problem. After the allocated time is done, reflect on why you got stuck on the particular things you got stuck on. The reason might range from "I wasn't operating at peak performance and forgot basic things" to "it seems I don't know this topic as well as I thought". Once you have identified which problems were caused by gaps in your knowledge, you now know what topics you should focus on during your "normal" studying.
- After the allocated time is over, think about what went well and what didn't. Think about how you could change your strategy to make sure you perform better the next time you emulate an exam. Identify what areas you should focus on moving forward.
How frequently you emulate the exam is up to you and entirely based on how well you perform during these emulations. You should try it at least once for a full exam. If you choose to do it for one consecutive five hour period or if you split it up into multiple sessions is up to your preference. If you encountered no problems what-so-ever during the emulation then you probably don't need to practice in this environment often. But if you struggled, you should probably make these emulations a frequent part of your studies.
The frequency of your emulations should probably increase as you get closer and closer to the actual exam date, since you will become more and more nervous as the exam approaches.
How to practice before the exam
Besides emulating the exam, there are other things you should do to properly prepare. Mostly it boils down to reviewing all the things you've done during the course, like going through all lecture notes, working on exercises and reviewing all the questions you've accumulated during the course.
It is likely a good idea to practice your C++ skills on all the excersises you didn't do during the duration of the course. You could also practice using assignments from previous exams. But remember to leave some of the previous exams for your exam emulations.
The most important thing to keep in mind here is to actually practice your programming. Passive consumption of course content will NOT be enough. Don't just read the slides, watch videos, look at the solutions for assignments etc. You MUST practice programming on your own. Of course, passive learning is a crucial part to, but it should only serve as a way for you to get enough information to start solving assignments.
You should also continue collecting questions and trying to find answers to them. It is also a good idea to E-mail the teacher the questions you weren't able to find an answer to by yourself. Remember that be able to find answers on your own is a skill you should practice, so don't be too quick to ask the teacher.
Strategy during the exam
Being properly prepared is of course the most important factor that plays into whether a student will pass the exam. But there are other factors that will play an important roll. We have so far covered how to prepare your skills, knowledge and mental state. But another major factor that we haven't covered yet is how to actually approach the exam once you are in the exam setting.
There are many different ways to structure your approach to writing the exam and hopefully you've managed to find something that works for you while emulating the exam environment. But nonetheless, there are some universal things that you should keep in mind while writing the exam.
How to pick which assignment to focus on
Once you have the exam PDF available you should first and foremost read through all the questions. You've probably heard this suggestion a million times during your life, but it is worth repeating. If you don't know what assignments there are, how can you possible pick which one to start with? Of course you can always do them in order one at a time, but that is generally unfavorable due to time constraints. Time is a finite resource during an exam and how you spend that time matters a lot. Because of this it is of importance that you allocate time based on your own personal skills and preferences. If you are particularly comfortable with a specific topic then any assignments relating to that will likely take less time than those that cover topics you are less comfortable with.
Once you've read throuh all the assignments, try to rank the assignments based on how much time you think you need to spend on them. You don't have to make an estimation for how long they should take, but rank them relative to each other. For example "I think assignment #5 will be quicker than assignment #3" etc. You can consider these things when making your estimations:
- Did you understand the assignment without thinking about the details too much?
- How much code do you think you would need to solve a specific assignment?
- What topics do you think will be relevant for an assignment? Does it cover STL algorithms, templates, SFINAE etc.? Based on this you should have a feeling for which topic you are most comfortable with.
Once you've ranked them, the next question is in what order you should go through the assignments. What works best for you is unique to you, but generally you should think about when during an exam you seem to be able to focus best. Whenever that window is, that is when you should focus on the more challenging assignments. During the time(s) when you have the hardest time to focus and be productive you should probably focus on the assignments that you are most comfortable with.
Don't be scared to jump between assignments if necessary. Sometimes it can be beneficial to have started multiple assignments at once so that you can switch your brain between different tasks. How effective this can be varies from person to person so it is highly recommended that you try different strategies during your exam emulations to know what works best for you.
If anything is unclear in the description of the exam your best strategy is to ask the teacher for clarification. Try to avoid making assumptions if possible. If you however make some assumptions it is a good idea to write them clearly so that the person who assesses your solution know about them.
What to do when you get stuck
A general observation that has been made by the staff of the exam is that there are a lot of students that only hand in one incomplete assignment for the entire exam which indicates that a lot of students don't really know how to deal with getting stuck. It is very important that you prepare for how to deal with getting stuck so that you don't get too frustrated/stressed and don't start to work against yourself.
It is basically inevitable that you at some point will get stuck on something during the exam. It can either be a tricky compilation error, an STL component you can't really figure out, a particularly hard piece of logic or some syntax that eludes you. During these times the best strategy is to limit the time you allow yourself to be stuck. How much time you should grant yourself to be stuck isn't that important, pick whichever feels best, but you should probably not be stuck for more than 15-20 minutes. So if you've been stuck on the same problem/assignment for more than 15-20 minutes without making progress, put that assignment on pause and move on to the next assignment in your ranking.
Making sure that you aren't stuck for too long serves multiple purposes. For one it maximizes the chances that you manage to solve at least some assignments on the exam instead of wasting your whole exam time on one assignment (which will guarantee that you fail). Secondly it allows your brain to reset by "taking a break" from the problem by working on something else. Once you get back to the problem you had it will be with a new set of eyes which will likely allow yourself to solve the problem more easily. Thirdly, by working on some other assignment your brain will process the original problem unconsciously which will maximize the likelihood that you will come up with a solution later on.
If you keep getting stuck, just keep moving on to the next assignment. In the unlikely event that you get stuck on all assignments, you should take a real break: go to the bathroom, drink some water, think about what you will eat for dinner etc. for a couple of minutes. Then start from the beginning of your list. Hopefully you have managed to reduce some stress by taking a short break and that will allow you to think more clearly.
Remember, if you don't manage to solve a particular assignment, that doesn't reflect badly on your skills. There are many factors that can lead to you getting stuck: stress, pressure, you having a bad day, your mind not operating on its peak performance. It doesn't have to mean that your skills are lacking, so instead of trying to prove to yourself that you are capable, just remember that there is no shame in skipping certain assignments. It is better to get a passing grade than to solve that one particular assignment.
Page responsible: Christoffer Holm
Last updated: 2024-12-11