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

【项目开发的思考】 #79

Open
kind-hearted opened this issue Sep 15, 2020 · 0 comments
Open

【项目开发的思考】 #79

kind-hearted opened this issue Sep 15, 2020 · 0 comments

Comments

@kind-hearted
Copy link
Owner

kind-hearted commented Sep 15, 2020

命令规范:

文件夹、变量、路由、文件名、样式类命名需要规范

编码规范:

代码缩进、注释、参数注释等

目录设计:

同一功能考虑放在同一个文件夹内

设计模式:

适当考虑使用设计模式,如使用发布-订阅模式进行解耦、策略模式去if-else等

单元测试:

复杂逻辑适当的进行单元测试

魔法数字:

尽量避免在逻辑代码内使用魔法数字,导致阅读维护困难

说明自身:

使用README.md,描述项目的背景,目录结构,需求文档、设计稿、第三方服务、后台接口文档、缺陷修复地址(如有必要提供访问账号),描述项目启动、构建、部署等信息,描述注意事项。

版本管理:

使用git做版本管理,在分支上开发,UAT结束后,发布生产的时候,在对应的commit上打上tag,并构建release版本,方便跟踪、回滚,生产测试没有问题,将分支代码合并到主干。合并完,继续拉分支开发,此时如果生产出问题需要修复,从主干拉修复分支,完成后再合并到主干及开发分支。

提交信息:

代码提交以功能为单位提交,并备注说明本次提交的修改内容,涉及功能

总结:

上述都是为了项目易维护作为出发点的,考虑一个新员工入职可以快速熟悉项目,员工离职交接时,项目也是清晰的,减少交流、交接成本。

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

1 participant