Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change directory name from src to lib #49

Closed
universato opened this issue Oct 9, 2020 · 2 comments · Fixed by #51 or #53
Closed

Change directory name from src to lib #49

universato opened this issue Oct 9, 2020 · 2 comments · Fixed by #51 or #53

Comments

@universato
Copy link
Owner

universato commented Oct 9, 2020

他言語を見てsrcディレクトリにライブラリを入れてしまいましたが、改めて考えたところsrcはコンパイル言語でのコンパイル前のコードを入れるイメージです。
bundle gemでgemの雛形を作るときにlibディレクトリが作られるそうで、Ruby使う人にとってはlibがわかりやすいのかなと思いました。本レポジトリの性質的にもlibがあっていると思いました。
なお、自分としては、本家AtCoderライブラリに合わせているものの、AtCoderに限らず一般的に競プロなどで使われるライブラリを置いているつもりなので、本家ライブラリに合わせてatcoderという名称を用いるのはわかりやすいですが美しくない気がするので反対です。

ディレクトリ名srcとかの謎と作法 - WebTecNote

srcディレクトリにソースを入れ、ビルド結果をbuildディレクトリに入れるのは「コンパイルする言語ではお馴染みの作法」でも、コンパイル不要だとそうでもない。
EclipseなんかでJavaの新規プロジェクト作るとデフォルトでsrcというフォルダが作られるがPythonやRubyでは作られない。

@magurofly
Copy link
Contributor

私としましては、 lib/atcoder にするのがいいのではないかと思います。
必要以上にややこしいかもしれませんが、 expander-rb でバンドルするときに require "atcoder/max_flow" のような書き方ができるようになるので。
いえ別に require "max_flow" でもいいですし、 expander-rb の方を書き換えてもいいのですが。

@universato
Copy link
Owner Author

universato commented Oct 12, 2020

コメントありがとうございます!

PriorityQueueはこっちにあってAtCoderライブラリにはなかったり、AtCoder以外の競プロサイトなどで使える観点で、もしそういう方向性ならatcoderじゃなくてaclibraryなどの名称にしたいです。

ただ、今のところメインがコピペ想定でrequireを使わないので、まだ階層は深くはしたくないです。

他に、gem化したいという少し気持ちがあり、そういうときはrequire "aclibrary"などで書けると嬉しそうです。

@universato universato linked a pull request Oct 13, 2020 that will close this issue
@universato universato linked a pull request Oct 13, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants