OU blog

Personal Blogs

Christopher Douce

Object-oriented programming: seven tips

Visible to anyone in the world
Edited by Christopher Douce, Friday, 16 Feb 2024, 16:01

Over the last few years, I’ve been tutoring M250 Object-oriented Java programming. During some of the tutorials that I facilitate, I share set of tips with students. What follows is a brief summary of the tips, and some accompanying notes. I hope these might be helpful to anyone studying M250, or any other OU module that involves a bit of programming.

1. You can't learn programming by reading the course books. You need to do it. You need to spend serious time playing.

It’s important to spend some quality time with the language that you’re using and the integrated development environment that you’re using to manipulate that language. You can only properly learn to get a feel for both object-oriented programming, and programming constructs by using them. Get a feel for the words and the punctuation that you’re using. Also, instrument your code with print statements, and consider using a debugger to really see what is happening. Play and mess about. Getting yourself in a tangle is all a part of the process. There is another related tip is: do one thing at a time.

2. Use the examples as a starting point; then go further.

Start to play, and then to play a bit more, and see where this will take you. Invariably, you’ll end up writing more and more code. This means that you’ll get to a point where you need to think about how to make things a bit easier again. If you’ve found a problem in a textbook, think about how might alter that problem to solve a slightly different problem, or a more general problem.

3. Accept that things are going to be uncomfortable sometimes: it’s impossible to understand everything at once, things will only make sense after you've spent the hours playing and learning.

There’s a lot going on with object-oriented programming. 

There’s the key ideas of types (or classes), objects, attributes and member functions. Not to mention, of course, how objects might work with each other to solve problems. Plus, there’s constructors, libraries and iterators.

It’s all a lot of take in, and it isn’t a surprise if you start to feel a bit overwhelmed. If you see difficult things and struggle to understand what is going on, accept certain things at face value for the time being; full understanding will come a bit later.

4. Always make a backup copy.

This relates to the first tip: playing.

When you play with code, you can also mess things up and get yourself in a tangle, especially if you follow tip 2 where you build on earlier things you have earlier done. As you figure everything out, make sure you take a backup copy of your code. If you’re making lots of changes, you might want to create different versions of your code. You might create a copy, save all your files in a new directory and call it ‘version 1’, ‘version 2’ etc. 

Also, do make sure you save your files in a location that is different your computer, just in case your computer goes wrong. A bit later on, you might start to use something called GitHub.

5. Try to explain your code to someone else. (Or, get a plant, and call it Dijkstra)

Sometimes coding presents some real puzzles; sometimes there’s something that isn’t quite understood, or something doesn’t quite work as expected. As a developer, I’ve sometimes had bugs which have been both weird and persistent. When this happens, I would “have a chat with Dijkstra”.

Let me explain. I once heard that in a computer lab in Cambridge, there was a houseplant, which was named called Dijkstra, named after a famous Dutch computer scientist called Edsger Dijkstra. If a student was struggling with some code, and asked themselves the question “why doesn’t this work?” they were told to explain their code to Dijkstra. The very act of explaining your code, a step at a time, has the potential to help you to understand what is happening, and what the problem is. 

If you have a partner, sibling, or pet, they can all become Dijkstra.

6. If you keep going over the same things time and time again, don’t be afraid to step away from it. Sleep on it, and come back to it with fresh eyes.

In computing, there’s a term called thrashing, which is sometimes used to describe a phenomenon that occurs with computer operating systems. This needs a bit of explanation, so please do bear with me.

Your computer has two types of memory: random access memory, and backing store memory. Random access memory is fast and expensive, but your computer doesn’t have very much of it. In contrast, there is typically a lot backing store memory in your computer (which used to be held on a magnetic disk), which is pretty inexpensive in compared to random access memory. Your computer operating system provides programmers with a lot more memory than is actually available through random access memory. It does this by moving data between different types of memory.

Thrashing is what happens when your computer operating system causes your computer to spend all its time trying to get things done by moving data between different types of memory, rather than doing the work that needs to be done.

If you find yourself ‘thrashing’, you need to reboot. You need to step away from your code and come back to it after a break.

I remember once having an idea about how to solve a coding problem when I was having a shower. A break can do you the world of good. This point leads me to my final point.

7. Have fun, and be gentle with yourself.

Everyone learns at different speeds; learning isn’t a race, so do be gentle with yourself. It’s important to have fun too. I remember that one of my first object-oriented programs was a simulated card game that was based on a television gameshow. It was fun to write, and it was fun to play. This point about playing takes us back to the first point: you can't learn programming by reading the course books; you need to find the time to play.

Permalink Add your comment
Share post
Christopher Douce

M250 Object-oriented Java programming: update briefing

Visible to anyone in the world
Edited by Christopher Douce, Friday, 11 June 2021, 16:34

M250 Object-oriented Java programming (OU website) is changing. On 25 May I attended a short module briefing which summarised some of the changes to existing M250 tutors which will be introduced to the 21 J (October) presentation of the module.

One of the reasons for the need for a change is that earlier modules, namely TM111 and TM112 now have more programming content, and there is a need to ‘beef up’ M250 to help students when they move onto a sister module: M269. The new version of M250 will be more practical.

A good place to visit to find out about Computing and IT modules is through the Computing and IT subject siteWithin this site, there is a page that is all about M250 Object-oriented Java programming where students can access some sample exam questions, some M250 'prequel' materials, and complete a really helpful Self-assessment quiz.

It is expected that chapters 1 to 3 of the module materials (probably in ePub form) will be available as 'taster' materials for the module. There are also some links to library resources. M250 students can also access discounts from certain Oracle certification exams (but I don’t know to much about this). Students who are fully registered on the module will, of course, have access to an ePub version of all the materials.

Key changes

The key M250 learning outcomes remain unchanged. The new version of the module will be based around Objects First with Java by Barnes and Kölling (book website) which will be used with BlueJ version 4.1.3, which comes with JDK 8. Students will, of course, be sent a copy of this textbook. This set text will be supported by material known as chapter companions and extension materials for those students who want to study further. Unlike the previous version of the module, students will not be using bits of software, such as the object microworlds, or the OU workspace.

An important point I noted down regarding the set text is that students are not (immediately) expected to understand everything that they see. There will also be some more video materials to support students.

There will also be some style changes. The keyword ‘this’ is not going to be used as much, or emphasised, and the new version of the module will make use of some more standard terminology. There will be a couple of new things, such as try-with-resources (which I don’t yet know anything about), using the hashcode method, and doing a bit of computational modelling (which is covered in chapter 12).

Assessments

Just as before, the module will have 3 TMAs. TMA 1 will address the foundations of object-orientation, classes, objects, and introduce the ArrayList. TMA 2 will cover packages and import statements, collections and access modifiers. TMA 3 will cover the more advanced concepts of inheritance, polymorphism, interfaces, exceptions, and file input/output.

Students must gain an overall score of 40%, and must pass the examinable component with a score of at least 30%. There are no threshold requirements for the continually assessed part of the module (the TMA bit, which is known as OCAS).

The way that the marking will be done is going to be slightly different. There will be points for different categories, and tutors will be encouraged to highlight where mistakes have been made.

Reflections

Another thing I have heard is that the way that tutorials are being organised is also going to change. The number of clusters (groups of tutors) across the UK is being reduced, which means that there will be larger numbers of tutors working together to deliver tutorials. There is, I understand, a plan for groups of tutors (or individual tutors) to present a tutorial that focuses on certain chapters of the Objects First set text. I think this is a really good idea, and should increase the teaching and learning opportunities available for students.

One change that I am curious about is the way that the TMAs are assessed in the new version of the module. It strikes me that tutors will be given more freedom to assign marks for work done, whilst working within guidelines provided by the module team. The current M250 marking guidance is very prescriptive, but sometimes students do provide worthy (and interesting) answers that have not been thought of by the module team. In some ways, the new way of working will enable us to make more academic judgements about the work that has been submitted. Perhaps this change also represents an interesting opportunity for scholarship.

Permalink Add your comment
Share post
Christopher Douce

Reflections on M250

Visible to anyone in the world

I’ve just finished tutoring my first presentation of M250 Object-oriented Java programming.

I first applied to tutor on the predecessor to this module back in 2005. At the time I was a full time Java programmer working in industry, writing software that drove some equipment that was used to teach telecommunication principles. 

I wasn’t offered a contract on M250, but I was offered a contract on M364, which was called Fundamentals of Interaction Design. I tutored M364 for a little over ten years. It was a great module; it was well designed, it had a clear structure, and gave students some practical experience of carrying out some really simple usability evaluations.

In 2019, I heard from a colleague that there was a M250 vacancy in the London region. I hesitated; I’ve a lot on. I also tutor on the project module, TM470, and have a few other OU responsibilities. Since my research at university was about object-oriented programming, I simply couldn’t resist the opportunity to play a part in teaching people about object-oriented programming. I applied. I was interviewed and considered appointable.

Books

In the post I was sent three glossy looking books. In the very early stages of tutoring, I sat down and started to read them, skimming over the activities; a lot of what I was reading was already familiar to me, and I could understand the concepts that were expressed through the amphibian-related activities (frogs and toads were used to introduce the concept of objects and messages).

Through the module website, I found that there were PDF and ePub versions of books. I downloaded the ePub versions onto my eReader, just so I could carry them around with me a bit more easily.

Getting everything going

At the start of the module, I set up some introduction threads on the tutor group forum and wrote to each student telling them to subscribe to it. I also asked students to get in touch with me to say hello. For those who didn’t reply, I chased them up with a text message and a quick phone call or voicemail. 

My first tutorial

My first ever M250 tutorial took place in a seminar room at the University of Westminster. I was there to support my fellow tutor, Lindsey, who has been allocated to me as my mentor.  Two things struck me: she knew terms to describe Java that I had forgotten, and carried out almost all of her teaching using a combination of whiteboard, and pen and paper. This method of teaching programming was a method that I approved of; it forces everything to move a whole lot more slowly.

My first solo tutorial

