MSc Computer Science Journey — September 2020-October 2020 — Part 2 — Principles of Programming

Nikolajs Skrjabins
20 min readMay 15, 2021

TL;DR

  • Overall, the module will cover majority of things you will need to know for C and Java, apart from some advanced topics like pointers and regex.
  • There will be plenty of practice to ensure that you really understand the concepts.
  • Assignments (apart from multiple choice tests) are really interesting and as real world as it gets.
  • Total time spent ~80 hours, out of which 50hours were spent for assignments. So don’t underestimate the module/assignments.
  • Unless you want to do 20 hours red bull and coffee fuelled programming sessions, cover the lectures and assignments consistently, working some time on them every day. Be better than me!

Here is a quick mind map summarising the module.

University’s online platform

As you can see from the screenshot, the platform is modern, similar to what you will see in coursera or edx. It is responsive and intuitive.

Special shoutout to high-quality videos, which is something that stood out immediately, as compared to general online courses/YouTube videos.

The only thing that I didn’t really like, is that there were no lecture notes to download, so you either had to make your own notes or copy paste/screenshot the lectures.

Admin FAQs

These FAQs are relevant to all modules not just this one.

1. Are lecturers/tutors responsive?

Yes, every module will have a Q&A forum, where you can see any question asked by any student and the answer. Usually it takes about a day or two for the lectures/tutors to respond. The exception is the weekend, if you asked your question over the weekend, the earliest it could be answered would be Monday.

I personally found this system more efficient than office hours (even digital ones), as tutors didn’t have to answer the same question twice.

2. Are there any digital office hours?

No.

3. Is there any student chat group?

Yes, we have a discord server, where we have a very lovely community where we help each other, if someone has questions about the course material, assignments or just general industry question e.g. people new to technology sector had an opportunity to ask all kind of questions to experience software engineers who are also doing MSc with them.

N.B. Tutors were not in this chat, this is purely a student initiative. Although, I would prefer the Q&A forum to be migrated to some sort of chat service (Slack or Microsoft teams), since that is more convenient than the forum on the universities learning platform.

I personally recommend that future cohorts use Slack or Microsoft Teams (the latter comes with your Bath student package) instead of Discord. This is because it is much easier to follow threads in Slack/Microsoft Teams. Try following a thread of 100 messages (which is very common during assignment discussions) in Discord. Why did we have Discord? Well, the first student created a Discord chat and then nobody wanted to move to Slack/Microsoft Teams.

P.S. There is also an all-cohort Slack chat, if you want to join an even bigger community and get some heads up on the coming modules. Someone from that chat will reach out to the new cohort and share an invite link on the university’s learning platform’s forum.

4. Can you get an extension if you are really busy with work?

Yes, lots of people did. Given that many people continued working fulltime, university was always quite understanding.

The only exception is when you request an extension couple of hours before the deadline. Then you are unlikely to get it.

5. I am a student at a new cohort, can you share the test answers/your assignment code?

Nope.

If you are incoming student, aspiring to become a good software engineer, you have to go through the hard path of experiencing the same pain as all past student. This is the only way you will actually learn! No easy way around it.

Couple of things to keep in mind

Before I jump into week-by-week summary, couple of things to keep in mind:

  1. In majority of cases, all content had some short exercises to ensure that students really got the content e.g. after learning about loops, you will have to write a short program with a loop.
  2. For the first 4 weeks, there was a lab sheet to submit at the end of each week. These are set of problems related to things you’ve learned during the week. Some of the problems are hard. At the end of the week, lecturers would walk though half of the questions from the lab sheets. For the other half, you can always ask your fellow to share their answers (or even make a post in the forum asking the lectures to elaborate on the question). For weeks 5+, there were no lab sheets, since there were lots of assignment related work, that kept everyone busy.

Week 1: Writing and running your first programs

In the first week you are introduced to C, specifically

  • difference between interpreted and compiled languages
  • the signature “Hello World” programme
  • what are variables
  • the mighty printf statement
  • concept of debugging and a few broken programmes to debug e.g. find a missing ;

There wasn’t much videos, the focus is on text + and trying out code (lab sheets) on repl. The lab sheet had several tasks to complete e.g. print first 10 numbers of a Fibonacci series. These are quite tricky as you can overthink them. Having previous programming experience will make it worse, since you will start thinking about loops, recursion, function arguments, etc. No, none of that, just dirty brute force code at this stage.

You are supposed to use only 2 things you’ve learned so far — variables and printf (with format specifiers). Nothing more, nothing less.

Total time spent — 2 hours

