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

建议补充C/C++的#include语句 #1225

Open
dasferco opened this issue Apr 5, 2024 · 1 comment
Open

建议补充C/C++的#include语句 #1225

dasferco opened this issue Apr 5, 2024 · 1 comment

Comments

@dasferco
Copy link

dasferco commented Apr 5, 2024

我看了看文中示例代码,目前Python的代码都带有import语句,但C/C++没有#include语句。建议把导入库的语句都补充上,这样一是方便复制后直接运行,二是能让刚学会编程的小白熟悉需要导入的库,看久了自然就记住了。repo中的源代码也一样,相比#include "../utils/common.hpp"一股脑导入,不如挨个把需要的库列出来。

@krahets
Copy link
Owner

krahets commented Apr 6, 2024

谢谢建议!

目前Python的代码都带有import语句
一是方便复制后直接运行

文章中的所有语言代码应该都不带有 import 语句,Python 带有 import 的应该只是少数代码。运行代码应直接前往源文件,不建议通过复制运行

二是能让刚学会编程的小白熟悉需要导入的库

有道理,这种方式确实不利于小白熟悉导入库。起初是希望通过这种方式减少代码长度,并方便贡献代码

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants