From 0f4f81c9efcdc784cccef4fc84e93ff519df7829 Mon Sep 17 00:00:00 2001 From: xinri Date: Sun, 9 Nov 2025 23:49:10 +0100 Subject: [PATCH] add the design.md for the calculator-conundrum --- .../practice/calculator-conundrum/.meta/design.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 exercises/practice/calculator-conundrum/.meta/design.md diff --git a/exercises/practice/calculator-conundrum/.meta/design.md b/exercises/practice/calculator-conundrum/.meta/design.md new file mode 100644 index 000000000..ac0ff57b9 --- /dev/null +++ b/exercises/practice/calculator-conundrum/.meta/design.md @@ -0,0 +1,14 @@ +# Design + +## Analyzer + +This exercise could benefit from the following rules in the [analyzer]: + +- `essential`: Verify that the solution is not wrapping all the code in a try catch statement +- `actionable`: If the solution uses an `if` statement, instruct the student to use the `switch case` statement instead. +- `informative`: If the solution does not use `HashMap`, instruct the student to use the operator as a key and a BiFunction implementing the calculation + Explain that it is more efficient for performance, and it removes the cyclomatic complexity +- `informative`: If the solution does not throw the exception for `Operation cannot be null` and `Operation cannot be empty` at the beginning, instruct the student to do so + Explain that it is better to fail fast, and it will make the code less error-prone and more readable + +[analyzer]: https://github.com/exercism/java-analyzer \ No newline at end of file