📢
2
c/coding-for-beginners•simonl49simonl49•24d ago

I used to write all my Python code in one giant file until a project crashed last Tuesday.

Now I break everything into separate modules, which my friend in Seattle called 'basic architecture'. Anyone else have a simple habit that saved them from a coding mess?
3 comments

Log in to join the discussion

Log In
3 Comments
clairem81
clairem8124d ago
My old habit was keeping all my functions in a single script (it just felt easier). A few months back, I spent a whole weekend trying to find one tiny bug in that mess. Splitting things into separate files now feels like a superpower for finding problems.
10
gibson.oliver
gibson.oliver24d agoMost Upvoted
My first real project had a 2000 line main file. Debugging felt like searching for a needle in a haystack while blindfolded. Breaking it into modules cut my bug hunting time in half, easy. It feels like extra work upfront but saves so many headaches later. I wish I learned that lesson way sooner.
3
the_richard
Honestly, I still find one big file easier to manage sometimes.
-1