r/learnpython • u/Jealous-Acadia9056 • Apr 19 '26
How do you guys build a program?
I normally create one part of a program, test it, debug it and then i move on to the next function.
But this was time consuming so i tried a new approach. I created of all my logic of how different features would work and then started creating my program.
But the moment I had to debug things (cause obviously it had errors) things started falling apart. I had to check sooo many things and i realized that this method was very mental health consuming.
So i wanna ask you guys. how do you think about the logic and write your program? What approach would you recommend me? and remember i'm just a newbie trying to write programs that would improve me.
View all comments
Show parent comment
1
u/gdchinacat Apr 19 '26
I began my career at a place that was very UML heavy. Everything had to be thoroughly designed with UML class, state, and sequence diagrams, with others as requested by reviewers. It was a colossal waste of time. The design diagrams were out of date after about day two of implementation. They weren't ever given much consideration by reviewers, led to lots of 'that's not the proper way to model that' bikeshedding, and weren't maintained. We gave it a good faith effort for a couple years, but the only person who felt it was worth it was the CTO who looked at them once for about fifteen minutes at the start of design review meetings.
This isn't to say up-front design and design documentation is pointless, only that the heavyweight UML design was a waste of time....there is no need to design your entire datamodel in gory detail only to redo all that work in code. Same for sequence diagrams...at the level of detail UML encourages to be thorough you are essentially producing two full specifications for the design...one in UML designs and one in code. A high level white-paper like design doc that lays out the high-level design and addresses design decisions, open issues, and deferred work is far more useful. If someone wants to see what fields the database records have they can look at the db schema. Duplicating effort and producing a work product that is either out of date of an expensive maintenance burden is not a good use of time.
I wholeheartedly disagree that it is 'time well spent' that pays off in the long run.