Is it normal not to understand every line of code in a Flask tutorial?
Asked by
.soil.profile
I'm a computer science student building my first web app in Python, and I'm following the official Flask tutorial to create a blog. I understand the overall structure and what the application is doing, but I don't understand every line or every term yet. Is that normal when learning, or should I stop and fully understand each part before continuing?
Answers
Thereโs a useful distinction between learning code and shipping code. While learning, itโs perfectly reasonable to write code you only partly understand and investigate it as you go. Before other people rely on the application, though, you should understand the important parts well enough to maintain, debug, and secure them. The goal isnโt instant total understanding; itโs steadily reducing the unknowns.
Reply to this answer
Programming is built on layers of abstraction, so nobody understands every detail of everything their code relies on. Even experienced developers use documentation and tools to explain unfamiliar code. Tools such as language models can help explain a snippet, but check the explanation carefully and make sure you can describe what the code does before depending on it in a real project.
Reply to this answer
Thatโs completely normal, especially the first time you work through an unfamiliar codebase. With experience, more patterns and syntax will become intuitive, but youโll always encounter unfamiliar code in new projects. Keep notes about the parts you donโt understand and return to them when you have time.
Reply to this answer
A good way to learn is to get the tutorial working, then experiment with it. Change a value, remove a line, alter the output, or replace a function and observe what breaks. Follow up on the questions that come up. Youโll learn more by testing your assumptions than by trying to memorize every line before moving on.
Reply to this answer
Itโs fine to continue while youโre still filling in gaps, but donโt become comfortable with never understanding them. In particular, make an effort to learn unfamiliar Python syntax, standard-library features, and the Flask concepts that your application depends on. You donโt need to understand every implementation detail of every imported library, but you should understand the code you maintain, troubleshoot, or deploy.
Reply to this answer
Add your answer
Answers are reviewed before publication.
.soil.profile: That makes sense. Iโll use explanations as a learning aid rather than letting a tool write the whole application for me.