2021/11 Flomo 笔记


2021-11-10 18:39:19

好好的人,怎么一读书就困了?

认知科学发现:我们对于那些语言组织方式不那么流畅的书,「信息转换」的效率更差。

读书犯困,是大脑在保护你

阅读则是一项充分调动大脑的行为,不仅需要眼睛的准确辨识,记忆的不断撩拨,与此同时还需要长时间的、沉浸式的输入与思考。

就好像运动久了会累一样,大脑在经过较长时间的认知负荷后,也会让人产生大脑需要休息的生理指标——「精神疲劳」(Mental fatigue)

有的人不困,是天赋,脑子天生就好


2021-11-09 17:59:25

As in Maslow’s pyramid, each layer requires the previous one. It is useless for code that is charging the wrong customer to be readable.

Code should be:

  • Correct: does the code do what it’s supposed to? Does it handle edge cases? Is it adequately tested to make sure that it stays correct even when other engineers modify it? Is it performant enough for this use case?

  • Secure: does the code have vulnerabilities? Is the data stored safely? Is personal identification information (PII) handled correctly? Could the code be used to induce a DOS? Is input validation comprehensive enough?

  • Readable: is the code easy to read and comprehend? Does it make clear what the business requirements are (code is written to be read by a human, not by a computer)? Are tests concise enough? Are variables, functions and classes named appropriately? Do the domain models cleanly map the real world to reduce cognitive load? Does it use consistent coding convention?

  • Elegant: does the code leverage well-known patterns? Does it achieve what it needs to do without sacrificing simplicity and conciseness? Would you be excited to work in this code? Would you be proud of this code?

  • Altruist: does the code leave the codebase better than what it was? Does it inspire other engineers to improve their code as well? Is it cleaning up unused code, improving documentation, introducing better patterns through small-scale refactoring?


2021-10-29 13:31:00

比特币

加勒特·哈丁所谓的公地悲剧?
在这种经济情况下,每个人根据自身的利益各自采取理性的行动,过度消耗公共资源背离了整个群体长期的最佳利益。

典型的案例就是一群牧民在一个公共牧场放牛。要限制自己的牛吃草来保护牧场并不符合牧民的自身利益,这导致了公共资源(也就是牧场)的过度使用和消耗。