I teach at an engineering school where we have two different tracts of students. Some students are full-time students who attend classes during the fall and spring. Other students are called “apprentis”, they have contracts each with a different company, and they work two weeks at the company and attend classes for two weeks, in cycles through the fall and spring. In general the full-time students have a more theoretical curriculum including a course in Functional Programming. However, the apprentis, haven’t taken the functional programming course.
This year I suggested to the school that I teach an “Application of Functional Programming” course to the apprentis, and that I use Scala as the programming language. They accepted my proposal! Yipee!!!
These are students who have experience in programming, but different students have used different languages and different domains depending on which companies they are working with.
Imposed are 4 three hour lectures–I have no choice about the time allocation. So I have tried to present 8 units, 2 per class session.
However, I had to dedicate far more time getting the environment working that I hoped.
For most students (50 of 70 students) it worked correctly, out-of-the-box. But for about 20 students, it failed for various reasons, and we had to debug it over time.
The environment is this. I give them a git repository which include the lecture notes, the code developed in class, templates for homework exercises, and test suites. The students have to install IntelliJ and the Scala plugin. I plan to eventually generalise this to also work with VScode, but that work is still on my TODO list.
The homework templates contain incomplete code. The students have to replace the occurrences of ???
with real code which passes the tests.
There have been several challenges to make this work. Perhaps I’ve solved the problem wrong, but I finally got a flow that works.
One frustrating problem is that the Scala language does not fully support ???
. Some occurrences of ???
cause the code to fail to compile. Why is this a problem? Because if homework exercise 2 has such an issue, then the students cannot complete homework exercise 1.
To resolve this, I put the homework exercises in a templates/
directory. For each exercise the, student must copy the template file into a real directory to complete the homework.
This causes another problem, the test suites fail if they mention functions which are only in the uncompiled templates directory. This means students cannot run ANY of the tests unless ALL of the test suites compile. Therefore the fix is to also put the tests in an uncompiled templates
directory.
If anyone cares to take a look at my repository, it is publicly available.