欢迎光临散文网 会员登陆 & 注册

如何写出让同事无法维护的代码 - 李云鹏 #DevFest2021#【CC字幕】

2022-10-23 03:11 作者:裹魁钺  | 我要投稿

演讲者背景:https://dsj.imut.edu.cn/info/1053/3884.htm



03:11


https://book.douban.com/subject/2208597/

《测试驱动开发》


05:42


温伯格《理解专业程序员》


10:45


Roedy Green How to write unmaintainable code

https://www.spigotmc.org/threads/how-to-write-unmaintainable-code-roedy-green.117330/

https://hilton.org.uk/blog/how-to-write-unmaintainable-code

陈皓:如何写出无法维护的代码

https://coolshell.cn/articles/4758.html



11:40




12:17





18:53





19:34


没有尾探,导致箭头式代码

争议:阅读困难,编写省力(少return)

IDEA Alt+ Enter 可以自动重构,添加return


26:27




26:35






28:34


函数嵌套、对象嵌套 一层又一层




30:23



避免上级干扰,坚持正确的设计




34:51




35:45


“在引起问题的框架内思考,将永远无法解决问题。”


36:23


model - view - controller

MVC 的初衷

  • 提高模块复用程度
  • 提高可读性
  • 提高可测试性


40:32


model - view - presenter


diff MVP MVC区别:

The Controller works as the entry point, but in MVP, the entry point is View.

https://askanydifference.com/difference-between-mvc-and-mvp




41:50


业务快速发展,代码快速累积

重构不算绩效,没有动力


45:29


单项依赖,重构成本低



47:30


基于MVP,增加了 “统筹层”





51:06




54:13


1~2个 if-else block


55:00




56:07


use case 单元测试

谷歌蓝图构建系统

https://github.com/google/blueprint


57:25


MVC适用Java后端服务

Android开发种,MVC已经不流行





如何写出让同事无法维护的代码 - 李云鹏 #DevFest2021#【CC字幕】的评论 (共 条)

分享到微博请遵守国家法律