在Hacker Daily News上看到的一篇文章,作者提到了,當他發了一個PR到某個專案上時,專業的維護者的一些review 評論對他來說非常受用,也讓他了解到一些程式語言上 的特性與knowhow。
透過這個經驗,作者也發現了,當他去翻一些開源專案上的merged/closed PRs時,也可以發現類似的撰寫建議;所以他歸納這可以是一個通用法則,並且可以用在各個程式領域上:
I learned so much from reading the comments and concerns on my PRs. But it doesn’t have to be my PR. It can be anybody’s.
How To Rapidly Improve At Any Programming Language (cbui.dev)
簡而言之,在一個成熟且大型的開源專案上,開發與維護者通常都會是非常聰明且有知識的開發者,所以透過學習這些PRs 的建議與評論可以挖掘到許多無價的經驗。
因此作者也給了一些如何開始的建議:
1. Every morning, take your favorite open source library or one from a language you’re learning, go to the closed PRs on Github and start reading them from the beginning. Just a few a morning for warmup while you drink your morning coffee and catch up on email.
2. When you want to level up, start reading the diff, and review the code and changes yourself before reading the comments.
3. Finally, when you start feeling more confident, start leaving those comments on new PRs so that the maintainer doesn’t have to. You’re starting to contribute to open source!
How To Rapidly Improve At Any Programming Language (cbui.dev)
原文可以參考這裡:
How To Rapidly Improve At Any Programming Language (cbui.dev)