Week 2: Functions and parameters

In the second week, you are continuing learning the basics of C, specifically:

  • more format specifiers
  • function prototypes, parameters and arguments
  • variable scope (global vs local variables)
  • booleans
  • if statements
  • recursion and loops

Lab sheet — there is a big jump in exercises e.g. one of the exercises required to write a programme to determine if a number between 1 and 9999 is prime. Sure you can google the algorithm but even then, understanding that is quite hard. Another exercise required you to convert a number (from 0 to 100) to English text e.g. 99 to “ninety nine”.

Total time spent — 5 hours

Week 3: Arrays and strings

In the third week, you are moving to more advanced stuff in C:

  • encapsulation and generalisation of your code so it becomes reusable
  • arrays and strings (in C, strings are arrays of characters)
  • string functions like strlen, strcopy, strcat
  • structures
  • functions to update structures
  • nested structures.
  • advanced data structures — stacks and dictionaries.

Lab sheets continue to become much harder. You need to print a tree like shape and write a program to convert a hexadecimal number to decimal number.

Since I am studying at night, e.g. from 2am to 5 am. I feel like I am not being quite productive — I need to read things twice, my focus drifts off. It feels like I am losing an hour or so because of this condition.

Also I noticed a very awkward thing — one of the lessons in the week (Lesson 4 — Strings Functions Example) is 99% aligned with what is on the tutorialspoint. I guess this is another point for the camp which claims that you can obtain knowledge from the higher education from free online resources.

Total time spent — 5.5 hours

1st graded assignment — multiple choice test

Week 3 also included the 1st graded assignment — a multiple choice test, which is worth 10% of the grade for the module. The test was quite easy, since well it is multiple choice… 1 correct answer out of 4 options. So even if you were not 100% sure about something, you could figure it out by elimination.

What surprised me even more is that there was no time limit on test. You could save your progress and come back to it. Easy-peasy. And although students were asked to complete the test with the closed book, nothing stopped students from saving the progress, then reviewing the material again, and resuming the test the next day.

I felt that this test is just a mark giveaway, to ensure that as many students pass as possible. In fact, as you will see in the future assignments, which become exponentially harder, that is indeed the case. Plus the test is only 10% of the final grade.

I finished the test in 25 minutes, got 88%, all mistakes I’ve made because I didn’t read the question properly, rushing with my answer selection, a really bad habit, which I still have from school times. Don’t be like me!

Total time spent — 0.5 hours

Week 4: Java and OOP

In the fourth week there is a major switch to Java. On the concept level, nothing changes, loops and if statements are the same thing in both C and Java. It is just a matter of syntax.

If you ever written Java after Python or even C, you will know how verbose Java is. That’s why I think subconsciously I delayed starting Week 4 until Week 6. I am 2 weeks behind at his stage.

Here is what you will learn:

  • OOP
  • fields and methods
  • creating objects
  • implementation of classes
  • Java syntax for loops and if statements
  • inbuilt string methods e.g. capitalise, uppercase, etc.

There is lots of practice to make a switch to Java feel more natural. Surprisingly, there was even an explanation how to compile and execute Java code (there wasn’t one for C). Although it doesn’t really matter, since you will be running all your code on repl anyways, where you just hit the Run button.

Lab sheet was really interesting — you had to implement a bank account class and you had the freedom to come up with your own accessor and mutators.

The only negative thing about this week was the exercise with strings. You had to implement the Caesar cipher. But here’s the catch they didn’t teach you any in-depth string methods for string. They just gave you a link to string documentation (which didn’t work btw) and wished good luck.

This is a really interesting situation. On one hand, in real life you will face many similar situations, where you have to dig into documentation and find the answer yourself. 100% true. But on the other hand, what are you paying are paying the £10k for then? Where do you stand on this approach? Let me know in the comments.

Total time spent —4.5 hours

Week 5: Java Types, Control Flow and Error Handling

In the fifth week you are really delving in Java, focusing on:

  • arrays lists
  • wrapper classes (int and Integer)
  • concept of breaking and continuing the loop
  • try-catch blocks
  • raising an exception
  • user inputs and interaction with these inputs — this will be a pain for people coming from Python background. When we are talking about processing user inputs, what takes you 1 line in Python, will take 10 in Java.

There will Exercises to keep you practicing Java — implementing the multiplication using recursion and addition, the good old Fibonacci and taking user inputs.

No Labsheet — as you should start the 2nd graded assignment. But still a masterclass on couple of exercises.

Total time spent — 2.5 hours

Week 6: Object oriented classes and inheritance

