Introduction to Java
In 2014, during my PhD, I provided 4 lectures for the introductory programming course of the UvA’s Computer Science bachelor. The focus lay on introducing object oriented programming, and reviewing the established concepts.
These lectures followed the introduction of the basics of Java. The main aim of these lectures was to introduce some of the more advanced aspects of Java, but I also wanted to revisit, as much as possible the concepts that had already been taught, and to eliminate common misconceptions.
To this end, each lecture contained a number of quick quiz questions, which the students could answer by holding up one of four colored cards they had been given at the start of the lecture.
I also wanted to convey why Java is designed the way it is. I find that many students are frustrated by Java’s strictness and verbosity, so I wanted to show that there was method behind this, and that the extra effort Java requires to write is paid back in security, and early bug catching.
To make the lectures something more than just a sequential explanation of programming features, each lecture was built around a theme. Click the links to see annotated slides (Dutch only).
- Lecture A How to write simple code. We discuss principles like DRYness and modularity, and the features that Java adds to enable this. Specifically object oriented programming, inheritance and polymorphism. We look at Java Collections as an excellent example of object oriented design (and of course as an important feature in its own right).
- Lecture B How to write safe code. We look at the cost of software bugs (sometimes expressed in lives lost), and explain the importance of catching bugs during compile time. We show how some Java features, like static typing, ensure that bugs are caught earlier in the development process. In this context, we explain generics, which are all about compile time bug catching. We also discuss Exceptions, for when runtime error do happen. We discuss ghow information hiding can lead to safer code. Finally, we discuss (im)mutability, an important design principle that every programmer should know.
- Lecture C How to write usable code. We discuss the idea that software code is a language for humans, not machines. The importance of good API design in every step of the way. How to structure your code so that it's easy to use (even if the user is you), and good commenting practice. We go into some of the details of good API design.
- Lecture D Review and outlook. What have we talked about, and what are good next steps to take if you want to learn more about programming? I added some tips for students who felt lost (including brief explanations of stereotype threat and learned helplessness).