loading...

Discussion on: Critique My Code: Sudoku Solver in Go

Collapse
theodesp profile image
Theofanis Despoudis

Criticisms - Cynicisms:

  1. Please format the error messages according to the Error style guide. Error strings should not start with a capital letter because they'll often be prefixed before printing. github.com/golang/go/wiki/Errors
  2. The trySolve method name is confusing. A better name will be isSolvable or canBeSolved as it returns a boolean.
  3. The trySolveRecursive method checks what the trySolvedoes in the beginning so you have code duplication.
  4. dev.to/thisleenoble/why-sudoku-are...
Collapse
mas profile image
Sam P Author

Thanks for the feedback!

I wasn't aware of the error message convention and I'll make sure to fix that up and adhere to it in future.

Regarding your other comments, I definitely agree the method naming there could be improved, and I'm also going to do a bit of refactoring to avoid the bit of duplication you mentioned.