Design question
Hi to all.
I'm adding to some code a configuration file (ini via configparse), command line options (with argparse) and logging (with the respective module).
I'm wondering if it's better to do all the initialization and configuration directly in main() or to put them in functions (like ini_reading(), args_reading(), configure_log()) or even one big function calling all the others (like do_the_config() )
Thanks
Posted Feb 16, 2021, 7:02 PM UTC
12
Do that in separate functions, and call those in main()
Yes, that's was my first idea, but then i had some thing intertwined and i blocked.
I will take the less complex path and delay the logging start until all the configuration got read.
Thanks