4 ms·
I've pretty much come to the conclusion that you don't understand code by reading it. Understanding someone else's code is almost always a reverse engineering
by curtis 13y ago
I've pretty much come to the conclusion that you don't understand code by reading it. Understanding someone else's code is almost always a reverse engineering exercise. It's often necessary to actually run the code repeatedly to understand it. This should really come as no surprise. It's likely that the guy that wrote the code didn't write it all at once, but rather wrote it in increments testing along the way. If he couldn't write it without testing every little bit, it's unlikely that you can read it without doing the same.
- has2k1 13y agoYou Don't Write Code, You Develop It.
- mden 13y agoGood observation and I completely agree. On a slight tangent I've been spending time thinking if I had the ability to change the high school curriculum, how would I do it? So far the thought that has had the most appeal to me is to introduce "reverse engineering" as a core subject. I don't mean reverse engineering in the software or hardware sense, I mean it in the sense of a collection of logical techniques for figuring out the logic behind something phenomena or problems. In some sense "forward engineering" requires reverse engineering from the conceptual finish of a product to its current nonexistent state. Science is the reverse engineering of the laws of nature. But rather than have schools teach any of those skills, they teach encyclopedic knowledge. Knowledge is useful, but without the skills to analyse and use it, it's just wasted effort and brain space.
- vishnugupta 13y agoCompletely agree to this! One very rarely comes across a completely self contained piece of code such as sorting or searching. The code you are reading or exploring is usually a piece of a larger scheme of things; held together by scaffolding so to say. And unless one actually runs the system (not just that specific code) end to end it's really difficult to understand. I've also found it very useful to slightly modify the code and compare my expectation with the actual result of a test run.
- codeflo 13y agoI think it's entirely possible to write readable code, i.e. code that you don't have to single-step through to understand. But that takes a conscious effort, and is in any case more difficult and more work than writing code that is merely correct.