4 ms·
I already have to read source code by doing my team's reviews, and I don't enjoy it. Maybe it's because of the responsibility (why didn't you caught this bug i
by renox 7y ago
I already have to read source code by doing my team's reviews, and I don't enjoy it.
Maybe it's because of the responsibility (why didn't you caught this bug in the review?), but it's really difficult.
- pbalau 7y agoThen maybe you are not meant for this? Yes, I do find it really hard to read code I have no interest in, but it was proven that if I understand the underlying idea, I can both read and find issues with the code I'm reading. The first rule is to care and understand what the code is trying to do.
- mikekchar 7y agoI have found that the secret (for me) is to manufacture some reason to read the code. Code is difficult to read from top to bottom unless it's done in a literate style. Instead, it is much more pleasurable if you are jumping around reading code because you want to understand something. I find that editing the code makes a big difference. Find something to chage. Refactor something. Add a tiny (even meaningless) feature. This forces you to understand what the code is doing. That, in turn, forces you to explore the code and to read it. It also gives you a gauge to judge the code against. Why did they do it that way? What if I changed it? Oh, I see why the couldn't do it like that. Yes, their solution is quite nice. That kind of thing. I very frequently refactor PRs at work and show my refactoring to nobody. Usually it's 6 of 1 half a dozen of the other. However, it gives me an idea about how flexible the code is. Or I might start to implement the next feature that's likely to touch that code. Not TDD. Just sketching some code and seeing how easy it is. If you've never tried it, I highly recommend it.