Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConsoleUI class is a mess #3

Closed
davidschlachter opened this issue Oct 20, 2017 · 2 comments
Closed

ConsoleUI class is a mess #3

davidschlachter opened this issue Oct 20, 2017 · 2 comments
Assignees

Comments

@davidschlachter
Copy link
Owner

Important principle of programming: Don't repeat yourself

The ConsoleUI class is full of pieces that should be turned into separate methods to remove repetition. Otherwise, changes to one functionality need to be made all over the class. For example, there should be a 'getInput' class that gets user input, checks if it's valid (from an array of possible answers, or a range of doubles, etc; and if invalid, asks again), and returns it to the calling method. At present this is copy-pasted every time it happens!

Also, separating the pieces into modules makes them more testable.

@davidschlachter
Copy link
Owner Author

Partially addressed in 75ac68e, but see #22 and #23.

@davidschlachter
Copy link
Owner Author

One of our last to-dos on this right now is #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants