Conversation
Tweaked code to comply with coding standard Added javadocs for non-trivial methods and classes Added logo
src/main/java/Task.java
Outdated
| public String getAt() { | ||
| return ""; | ||
| } | ||
|
|
There was a problem hiding this comment.
It might be better to have a blank line among each function.
There was a problem hiding this comment.
I agree. It may be minor but it can help make the functions look more distint and clear.
izdiyadfrhn
left a comment
There was a problem hiding this comment.
Overall, I found your code easy to read, except the parts where more distinction and separation could have been made between blocks of code. Otherwise, looks good!
src/main/java/Ui.java
Outdated
| public void start() { | ||
| String lineBreak = " ____________________________________________________________\n"; | ||
| String logo = "\n" + | ||
| " \n" + | ||
| " ,--. ,------. ,--. ,--. ,--. \n" + | ||
| ",-' '-.,---.| .-. \\ ,---.| | `--',---,-' '-. \n" + | ||
| "'-. .-| .-. | | \\ | .-. | | ,--( .-'-. .-' \n" + | ||
| " | | ' '-' | '--' ' '-' | '--| .-' `)| | \n" + | ||
| " `--' `---'`-------' `---'`-----`--`----' `--' \n" + | ||
| " \n"; |
There was a problem hiding this comment.
interesting twist to the Duke java graphic provided with the starting template!
src/main/java/TaskManager.java
Outdated
| if (getSize() == 1) { | ||
| System.out.println(" Now you have " + 1 + " task in the list."); | ||
| } else { | ||
| System.out.println(" Now you have " + getSize() + " tasks in the list."); | ||
| } |
There was a problem hiding this comment.
Minor style and language taken care of. Nice!
src/main/java/Task.java
Outdated
| public String getAt() { | ||
| return ""; | ||
| } | ||
|
|
There was a problem hiding this comment.
I agree. It may be minor but it can help make the functions look more distint and clear.
src/main/java/TaskManager.java
Outdated
| switch(taskType) { | ||
| case "todo": | ||
| newTask = new ToDo(description); | ||
| taskList.add(newTask); | ||
| break; | ||
| case "deadline": | ||
| String by = getDate(task); | ||
| newTask = new Deadline(description, by); | ||
| taskList.add(newTask); | ||
| break; | ||
| case "event": | ||
| String at = getDate(task); | ||
| newTask = new Event(description, at); | ||
| taskList.add(newTask); | ||
| break; | ||
| default: | ||
| System.out.println(" Invalid command, please try again"); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Perhaps you can make this block of code separate from the few lines above it?
| TaskManager taskManager = new TaskManager(); | ||
| Scanner scanner = new Scanner(System.in); | ||
| Ui ui = new Ui(taskManager, scanner); | ||
| ui.start(); |
There was a problem hiding this comment.
I like how you created a taskManager class to handle the commands and an Ui class to handle all the output, making the code very easy to understand.
src/main/java/Task.java
Outdated
| public String getStatusIcon() { | ||
| return (isDone ? "[X]" : "[ ]"); | ||
| } | ||
| public String getIcon() { | ||
| return ""; | ||
| } | ||
| public String getTiming() { | ||
| return ""; | ||
| } |
There was a problem hiding this comment.
Maybe it would be cleaner to add a new line between each function?
src/main/java/TaskManager.java
Outdated
| String taskType = getCommand(task); | ||
| Task newTask; | ||
| String description = getDescription(task); | ||
| switch(taskType) { |
There was a problem hiding this comment.
I like how you named the variables, very intuitive and easy to understand.
src/main/java/Ui.java
Outdated
| System.out.print(lineBreak); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Overall I really like how you have broken down everything into classes. I think it is very good OOP. Perhaps add some javadocs to explain some of the methods?
Leeyp
left a comment
There was a problem hiding this comment.
Generally well done, keep up the good work!
Added some comments as room for improvements.
src/main/java/duke/command/Ui.java
Outdated
| private static void saveData() { | ||
| try { | ||
| String pathName = PATH_NAME; | ||
| //create folder with file if absent initially |
There was a problem hiding this comment.
Consider adding a line spacing before a comment for improved readability.
src/main/java/duke/data/Storage.java
Outdated
|
|
||
| while (scanner.hasNext()) { | ||
| String line = scanner.nextLine(); | ||
| String[] array = line.split(" | "); |
There was a problem hiding this comment.
Might want to improve on the name for "array" to make it more meaningful.
| String timing = task.getTime(); | ||
|
|
||
| textToAppend = taskType + " | " + status + " | " + description; | ||
| if (task instanceof Event || task instanceof Deadline) { |
There was a problem hiding this comment.
Avoid complicated expressions, is there any way you can extract it out or make this more streamlined? (hint: use booleans)
# Conflicts: # src/main/java/duke/task/Event.java # src/main/java/duke/task/Task.java # src/main/java/duke/task/TaskManager.java
Add JavaDocs
No description provided.