diff --git a/analyzer-comments/java/general/avoid_print_statements.md b/analyzer-comments/java/general/avoid_print_statements.md new file mode 100644 index 000000000..312946524 --- /dev/null +++ b/analyzer-comments/java/general/avoid_print_statements.md @@ -0,0 +1,13 @@ +# avoid print statements + +Try removing statements such as `System.out.println()` from your code. +Exercise tests require the solution to _return_ values from methods instead of printing them. + +Usually, statements like these are added to help debug the code. +However, a better approach is to debug the code while running one or more unit tests. +This has the added advantage that one can focus on debugging a specific test case. + +Here are some links that explain how to debug Java code while running unit tests in various IDEs: + +- [Running and debugging Java tests in Visual Studio Code](https://code.visualstudio.com/docs/java/java-testing#_rundebug-test-cases) +- [Debugging tests in IntelliJ IDEA](https://www.jetbrains.com/help/idea/performing-tests.html#RedebugFailedTests) diff --git a/analyzer-comments/java/general/do_not_use_main_method.md b/analyzer-comments/java/general/do_not_use_main_method.md new file mode 100644 index 000000000..0a0feddc2 --- /dev/null +++ b/analyzer-comments/java/general/do_not_use_main_method.md @@ -0,0 +1,13 @@ +# do not use main method + +Try removing the `main` method from your code. +Exercise tests don't require solutions to have a `main` method and having one makes the code slightly harder to read. + +Usually, a `main` method is added to help debug the code. +However, a better approach is to debug the code while running one or more unit tests. +This has the added advantage that one can focus on debugging a specific test case. + +Here are some links that explain how to debug Java code while running unit tests in various IDEs: + +- [Running and debugging Java tests in Visual Studio Code](https://code.visualstudio.com/docs/java/java-testing#_rundebug-test-cases) +- [Debugging tests in IntelliJ IDEA](https://www.jetbrains.com/help/idea/performing-tests.html#RedebugFailedTests) diff --git a/analyzer-comments/java/general/feedback_request.md b/analyzer-comments/java/general/feedback_request.md new file mode 100644 index 000000000..9e34618ea --- /dev/null +++ b/analyzer-comments/java/general/feedback_request.md @@ -0,0 +1,5 @@ +# feedback request + +If this automated feedback doesn't look right, please [open an issue in the `exercism/java-analyzer` repository][java-analyzer-issues]. + +[java-analyzer-issues]: https://github.com/exercism/java-analyzer/issues?q=is%%3Aissue+is%%3Aopen+sort%%3Aupdated-desc