

However, when taking on a new language, reading source code is a very efficient learning method. Learning a new programming language doesn’t just mean learning the syntax. When you want to learn a new programming language. Without that focus, your attempts at understanding the source will be less effective. You have to start out by choosing a target. The next problem is, with so many great works to choose from, what kind of source code should we read? Ok, so there are benefits to reading source code. This will broaden your understanding of coding as a whole.

Instead, try to expand to a new area, always try to find a new domain which you haven’t touched in your day-to-day work, but that interests you. Don’t satisfied with the job of fixing some bugs or adding some trivial features to an existing system. Generally speaking, if you don’t push yourself constantly, your programming skills will be the average of your colleagues. Most programmers only code in a few specific domains. Reading source code is a good way to investigate this kind of problem, and a very good opportunity to learn something new. If you haven’t met this kind of problem, it just means you haven’t programmed for long enough :). Throughout your programming career, you will eventually encounter problems that you can’t solve by googling. Most mistakes have already been made by others. An added benefit of learning from others is the ability to avoid common pitfalls. There are countless examples of good programming, paradigm choices, designs and architecture to find in these projects. It offers enlightenment, not just information and knowledge.īy browsing the source code of the Linux Kernel, Redis, Nginx, Rails or any other famous projects, you draw on the wisdom of thousands of top-level programmers all over the world. Great source code is like a literary masterpiece. There are three benefits to reading code intentionally. Same as reading books, reading code on purpose will help programmers grow much more quickly, especially for intermediate programmers.
#BZFLAG SOURCE CODE HOW TO#
– Stephen King in his memoir, On Writing.Īs Stephen King observed, a writer must read widely and frequently to develop their own voice, and learn how to pen sentences and structure stories in ways that compel readers to pick up their work and read it. “If you don’t have time to read, you don’t have the time (or the tools) to write. Over the years, we then read the works of great writers at differing levels of difficulty, and practice various writing techniques. Remember how you learned to write at school? Our ability to write comes from having read large volumes of text, starting from primary school and on. Coding and writing both have the same common ideal, to express our ideas. Donald Knuth even introduced the programming paradigm of literate programming. When I say “read code” I refer to the practice of reading source code on purpose.Īs we know, programming and writing have much in common.

Still, the way we teach programming emphasizes the art of writing code, not how to read it. After years of study, most programmers can “write” code, or at least copy and modify it. Why we need to read codeĪs programmers, we deal with source code every day. These are my tips for learning from source code. This isn’t the kind of thing you pick up from books or tutorials.” “You should do an article about this,” he suggested then. We discussed it for some time, I described a few ways to read source code more efficiently. I was talking to a younger programmer last week, when he asked me: Explain why we need to read source code, how to read code and learn as much from source code.
