Code Review#13
Open
Tiwi71 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The code does the job it is supposed to, which is good.
It is very clear from the user's perspective, which I like. Readability is great! There is a space before 'Word occurrences', but that's the only issue I could find there.
From a developer perspective, the code is well commented and variables are named sensibly. Because it is a program that doesn't do much, of all it being inside Main can be excused. However, if you ever wish to expand on it, I'd recommend moving functions to their own classes, so that Main need only call upon them. This would prevent Program.cs from getting too bloated, and would help developers navigate it more easily.
Your error handling is great. Even when I type in an invalid input or solely press 'enter', the program doesn't crash. It would be better if it looped though, so the user doesn't have to open the program every time they want to retry. And even if it succeeds, perhaps the user has other files they wish to view the word frequencies of.
When you click 'Copy as Path' for the txt file in File Explorer, Windows automatically encases it with "", so having a few lines that remove those would be useful to reduce user difficulties. A polymorphic function for converting different text file contents into the same format for the program to use would be also be helpful, as the program only works for .txt files.
More options would be also be useful. Whilst it automatically reordering the words into alphabetical order is helpful, having options to order them by frequency, or just simply having them listed in file order, would be convenient.
Overall a great code and does the job! A few more user options and conveniences would be nice though, and it needs a quick reshuffle with abstraction/encapsulation if you ever want to expand the program's capabilities.