Release 0.4 Progress - Organizing the code

 After taking some time to understand the code that runs the bot, I was able to separate the code out into a few different categories that would be placed into their own files, code that creates the classes that manage the checking of reddit posts and comments, code that manages the bot streaming and posting to reddit, code that initialized the initial state of the bot and code that provides general utility to the bot. 

Once I was able to separate out all that logic, the next issue I need to tackle now is how to make the code work while flowing through these different files. Currently since the app operates in one file, the bot creator has been making use of a lot of global variables instead of constantly passing variables through several functions. I dont think this solution is ideal so I currently I am working on a more efficient solution that doesnt involve passing several variables across functions and files. I think perhaps creating a dictionary that contains critical data that can be stored and passed along instead of having several different variables. 

I also want to see if there is any option to cut down on the amount of code needed by making some functions more reusable. 

Comments

Popular posts from this blog

Planning for Release 0.4

Adding Features and Pull Request

Release 0.2 3rd Pull Request