Weekly#10
2024-9-28 00:0:0 Author: taxodium.ink(查看原文) 阅读量:1 收藏

// What does this evaluate to?
Array.from({ length: 26 }, (x, i) => (i + 10).toString(36)).join(", ")

News | Article

Sanding UI

作者使用 flex 布局实现 radio box,在 label 和 input 之间设置了 gap,发现无法点击,对用户不友好,然后用 padding 替换了 gap。

It’s a small thing, but lots of small splinters lead to an agonizing experience.

这是件小事,但很多小碎片会导致痛苦的经历。

So my recipe is: sand it, feel the grain, get a splinter, sand again, and repeat until smooth.

所以我的秘诀是:打磨,感觉纹理,有刺,再打磨,重复直到光滑为止。

I Like Makefiles

The reason I like makefiles is that they often follow an unwritten convention of implementing the same set of commands to get you up and running.

我之所以喜欢 makefile,是因为它们通常遵循一种不成文的惯例,即执行同一套命令即可启动和运行。

作者喜欢 makefile,是因为它相对来说比较统一,在不同地方构建一般都是 install,build,dev 几个命令,他自己也会使用 makefile 整合其他构建工具。

这样可以减少心智负担,要构建就执行 make build 就好了。

就像有的人会买很多同样的衣服,每天就从同样的衣服里拿,不用纠结穿什么衣服。

makefile 相关的资源还有:

It’s Okay to Abandon Things

和作者类似,当我开始读一本书的时候,如果没有读完,我就不愿意读另一本书。

尽管对在读的这本书不感兴趣了,还得逼着自己读完。

因为不想读,就搁置在一边,但又不肯开一本新书。

作者的建议是可以增加一个“远离书架”:

当一本书不想读的时候,可以快速看看结尾,或者看看别人的书评,然后将它放入到“远离书架”。

这样你依然有机会看这本书,但从精神上把它放一边,让自己可以轻松一些,去看新的书。

由于上述原因,我的 "当前阅读 "书架上只能有一本书,而且我必须在读完这本书后才能把它移到 "已读 "书架上,然后再换一本新书。

去年年底,我创建了第四个书架:"远离 "书架。

如果我读一本书读得不开心,这个新书架就会给我一定的精神许可,让我可以把它移到 "远离 "书架,继续我的生活。

这只是一件小事,似乎并不重要,但它却能让我的大脑允许我不必读完这本书。

我仍在追踪这本书,以及我开始写这本书的事实。

我没有把它从我的 Goodreads 上完全删除。我只是在精神上(以及在网站上)把它放在一边,为其他东西腾出空间。

谁知道呢?也许我以后还会再看,但可能不会了。

书架让它保持开放性,但也不会被人遗忘。

对于电影,至少是在家里看的流媒体电影,我坚持 "十分钟原则"。

如果有人在看电影的前十分钟内不感兴趣,就可以拔掉插头。

我觉得 GTD (Getting Thing Done) 也是类似的策略,它要求你将生活的所有事情收集起来,放到一个系统中,这样脑子就不用一直记着有什么事情没做,脑子就会轻松很多,可以去思考别的事情。

如果对 GTD 感兴趣,可以看看 Getting Things Done (GTD) by David Allen - Animated Book Summary And Review

Thoughts on Debugging

Here’s my one simple rule for debugging:

Reproduce the issue.

That’s the only thing, really.

There are a lot of barriers to this. This is the antithesis to “it works on my machine”.

Debugging is answering the question “why?”.

Magic exists, but I’ve never seen any in software. Problems are logical. Nothing is impossible.

You can solve this problem. You just need to reproduce the issue.

Reproducing the issue should be the team’s number 1 priority.

The issue must be reproduced exactly, not just symptoms of the same behavior.

这是我调试的一个简单规则:

重现问题。

这就是关键所在。这其中存在许多障碍。这与"在我的机器上运行正常"的理念完全相反。

调试就是回答"为什么?"这个问题。

魔法存在,但我从未在软件中见过任何魔法。问题是逻辑性的。没有什么是不可能的。

你能解决这个问题。你只需要重现这个问题。

重现问题应该是团队的首要任务。