In the sixth week, you will be delving deeper into the OOP world:

  • static methods of the class
  • inheritance
  • polymorphism

No Labsheet, as you should continue working on the assignment.

Total time spent — 4 hours

2nd graded assignment — Saturated Reverse Polish Notation (SRPN) calculator

Universities assignment are often criticised for not being realistic. This assignment was as realistic, as it gets. You had to replicate an old piece of software (a saturated reverse polish notation calculator) in Java. You don’t get the source code for this legacy software but you can interact with it (on repl) to better understand the logic. You also had to replicate any bugs/obscured functionality (without fixing them).

This assignment is worth 40% of the module grade.

Personally I had a similar task on work too many times to count. Here is a legacy script, which is being handed over to you/your team. You are responsible for it now. Ohh and btw, the person who wrote it, now left the firm, there is no documentation and it crashes every now and then for no reason. Good luck! So massive shoutout to the university for making such a realistic assignment.

It took me an hour just to understand what is required for the assignment and another 1.5 hours to go through all Q&As (which was really helpful).

Reading Q&As threads is really helpful, it will save you a lot of hours, since the problem that you would likely encounter will be surfaced in those Q&As

There is also 1 hour getting started video from the lectures which is 100% crucial and an absolute must to watch. This video ensures that you will at least get that 40% pass mark.

I’ve had a lot of work and other life commitments at the time. The assignment fell on the weekend when me and my wife were celebrating our 5 year anniversary. I completely forgot about the fact that I had an assignment due on that day. So I only started working on the assignment at 2pm on Sunday, whilst the submission was on Monday noon time.

I didn’t want to ask for extension (which in retrospective was a mistake) because I irrationally thought that asking for an extension = being a failure at life…

I then proceed to a 17 hour red-bull + coffee fuelled programming marathon (from 2pm Sunday to 7am Monday, followed by a working day on Monday) This time included breaks for food, short walks and rests. As you can imagine, this was relatively unproductive.

I have completed about 90% of work in the first 5 hours. Everything else was spent on getting those final marks. Handling those edge cases and reproducing bugs or obscure functionality. I’ve spent the last 2 hours on refactoring (I used Google’s Java Style Guide), modularising and double checking everything.

Coding practices account for a large portion of the marks — 40% out of the total grade. So having clear variable/class/function names, plenty of comments is a must!

Unfortunately I didn’t finish replicating all the functionality.

There are diminishing returns of time, replicating those last bugs or obscure functionalities, can take hours and hours, whilst give you only a few marks. So prioritise the more straightforward functionality and good coding practice.

Perhaps accepting that you won’t be able to replicate 100% from the start is the mindset to have, which again is what you will have in real-life. But then again, I had only 1 days instead of 2 weeks on this…

At the end my brain was fried. They say “never, say never”. But Jesus, I am too old for these kinds of marathons! I don’t want to do it ever again. I can’t believe how I used it to do this all the time during BSc.

I wish I could tell you that next time I will plan more time for the assignment. But this isn’t going to happen — unfortunately my life is full of last minute all nighters, like these.

Got 76% for the assignment.

Total time spent — 20.5 hours

Week 7: Abstract classes, interfaces, coupling and cohesion

In the seventh week, you are exploring the final bits of OOP:

  • interfaces
  • abstract classes
  • coupling
  • cohesion

N.B. when interfaces were introduced, it was mentioned that these are indeed to solve multiple inheritance problem. But the issue is never explored deeply, so you really need to Google it.

I specifically took 2 days of annul leave to cover the material over the long weekend — 4 days. But started to study only on Saturday. It seems leaving everything on the last day is becoming a habit.

One of the exercises was to implement the obstruction game, which I skipped since it would take a lot of time to implement, which was really a shame. In retrospect I made a correct choice no to complete exercise, as I was short on time and the exercise will be forcing you to create another game (~4 hours).

I also skipped the dequeue interface exercise (like a queue but with access from both ends).

Bottom line — if you have extra time for practice — go for it. If you don’t, well, there will be plenty of coding during the last assignment.

You are supposed to start the game for the assignment as well.

No Labsheet, as you should complete the multiple choice test and start working on the 4th graded assignment. There still is a masterclass on implementing the dequeue though

Total time spent — 2hours

3rd graded assignment — another multiple choice test

The format follows the same as for the first test i.e. no time limit, you are able to save your progress and come back later, worth 10% of the module grade.

I felt that there were few things (specifically 3 questions) in the course material that were explained briefly but the asked questions in test went much deeper and it was hard to answer these unless you resorted to further googling on the concept.

