You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: