Skip to content

Code review#16

Open
JamesB05 wants to merge 1 commit into
cfrantzidis:masterfrom
JamesB05:JamesB05-patch-1
Open

Code review#16
JamesB05 wants to merge 1 commit into
cfrantzidis:masterfrom
JamesB05:JamesB05-patch-1

Conversation

@JamesB05

@JamesB05 JamesB05 commented Jul 31, 2025

Copy link
Copy Markdown
  1. The code is not commented, try including a summary at the top of the code detailing the purpose of the project. There is also an issue with variable names as they are just one letter long, consider adding more meaningful variable names to improve readability (e.g. fileName, wordCounts etc). Also consider adding inline comments explaining each section of the code, this will improve the maintainability of the code in the long run.

  2. The code does not handle errors properly as it always assumes the file exists and is valid, consider adding a check to your code to avoid any errors in the future to avoid runtime errors. such as adding an if loop to check the file exists.

  3. Overall i would suggest a complete change of variable names in the code, this would majorly improve readability. Also adding inline comments to better keep track of what you're working on. The output is functional and works well, but error handling could also be worked on.

4.The program logic performs the intended purpose. However there are no classes or objects used beyond the main program, everything is written in main. On top of that there is no abstraction or encapsulation, i would suggest separating the data and adding encapsulation to the code. this will make the code easier to test, reuse and expand upon.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant