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

July:关于代码和图片重新命名的问题 #234

Open
julycoding opened this issue Mar 22, 2014 · 19 comments
Open

July:关于代码和图片重新命名的问题 #234

julycoding opened this issue Mar 22, 2014 · 19 comments

Comments

@julycoding
Copy link
Owner

首先,无论是优化后的C/C++代码,还是其它语言的代码,还是都放到这个文件夹下:ebook/code,这里说下代码命名的问题。

请大家不要再把代码名弄为chapter23.c之类的,因为最近目录在不断调整,可能原来是第23章,过两天后,原文就变成了第3.2节。

举个例子,如3.2:杨氏矩阵查找.c,之前是命名为chapter23.c,往后请一律找到现在目录对应的章节,暂命名为:3.2:杨氏矩阵查找.c,“现有目录:章节名字.c”,这样方便其他朋友把文章和代码一一对应起来,好阅读。

如还是不清楚,请参考C 代码的命名:https://github.com/julycoding/The-Art-Of-Programming-By-July/tree/master/ebook/code/c

故,照上述代码命名规范,烦请@liuyang1 改一下Python代码的命名:https://github.com/julycoding/The-Art-Of-Programming-By-July/tree/master/ebook/code/python ,其它语言Java、PHP、Go、JS、ruby、scheme的代码亦是如此,也都烦请重新命名下,thanks 各位。

这里的图片也都需要重新命名:https://github.com/julycoding/The-Art-Of-Programming-By-July/tree/master/ebook/images

@julycoding julycoding changed the title 关于代码命名的问题 July:关于代码命名的问题 Mar 22, 2014
@Frederick-S
Copy link
Contributor

如果需要文件夹(我看了下 Java 出现了文件夹,因为有时候定义了一些类;JavaScript 也需要,因为需要一个 test.html 和一个 tests.js 来执行测试),这个文件夹如何命名?
像这样?

/ 现有目录:章节名字
    - 现有目录:章节名字.js
    - test.html
    - tests.js

@fairywell
Copy link
Contributor

自己建立一個你的問題的子目錄不行嗎?比如 BoardTravelDP/ ,子目錄下你自己
怎麼折騰都行吧。如果是公共庫,可以考慮建設一個 code/java/common 之類的目錄

于 2014年03月24日 08:15, Frederick-S 写道:

如果需要文件夹(我看了下 Java 出现了文件夹,因为有时候定义了一些
类;JavaScript 也需要,因为需要一个 test.html 和一个 tests.js 来执行测
试),这个文件夹如何命名?


Reply to this email directly or view it on GitHub
#234 (comment).

@Frederick-S
Copy link
Contributor

@fairywell 我的意思和你一样,问题是,既然这里说到了命名规范,那么目录的命名规范是什么。

@fairywell
Copy link
Contributor

不知道兄弟说的是哪里提到的规范?上周讨论是说这周哪一个code style的初稿,
没有说道目录?

如果没有相应规范,frederick兄拿一个?

于 2014年03月24日 12:34, Frederick-S 写道:

@fairywell https://github.com/fairywell 我的意思和你一样,问题是,既
然这里说到了命名规范,那么目录的命名规范是什么。


Reply to this email directly or view it on GitHub
#234 (comment).

@julycoding
Copy link
Owner Author

@Frederick-S
你觉得怎样更好可以自己拿捏。

@fairywell ,咱们github上有这么多朋友,不是全部在北京,所以每周末参加编程艺术线下讨论的只能占极少数,所以咱们的讨论结果如果没有放在github上,其他人不会知道。
等咱们线下定了相关的规范后,再发个issue 好好讨论代码和命名规范的事。

@Frederick-S
Copy link
Contributor

@julycoding 我了解了,谢谢。

@julycoding julycoding changed the title July:关于代码命名的问题 July:关于代码和图片重新命名的问题 Mar 24, 2014
@julycoding
Copy link
Owner Author

这里的图片也都需要重新命名:https://github.com/julycoding/The-Art-Of-Programming-By-July/tree/master/ebook/images

@chenrenyi
Copy link

认领图片命名。是直接重命名,并且修改文章中相关图片路径吗?

@julycoding
Copy link
Owner Author

@chenrenyi
图片可以直接重新命名么,还是需要重新上传,然后再修改文中相关图片路径?

@fairywell
Copy link
Contributor

既然谈到了重命名,我重申下以前的一个观点:
任何文章、图片、代码、目录的名字中,都不带章节数字(如9.3xxx
2.5.4xxx.md),而采用类似 LCAProblem/ LCAProblem.c LCAProblem-pic-1 这样
的名字,最后只在目录中对这些内容作映射,是一种最佳的解耦方式。如果有内容
上和章节上的调整,只需要改动目录那一个文件即可。

FYI~~

于 2014年03月24日 14:51, July 写道:

@chenrenyi https://github.com/chenrenyi
图片可以直接重新命名么,还是需要重新上传,然后再修改文中相关图片路径?


Reply to this email directly or view it on GitHub
#234 (comment).

@julycoding
Copy link
Owner Author

@fairywell
“任何文章、图片、代码、目录的名字中,都不带章节数字(如9.3xxx
2.5.4xxx.md),而采用类似 LCAProblem/ LCAProblem.c LCAProblem-pic-1 这样
的名字”

这样做,不容易根据文章一眼找到对应的代码,有个章节数字可以很快的定位到。
所以,不建议。

@fairywell
Copy link
Contributor

好,拿就先按照现在的方法做吧

如果咱们的章节和内容以后变动不大,以后应该好处理;但如果有较大的调整,会有一些(甚至不少的)麻烦。

“不容易根据文章一眼找到对应的代码” 你可以看看tex如何处理这个问题的

于2014年3月24日 15:02:33,July写到:

@fairywell https://github.com/fairywell
“任何文章、图片、代码、目录的名字中,都不带章节数字(如9.3xxx
2.5.4xxx.md),而采用类似 LCAProblem/ LCAProblem.c LCAProblem-pic-1 这样
的名字”

这样做,不容易根据文章一眼找到对应的代码,有个章节数字可以很快的定位到。
所以,不赞成。


Reply to this email directly or view it on GitHub
#234 (comment).

@julycoding
Copy link
Owner Author

@fairywell
“但如果有较大的调整,会有一些(甚至不少的)麻烦”,哪些麻烦?
你可以看看tex如何处理这个问题的,tex 是如何处理的?

@fairywell
Copy link
Contributor

比如,如果要删掉第九章第7张图片,那么9.7以后的数字全部要重排,其他有引用该章节的数字也要全部重排

相信july已经考虑过这些,把章节统筹稳定,现在这样做道也是省力的一个方法。

于2014年3月25日 14:55:52,July写到:

@fairywell https://github.com/fairywell
“但如果有较大的调整,会有一些(甚至不少的)麻烦”,哪些麻烦?
你可以看看tex如何处理这个问题的,tex 是如何处理的?


Reply to this email directly or view it on GitHub
#234 (comment).

@sfdye
Copy link
Contributor

sfdye commented Apr 26, 2014

@julycoding 我来给python重命名吧。另外,如果想contribute其他语言的代码,是不是直接pull request就可以了?

@julycoding
Copy link
Owner Author

@sfdye
恩,是的。

@huskyii
Copy link
Contributor

huskyii commented May 23, 2014

是不是可以考虑将命名规范改成如下格式?
如:02.01:寻找最小的 k 个数.c
这样就不会出现
10.1.3 在 1.3 和 2.1之间显示
6.11 在 6.4 之前显示
这样的问题了
强迫症表示这样看着非常不舒服

@Boshen
Copy link
Collaborator

Boshen commented Jun 12, 2014

大部分问题已经解决。

@Boshen Boshen closed this as completed Jun 12, 2014
@julycoding julycoding reopened this Jun 12, 2014
@julycoding
Copy link
Owner Author

这个还要进一步调整,所以先reopen 了。

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

7 participants