Refactor Functions/Objects to Properly Segregate Functionality #14
Labels
No Label
bug
compatibility
documentation
duplicate
enhancement
future release
help wanted
invalid
non-code
question
refactor
testing
this release
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cmccabe/linkulator2#14
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Initially, not all functionality was properly segregated across functions, leading to some problems in program flow and preventing some ideal types of program flow. For example, view_thread() and view_category_contents() overlap in an unnatural way.
Refactor Functions/Objects to Prioerly Segregate Functionalityto Refactor Functions/Objects to Properly Segregate FunctionalityA lot of functions print information, take in input, and then call other functions. It might be a better model to return functions to caller. So, for example
view_category_contents()
couldgraceful_exit()
, it couldprint_categories()
, and it couldview_thread()
. Rather than calling these things, we could return them to a controller function that would handle routing. This would also allow us to return errors easily and handle them.In order to loop through taking in what post number within a category in
view_category_contents()
we could validate the input. If the input was invalid we could print a message and then returnview_category_contents()
itself, so that it would be run again.Just an idea. There are lots of ways to architect this program and I definitely dont want to step on anyone's toes.
sloum, those sound like good ideas to me!
This likely ties in to #17 as well.
@cmccabe I think the main purpose of this has now been completed. Menu controls, data queries and views are mostly segregated. Can we close this off?
Yup!