[Syllabus] Order of concepts "Switch Statements" and "Exceptions"

I just noticed that the football-match-reports concept exercise expects the student to throw an IllegalArgumentException in one of its tasks, while the exceptions concept isn’t unlocked at that time yet. Adding exceptions as a prerequisite isn’t possible, because this would introduce a circular dependency between the football-match-reports and calculator-conundrum exercises.

I see two possible ways to resolve this:

  1. Remove the use of exceptions from the football-match-reports exercise
  2. Remove the use of switch statements from the calculator-conundrum exercise

Which option to choose IMO depends on the syllabus design: which concept should be introduced first to a user, exceptions or switch statements?

1 Like

2025 and I noticed the same issue.
If I was learning java as my first language I’d have been pretty confused as to what “throwing” and “exceptions” are, before they are properly introduced.

Plus, the part of the exercise where one is supposed to throw the exception, would be the perfect place to teach the use of the default keyword. E.g: Make it so that if any number without a set role would return “Unknown”.

I created a PR to address this.
This would invalidate all existing solutions though

2 Likes

PR removes exceptions from football-match-reports. I agree with this to resolve the circular dependency as sanderploegsma has pointed out. I’ll have a look at the PR.

3 Likes