Last 5 questions of the test require you to work through the code examples which have loops (5+ iterations) and answer what will printed out as the output. Trivial, but takes time to work through when doing it with pen and paper. You can’t copy/paste the code, as it is an image. In theory you can type it out, which will take some time but the tutors asked us not to, as this approach ignores the whole purpose of these questions i.e. understanding how the result changes with each iteration of the loop.

Got 97.5% for the test.

Got tricked by the question about types in Java. Course material covered only primitive types. Apparently, classes like Random are also considered a type in Java.

Total time spent — 2hours

Week 8: Code quality, refactoring, testing and final assignment

The last week of the module, takes a step back and focuses on the best practices:

The exercise was to review our classmates code from the 2nd graded assignment — SRPN calculator according to a style guide and functionality + give feedback. You also need to post your code (don’t be embarrassed) and respond to any feedback.

This is cool as it is a real life exercise. I wish they introduced the style guide sooner though, as lots of people could’ve wrote a much cleaner version for the 2nd assignment. Some people managed to refactor their code for the last assignment but still did it under time pressure. I was luckier since I’ve been using Google’s style guide since week 1.

We had to propose extra tests for assignment 1 and implement these tests with a JUnit. I didn’t do the last part since it was time to work on the assignment.

Regarding the JUnit test, the university shot themselves in the foot a bit. Literally thy provided 2 lines of material saying you can use JUnit as a test framework. Nonetheless they still asked us to write a JUnit test on our SRPN assignment.

Students quickly started complaining and tutors posted a detailed video on the JUnit.The issue was that the video was posted on Friday evening, when everyone was working on the assignment which had to be submitted on Monday morning. Hopefully next cohort will have the video straight away and will be able to better tackle the exercise.

Total time spent — 2.75 hours

4th graded assignment — Connect4 game

The last assignment was to code up a Connect4 game that is supposed to run in a terminal. You already start with a skeleton code of the game but it is full of bugs and is deliberately badly written. The assignment is actually split in 3 parts:

  1. Bug report (20%) — identify and document all bugs.
  2. A 2–3 page report (40%) — on how to refactor and restructure the code to reflect the OOP concepts, inheritance, abstract classes, interfaces, etc. The report should also include a discussion on how to alter the code to extend the game to ConnectN against 2 computer players i.e. a human player vs 2 computers.
  3. Coding up everything from the report (40%) — many students, including myself found it easier to code the solution up before writing the report. This way, if you change your mind about the solution, you don’t have to re-write parts of the report again. I also found it easier to start with the practical part first.

This assignment overall is worth 40% of the module grade.

Having learned from the previous assignment, of not leaving everything to the last day, this time I’ve started the entire 2 days before the deadline i.e. on Saturday, with the assignment being due at noon on Monday…

I’ve spent 10 hours on Saturday. And had another 18 hour, red-bull + coffee fuelled programming marathon on Sunday (followed by work day on Monday). Never say never. So true.

I’ve spent the first 1.5 hours on watching a get started video on creating a Tic Tac Toe game + Reading all the Forum Q&As on. The video was particularly helpful, although about an entirely different game, still it shows a really good example of implementing a game using OOP principles. Again this step is crucial and ensures you get at least 40%.

Here is a more detailed breakdown of how I’ve spent my time:

  • 7 hours on a bug report, where I found 35 bugs (10 of which were a missing ‘;’ ). Out of these 7 hours, I’ve spent 1 hour on just formatting the report.
  • 2.5 hours on converting the crappy code into Basic OOP solution — I ended up having 3 classes (excluding Main) — Board, GameLogic, Player. I
  • 6.5 hour on extending my code to work for 3 players (1 human vs. 2 computer players) in a game of ConnectN, where 2 < N < 7.
  • 5.5 hours on commenting (every single class, method, field had a java doc) and refactoring the code.
  • 5 hours on the report. The fact that I had the code well documented code helped a lot, since I did the report after the code!

I felt that I did 99% of everything that was required, except maybe some:

  • Optimising some loop logic
  • Reviewing everything with fresh eyes

But I guess it is hard to always be 100% satisfied with something.

In case you are wondering the final version of the code was ~600 lines across 5 classes. But there were lots of Javadoc comments though.

Got 91% for the assignment. Bug report was perfect, mainly lost the marks in the report. But honestly, after the above marathon, I didn’t really care…

Total time spent —28 hours

Total time spent and final grade

Graded assignments and tests — 51 hours

Lectures, short exercises and lab sheets — 28.25 hours

Total time spent — 79.25 hours

Final grade (rounded to 1 d.p.) — 85.8%

