[Class Report] Introduction to System Development – Week 9: Let’s “Organize” Our Programs!
This week’s lesson focused on a key topic now that students are writing longer programs—how to organize code. Specifically, the class learned about file separation and modularization, discovering how to make code easier to read and reuse.
■ Opening: “It’s Time to Graduate from Writing Everything in One File!”
Mr. Tanaka: “Didn’t your code feel a little long during last week’s presentations? Today, I’ll show you how to tidy things up!”
He used a kitchen analogy: “Imagine trying to cook with all your tools tossed into one box. It’s hard, right?” Likewise, organizing your code makes development smoother.
■ Practice 1: Let’s Move Functions into Separate Files
First, students practiced saving their own functions in a separate file and importing them using import
.
File 1: greeting.py
def say_hello(name):
print(name + ", hello!")
File 2: main.py
import greeting
greeting.say_hello("Yamada")
Mr. Tanaka: “This way, greeting.py
acts as a ‘module.’ You only call what you need, and your main.py
stays clean and readable.”
Student A: “Whoa, I didn’t know we could organize code like this!”
Student B: “Feels like a real pro project!”
■ Practice 2: Organize Your Own App into Files
Next, students reorganized the mini-apps they created last week by separating logic, input, and output into individual files.
Example: 3-File Structure
logic.py
→ Handles calculations and diagnosis logicui.py
→ Handles display and messagesmain.py
→ Controls execution and program flow
Student C: “It’s easier to read and I think I’m making fewer mistakes.”
Mr. Tanaka: “And when you need to fix something later, you can focus on just the part that matters. It’s efficient.”
■ Quiet Time: Taking on the Challenge of File Separation
The task: “Organize your program into three or more files, and make sure it runs correctly.”
Though many struggled with the unfamiliar import
statements, the classroom was filled with focused determination.
Student D: “At first it was full of errors, but once it worked—it felt amazing!”
Student E: “Maybe this is what it means to have ‘organizational skills.’”
■ Teacher’s Comment
“Modularization is also a preparation for working with others. When you start developing in teams, being able to structure your code like this becomes incredibly important.”
■ Next Week’s Preview: Practicing Code Reviews and Improvements!
Next time, students will take on code reviews, a practice widely used in real-world development.
Together, they’ll explore what makes code understandable and communicative by reading and giving feedback on each other’s programs.
Organizing code is both a fundamental and advanced programming skill.
Now that students are writing more code, this was an important step toward learning how to keep things clean and well-structured.