bhlangonijr / chesslib

chess library for legal move generation, FEN/PGN parsing and more
Apache License 2.0
223 stars 78 forks source link

Review and improve Javadoc #90

Closed alessandrodalbello closed 2 years ago

alessandrodalbello commented 2 years ago

Hi Carlos,

first of all, awesome project! Thank you for your hard work πŸ™πŸ»

It would be super to expand and improve the Javadoc comments, especially for people like me who are not familiar (yet) with the APIs of your library.

For instance, in the class MoveGenerator:

    /**
     * Generate All pawn captures
     *
     * @param board the board
     * @param moves the moves
     */
    public static void generatePawnMoves(Board board, List<Move> moves) { ... }

In the above example, the comment is most likely incorrect (it probably refers to the generatePawnCaptures method), and for sure not useful for a beginner user of the library. It was necessary for me to check the implementation to understand the list of moves is enriched by side-effect, which in turn implies List can not be immutable.

Another popular example is the method Board#isMoveLegal(...) that confused many ones, myself included, and for which the Javadoc does not say much πŸ™‚

I could offer to support with this, and with the code/documentation in general. However, I would like to understand first if there are any guidelines on how to contribute to the project and specifically what information you would expect to see documented in the Javadoc.

alessandrodalbello commented 2 years ago

FYI, started working on this in this forked branch. Let me know if you have any objections.

bhlangonijr commented 2 years ago

Hello @alessandrodalbello , I am very much interested in your contributions. It'd be nice though to keep a single repo. You could send some PRs and I'd gladly merge them into this repo if it makes sense. This library is a byproduct of a chess GUi I was developing in the past (back in 2012) and this is true we have some dust and loose ends here and there. Looking forward to your PRs.

alessandrodalbello commented 2 years ago

Good Carlos, thanks. I'll move the forked branch back into this repo and open the PRs when ready.

alessandrodalbello commented 2 years ago

Solved in #95.