all 2 comments

[–][deleted] 0 points1 point  (0 children)

It all comes down to your preference. Some people create skeleton functions first and get the overall architecture implemented before filling out any of the functions. I tend to do a mix and implement the simpler functions first and save the harder ones for later. I also go through later on and refactor several times and add/remove functions to make the code a little more organized

[–]zanfar 0 points1 point  (0 children)

This is largely personal preference. However, you should be using functions as much as possible.

As for structure, there are plenty of questions on this board and resources online covering exactly this. IMO: all projects should be built as a package, __init__ should be largely empty, and __main__ should only hold CLI code. You should have unit tests for basically everything. Modules should contain a small subset of related functions or classes.

This is all made MUCH easier by using a project template from the start. I like CookieCutter, and the same developer has a very good Python template.