必须准确地重现问题,而不仅仅是同样行为的症状。

确实,所谓的“偶现问题”,很多时候只是找不到重现问题的方法。

Often the solution will naturally present itself in the course of debugging, usually by the time you’re successfully reproducing the issue.

It could be that by reproducing the problem, you are gaining the required knowledge to fix it.

However I think there very few actually hard problems and you’re probably not smart and/or lucky enough to work on one.

I’m not sure that I’ve ever worked on a hard problem, at least not for work.

We’re mostly just shoveling mud around in various forms with various amounts of efficiency.

很多时候,解决方案会在调试过程中自然呈现,通常在您成功再现问题时。

可能是通过再现问题,您获得了修复它所需的知识。

但我认为实际上很少有难题,您可能足够聪明和/或幸运到去解决一个。

我不确定我是否曾经解决过什么难题,至少不是在工作中。

我们大多数人只是在各种形式和效率下拧螺丝。

Why I still blog after 15 years

作者回顾了自己写博客的 15 年,为什么写博客,为什么还继续写博客。

关于为什么还继续写,作者的理由是:

  • 我喜欢写作
  • 写作帮助我思路更清晰,也帮我完善想法
  • 发布某些东西迫使我做得更好,因为要发布给别人看,所以需要自己斟酌内容
  • 这个博客是一个记录我个人项目的地方
  • 看看我已经做过的事情的记录,让我感到更好
  • 我乐于将博客作为一个专门解决我自身问题的项目进行开发,可以随便折腾
  • 博客写作帮助我成为更好的作家,这又反过来帮助我成为更好的开发人员

It’s important to point out that it’s not external feedback that has kept me going all these years.

Yes, of course, it’s nice to get the occasional email with compliments, but that’s just a bonus.

I keep this blog for me to write, not necessarily for others to read.

重要的是要指出,并不是外部反馈一直支撑我走到今天。

是的,当然,偶尔收到赞美的电子邮件很不错,但那只是额外的奖赏。

我保留这个博客是为了让我自己书写,而非必须让别人阅读。

How I Think About Debt

“Debt defines your future, and when your future is defined, hope begins to die.”

“债务定义了你的未来,当你的未来被定义时,希望开始消亡。”

But once you view debt as narrowing what you can endure in a volatile world, you start to see it as a constraint on the asset that matters most: having options and flexibility.

但是一旦你将债务视为缩小了你在动荡世界中能够经受的范围,你就会开始将其视为对最重要的资产的约束:拥有选择和灵活性。

买了房,要背负几十年的房贷,再有了孩子,感觉很多选择确实就不敢做了。

Cool Bit

The 34th First Annual Ig Nobel Ceremony

2024 年搞笑诺贝尔奖。

解剖学奖
Marjolaine Willems, Quentin Hennocq, Sara Tunon de Lara, Nicolas Kogane, Vincent Fleury, Romy Rayssiguier, Juan José Cortés Santander, Roberto Requena, Julien Stirnemann, and Roman Hossein Khonsari, 研究了大多数人头发的旋转方向 (顺时针还是逆时针?) 是否与南半球大多数人的头发旋转方向相同。
医学奖
Lieven A. Schenk, Tahmine Fadai, and Christian Büchel,证明引起痛苦副作用的假药比不引起痛苦副作用的假药更有效。
概率奖
František Bartoš, Eric-Jan Wagenmakers, Alexandra Sarafoglou, Henrik Godmann, and many colleagues, 通过理论和 350,757 个实验证明,当你投掷硬币时,它倾向于落在与起始状态相同的一面。

Tool | Library

git absorb

git absorb 会识别一些相近的 fix 改动,自动打上 fixup! 标记,方便 rebase.

git add $FILES_YOU_FIXED
git absorb
git log # check the auto-generated fixup commits
git rebase -i --autosquash master

Music

这周听的很多的是窦靖童的两张专辑: 《春游》和 《空中飞人》。

在我的播放器里,在窦靖童之后的就是関取花的《中くらいの話》,也听了很多遍。

Date: 2024-09-28 Sat 00:00

License: CC BY-NC 4.0


文章来源: https://taxodium.ink/10.html
如有侵权请联系:admin#unsafe.sh