Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions code review resit
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
1. Comments and Documentation
There are no comments in the code
It’s hard to understand what’s happening without carefully reading each line
Add a short explanation at the top and comments throughout all code to describe key steps

2. Error Handling
The code does not check if the file path is correct/if file exists
If the user enters the wrong file name, the program crashes
Adding basic error messages and checks could help the user

3. Variable Names
Most variable names are single letters like z, q, a, which are not meaningful or that relevant
This makes the code hard to read or maintain
Use full, clear names like filePath, wordCounts, etc.

4. Code Structure
All code is inside the Main method
It would be better to break the work into smaller parts (e.g., file reading, cleaning, counting) using methods

5. File Handling Assumptions
The program assumes the file always exists and contains data
It doesn’t check for empty files or handle missing ones
Could check if the file exists and providing feedback if something goes wrong.

6. Output Format
The output works, but it could be displayed in a clearer, more professional way
For example, avoid terms like "uniquez" — use "total unique words" instead

7. OOP Principles
The program is written in a very basic, procedural way
No object-oriented programming (OOP) features like classes or methods are used
Consider creating a class to handle the text processing tasks to improve structure and reusability