知识卡片
折叠按意图浏览再展开细节
文件、类和函数名像标题及小标题,先让读者知道做什么,必要时再读怎么实现。折叠可帮助观察层级,但如果名字含糊,隐藏实现只会隐藏信息;可读性来自正确分组与意图表达。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · 代码编辑器生产力
原书出处 · 1 处
- · 查看原书依据
Using the Newspaper Metaphor to Write Readable Code The Newspaper Metaphor states that we naturally read—and hence should write—our code like we would a newspaper article. We start by reading the headline. If the headline is of interest to us, we may read a summary paragraph and skim through section headers. Where we need to go into details, we can dive into the paragraphs. Likewise
参考来源
- 位置:《Effective Machine Learning Teams (David Tan, Ada Leung, David Colls)》第07章《代码编辑器生产力》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Effective Machine Learning Teams (David Tan, Ada Leung, David Colls)/_epub-src/OEBPS/ch07.html)
- 结论依据:摘录中关于折叠按意图浏览再展开细节的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:Using the Newspaper Metaphor to Write Readable Code The Newspaper Metaphor states that we naturally read—and hence should write—our code like we would a newspaper article. We start by reading the headline. If the headline is of interest to us, we may read a summary paragraph and skim through section headers. Where we need to go into details, we can dive into the paragraphs. Likewise