My first ever online introductory tutorial was fun. I prepped for it by looking at what other tutors had done, using sections of the module material and sharing bits of the TMA question. 

During the first tutorial, I tried my best to emphasise the fundamental concepts of object-oriented programming. I asked everyone who came along to look around their immediate environment. We made classes out of those objects, and gave them attributes. I also compared non-OO programming to OO programming, to really emphasise why it’s an important subject. I also recorded the tutorial and did two things to follow up: I posted a link to the recording on the tutor group forum, and also sent an email to all student to let them know they could find a link to the recording by visiting the forum.

Whenever I can, I try to connect different things together; tutorials with module materials, and forums with recordings.

My first TMA

The first TMA of a new module means that you never know what you’re going to expect. I always knew that there would be a lot of support behind the scenes. I subscribed to the tutor forums (in M250, there was one support forum for every TMA), printed out all of the tutor notes (which were comprehensive), along with the TMA question. I also made liberal use of my highlighter to identify bits that I needed to pay attention to.

I quickly realised that students were asked to submit their TMAs in two parts. Firstly, there was the written part (presented within a Word document), then there was some programming code, that was submitted in a zip file. The code in the zip file was also presented in the Word document, and could add teaching comments into the Word document.

Another thing that was new to me was the BlueJ Java programming environment. I soon figured out how it worked: projects were contained within directories, and these directories contained a project file. I easily found the compile button, and figured out that there were another bunch of tools that had been created by the university: something called the OU workspace which presented a graphical display, and a way to dynamically work with Java code.

There was something that really helped me to get going in the very early days, and that was a testing tool that had been created by the module team. Essentially, you run a Java program that then compares a specified Java program (i.e. a student’s submission) against a predefined definition or specification. Essentially, it’s a tool that tells you whether a student’s code is right or wrong. The tutor’s job is to interpret everything: the tool output, the student’s submission and the tutor notes and provide some sensible teaching comments, along with a mark.

I soon realised that I could apply a familiar tried and tested marking approach to M250: I could mark one question (or question section) at a time, for all student submissions. The advantage of doing it this way is: (1) consistency, and (2) speed. When you’re doing this, you can put quite a lot of the marking guide into your head and also make sure that you provide consistent comments and feedback for each of the student submissions.

My first additional support session

After marking the first TMA, I noticed that a couple of students may be struggling to understand some of the fundamental concepts of OO programming. A tip off for this was how some of the Java code was expressed. It might have been things like students not quite understanding the purpose of member variables and how they related to member functions (for example). 

I emailed all the students who might be struggling to ask them whether they might be interested in a one to one session. A couple of students agreed.

During one of the additional support sessions, which took place in a tool called Adobe Connect, I used screen sharing. Rather than telling students what they needed to do, I asked questions to probe their understanding of some of the fundamental Java and OO concepts. I then used screen sharing, in combination with the BlueJ environment, to do what is usually called ‘live coding’. Essentially, during the tutorial, we co-created some code which explored similar concepts that were explored within the TMA questions.

I had never done any live coding before. I had certainly never done it using BlueJ and Adobe Connect. In some respects, I was taking quite a few risks, but everything seemed to work okay. Object-oriented concepts were communicated and shared through a combination of English and Java.

My first examination preparation session

During my first presentation of M250, something unexpected happened; a global pandemic. What this meant was that the expected M250 written exam was cancelled. This mean that the final assessment score was going to be calculated from the scores of all the TMAs. This was possible, since the TMAs assessed all the key learning outcomes from the module.

Exams are useful, since they enable learners to consolidate their earlier learning. Rather than running an examination preparation session, I’m going to be running what I can only call a module consolidation tutorial. During this final tutorial I’m going to be talking about what was going to be assessed, why different questions were to be asked, and how they may relate to studies on other modules. 

Reflections

I’ve enjoyed tutoring my first presentation of M250.

Tutoring the module was a bit of a surprise, in the sense that I didn’t expect to become a tutor on M250; I thought the opportunity had passed. I applied, since I felt that I had some hidden skills (knowledge of OO programming and Java) that I could use. 

I enjoyed realising that I remembered how to code and how the key parts of the language worked. I also enjoyed working with the new bits: collection classes and iterators; bits of the language that had been introduced after I had stopped using it on a daily basis.

Although the marking was hard work, it was looking at something that was familiar, which meant I was able to get into the swing of it relatively quickly. I soon learnt to accept that wasn’t going to understand everything that was in the tutor notes (tutor marking instructions) straight away. Understanding, of course, came by playing with code, and looking through the answers that students had submitted.

The real fun bits were the tutorials and the one-to-one sessions. It was in these sessions that I felt that I could really add something as a tutor.

If asked whether there was something I would change for the next presentation, it would be: I would take even more risks during tutorials. Programming has the potential to be a really fun subject. I have the tools to make it fun. It’s going to be up to me to make it so. 

Permalink
Share post

This blog might contain posts that are only visible to logged-in users, or where only logged-in users can comment. If you have an account on the system, please log in for full access.

Total visits to this blog: 2357530