HACKER Q&A
📣 retskrad

How to overcome the struggle to read and understand code?


I am interested in becoming a software engineer but I always fail to get started because I am unable to read and understand code that was not meant for humans. Is there a way to visualize the code and "see" its parts, like one would with the architecture of a car? E.g, this part of the codebase is the engine, this part is the steering wheel, this is the battery, etc. Before coding, can you begin with a drawing of the structure of the code?


  👤 stefanos82 Accepted Answer ✓
If it's hard to understand any code, most probably it's not well-written, thus the inability to read it.

The best approach I can suggest would be to read line by line, at the slowest pace possible, until you get what it actually does.

Yes, it will become boring and exhausting at first, but eventually you will train your brain to see various patterns and understand idioms and schemas without realizing it.

It's like us humans we start with baby steps and eventually we learn how to stand on our feet and run.

Now, if you want to master your craft, in this case the aforementioned running, then you will have to specialize through constant training and finding a coach to guide you how to improve your existing experience and what things you should avoid doing, let alone discard bad practices.

That's really it, I'm afraid :/


👤 uberman
Maybe checkout hits on the phrase "system architecture diagram" and/or "software architecture diagram".

That might give you examples of what you might be looking for. Remember when coming to any code base to take it bit by bit. It usually takes me a while just to devine how the previous author structured their source files.