What went well

  • Majority of things from C and Java (apart from few advanced concepts) were covered.
  • There is a lot of practice, which ensures that you really learn the concept. We remember more when we practice the concept, instead of just reading about the concept.
  • Assignments (apart from multiple-choice tests) are really interesting and as real-world as it gets.
  • It was great to see that the module paid a lot of attention to coding practices and testing. I personally encountered many people with a CS degree who were either not taught these concepts or just don’t care about them. Well in this module you are both taught and made to care (as otherwise, you will lose a lot of marks in assignment).
  • Tutors and lecturers were always there for support and promptly answered all the questions on the forum.

What can be improved

  • One of the biggest points is that during the first 3 weeks of C, the concept of manual memory management — pointers, is not even mentioned. Pointers is one of the reasons why C (and C++) is used for performance intensive applications (instead of Java or any other language). Since it is more efficient to pass a pointer to a function/operation than passing an object or a copy of an object. For beginners especially, this creates an impression that C is simply inferior to Java, as the same program that takes 30 lines in C can be re-written in 10 lines in Java.
  • Some of the advanced Java topics are mentioned in a sentence e.g. regex were explained in a 1 line sentence, like “there is this thing called regex, which can save you a lot of time, here is a link, make sure you check them out”.
  • There is an over-reliance on repl. Repl is an easy way to get started but doesn’t pay off in the long-term. I would prefer if the university encouraged student to use an IDE/Text Editor and every week would show a feature or two of the IDE/Text Editor.
  • Google’s Java Style Guide is definitely introduced too late (in the last week). Whilst you will be judged for coding practices already in Week 5. Introducing the style guide earlier would have saved a lot of people lots of marks (some people used snake_case instead of camelCase because of this).
  • Assignments that are due on Monday are brutal, I would argue that a Monday deadline, encourages all-nighters during the weekend. I would make the deadline on Friday evening.
  • I have noticed that a lot of people, studied during weekend, whilst tutors answered questions during weekdays only. This was a problem for assignment in particularly. Sure, you had a student chat as a fall back solution but given the part-time and online nature of the course, it would make sense to have 1 tutor on-call during weekend to answer any questions.

Tips for passing the module

  • Don’t study at night after a tiring day, have some rest before starting to study. Otherwise, you will be annoyed, irritated and won’t be able to digest the material. This is perhaps the most important tip that will always be relevant throughout the entire MSc.
  • Coding assignments are tough, and if you want a decent grade i.e. 2.1+, spread the work over the weeks. You can complete all assignments over the weekend (as I have shown) but be prepared for those all nighters and stock up on red bull. The last minute approach may not be suitable if you have kids though.
  • Having said that, the university makes it really easy to get a pass mark, so don’t feel too pressured.
  • Start using Google’s Java Style Guide from day 1. This will come particularly handy for the 2nd graded assignment.
  • Take your time with multiple choice tests, you can always come back to them, as they are not timed. These are easy 20% of your final grade, don’t disregard them.
  • Do your lab sheets, watch the getting started videos, read the Q&A posts, you will learn a lot from these.

Some personal reflection on the module

Needles, to say, I really enjoyed the module, lots of useful stuff learned that is applicable to real world. However I noticed that I’ve encountered several challenges:

1. Being constantly tired

My biggest challenge during this module was that I was constantly tired after work to study.

My approach to work is that I give it 100%, often staying late until I resolve all the issues, bugs or have some kind of closure. This is great for my employer, but not so good for me, since after I finish work, I am emotionally drained and all I have is energy for is Netflix.

And then there is weekend, half of which I usually spend sleeping, yeap I get up at noon, and the other half I devote to my family.

The challenge therefore is finding motivation for studying when you are tired. I haven’t found a solution. Thing that sometimes worked for me is simply forcing myself to do it — Nike style — “Just do it”. This doesn’t work all the time though.

Share in the comment section on how you motivate yourself to do something when you are extremely tired.

Mental note to my future self: Research how to motivate yourself in this kind of scenario.

2. Leaving everything until the last moment

Problem number 1 also caused me to leave everything for the last moment and well that was definitely not a pleasing experience, especially with those 20 hours programming marathons. I am only 25, and although I did these just couple of years ago, it seems that I am too old now.

Mental note to my future self: Don’t leave it until the last minute again.

3. Not planning enough

The 2nd graded assignment fell on the weekend when me and my wife were celebrating our 5 year anniversary. I completely forgot about the fact that I had an assignment due on that day…

Mental note to my future self: Be more responsible with planning. Check any major occasions especially.

--

--