rust-lang-ja / ac-library-rs

ac-library-rs is a rust port of AtCoder Library (ACL).
Creative Commons Zero v1.0 Universal
217 stars 26 forks source link

Decide and document a guideline for choosing implementation details #18

Open MiSawa opened 4 years ago

MiSawa commented 4 years ago

There are two very different way of choosing how to port the original C++ library;

For example, there are a lot of ints used as indexing vectors in the original C++ implementation. If it had been implemented in Rust from the beginning, it would have been usize. Another example would be method name, like fn empty() -> bool. While it is very common in C++ to name such a method empty, all such methods in Rust that I know of are named is_empty.

Having a guideline would help make this kind of implementation choosing consistent across modules as well as code reviewers.

TonalidadeHidrica commented 4 years ago

Another point: https://github.com/rust-lang-ja/ac-library-rs/pull/3#issuecomment-688946050

statiolake commented 4 years ago

In my opinion, we should modify the API if it makes codes more Rust-friendly, because:

However we need a working version of the library. The earlier, the better. Porting would be delayed if we were too sticky to make it Rust-friendly.

So my opinion: