Hey there! I'm at a low-intermediate level in Python and I've faced this challenge a few times. How do programmers decide on the final data structure and functions they need before writing any code? Right now, I'm developing a clicker game in Python. I began with the basic gameplay loop: click the button, the number increases, access the shop, buy upgrades, and so on. However, things got messy as I tried to untangle the systems once I realized that my initial structure wouldn't support more upgrades effectively. I even started experimenting with JSON to dynamically manage items instead of hardcoding everything. At my current skill level, I didn't recognize that a well-structured JSON could have streamlined much of my work. It seems like experienced developers can foresee what their JSON should look like before they even start building. Is that just something you learn with time?
4 Answers
Honestly, you can't always know beforehand. That's where prototyping comes into play! You build something, learn from it, and then refine it. It’s a process of trial and error, and that's totally normal in software development.
No one can predict everything in advance! That's what refactoring is for. Look it up; it might really help you understand how to adapt your code as your project grows.
I would have chosen SQLite over JSON for this type of project. It can simplify data handling a lot! But as mentioned by others, prototyping and iterating is key.
Great question! It’s not really about planning everything ahead. Surprises are just part of the game in software. Fred Brooks, in his book "The Mythical Man-Month," suggests you should "build one to throw away." You create an initial version, learn from it, and then recreate it with newfound knowledge. Experience definitely plays a huge role in figuring stuff out for next time!
The trick is not to throw your work away! Good developers focus on refactoring. As you develop, keep improving your codebase so you won’t need to start from scratch and can end up with solid architecture.

I get it, probably not what I wanted to hear, but it makes sense. Experience will definitely help. I realized that I could use nested JSON to populate the UI dynamically for upgrades instead of creating each element individually. Thanks for the insights!