The Benefits of Reading Code

I’m a big advocate of reading code. A lot of what I know about programming, Unix, and Emacs, I learned from reading code. Chen Bin has a parallel if slightly different take on reading code. He says that mastering Emacs is easy if you read the code. He likes to treat packages as a collection of APIs whose source code he can read and use for his own purposes.

As an example, he considers Samuel Barreto’s excellent post on refactoring with counsel-ag that I wrote about earlier. Chen spent a few minutes looking at how counsel built the wgrep buffer and then leveraged that to do some additional processing before calling wgrep. It’s worth taking a look at what he did. You probably won’t need his code but it perfectly illustrates his point: if you read the Emacs code it’s very easy to extend it to solve your particular problem.

This entry was posted in General and tagged . Bookmark the permalink.