diff --git a/code review resit b/code review resit new file mode 100644 index 0000000..a9cced7 --- /dev/null +++ b/code review resit @@ -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