Read the source
What is the best way to become a better writer? Reading more. The same concept can be applied to programming.
I've been reading a lot of source code recently. Of course, not for fun. I had a troublesome task I'd never done before. Therefore I didn't know where to start.
So I've git-cloned an open-source library that solved a similar problem, and decided to adapt it to my needs. Little did I know what awaited me. I wanted to take the path of least resistance but found myself reading and understanding the code written by a stranger. Luckily, the package was small and relatively simple. However, I've managed to learn a lot of new things and changed my view on this topic.
Here is how reading sources may benefit you as a developer:
- It may help you to learn from gurus. Let's imagine you know a skilled programmer, but he is not as public as he could be. There is no conference with him on youtube you could watch or blog you could read. However, he contributes to open-source. The only way to learn from him is to read his code and try to understand something.
- Sometimes it's easier and faster to read the sources than look through docs or watch a tutorial on Youtube. Moreover, library creators often leave many comments in their code.
- You'll learn how popular libraries work under the hood and will be able to choose the most appropriate one. I often see heated debates about state management libraries/approaches in Flutter. How one is 1000 times faster and more convenient than another. Hello, GetX versus anything else. Everything in Dart/Flutter world is open-source. So try to understand how does it work.
- You develop a crucial skill - reading code. It's not a secret that an average developer spends more time reading code than writing. So, read more code to read code more efficiently.
- You may start contributing to open-source. Many companies appreciate it when hiring a developer. Maybe you'll add a new feature that many people need or fix an annoying bug when the maintainer has no time for it.
CAUTION! You can also face suboptimal code when sneaking through GitHub repositories. How to distinguish the good from the bad? I think you should know the basic "code smells" and have a bit of experience to trust your guts.
#career #dev #efficiency #thoughts
Post #23
217