-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Teh Kok Hoe] iP #309
base: master
Are you sure you want to change the base?
[Teh Kok Hoe] iP #309
Conversation
Fix display
Change the enum accessor so that it is accessible. Add error handling to prevent program from terminating due to illegal user input. Change display to look neater.
Add Exception class to deal with exceptions unique to program.
Add delete feature to remove a task from the list.
Add test cases for delete feature to ensure correct display an exception handling
Add toRecord method for save method to write in a different display from the output on console
This reverts commit d355645.
Add toRecord method for save method to write in a different display from the output on console
Add save method so that whenever list is changed, it is updated to a text file. Adjust code to fit coding standard.
Adjust code to fit coding standard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few coding standard violations, but other than that, nothing too huge. Remember to put everything into a package.
LGTM after fixing these.
src/main/java/Duke.java
Outdated
public class Duke { | ||
enum Command { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to see you're using enums for this! Keep it up.
src/main/java/Task.java
Outdated
@@ -0,0 +1,50 @@ | |||
public class Task { | |||
private String task; | |||
private boolean done; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the coding standards, this should be named isDone
src/main/java/Duke.java
Outdated
System.out.println(" Hello! I'm Duke"); | ||
System.out.println(" What can I do for you?"); | ||
System.out.println(" ____________________________________________________________"); | ||
boolean StillIn = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use camelCase to name variables, and booleans should be of the form isSomething
. You could possibly rename this to isStillIn
src/main/java/Duke.java
Outdated
System.out.println(" ____________________________________________________________"); | ||
try { | ||
switch (cmd) { | ||
case BYE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case
should not be indented. It should be on the same line as switch
src/main/java/Duke.java
Outdated
public static void main(String[] args) { | ||
String logo = " ____ _ \n" | ||
+ "| _ \\ _ _| | _____ \n" | ||
+ "| | | | | | | |/ / _ \\\n" | ||
+ "| |_| | |_| | < __/\n" | ||
+ "|____/ \\__,_|_|\\_\\___|\n"; | ||
System.out.println("Hello from\n" + logo); | ||
System.out.println(" ____________________________________________________________"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using 4 spaces, you can consider using \t
instead for tab
src/main/java/Duke.java
Outdated
@@ -1,10 +1,166 @@ | |||
import java.util.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things here:
- Keep everything in a package
- Only import things that are needed to be used. Avoid using wildcard imports
src/main/java/FastReader.java
Outdated
@@ -0,0 +1,51 @@ | |||
import java.io.BufferedReader; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not too sure if FastReader
is required here, but good consideration!
src/main/java/Duke.java
Outdated
boolean StillIn = true; | ||
FastReader fr = new FastReader(); | ||
ArrayList<Task> list = new ArrayList<Task>(100); | ||
while(StillIn) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to put spacing between the brackets and each while
and each if
. You only do not use spaces when it is a function/method declaration
Allow dates to be recognized as 'Date' objects to allow more capabilities like sorting around dates
# Conflicts: # src/main/java/Duke.java
Adjust how date works due to complement save implementation
Seperate operations into different classes that do specific things
Fix how date is parsed in event so that it can read the two dates regardless of whitespace between the seperator '-' and the date
Package all classes into one package
Add exception handler for invalid commands by telling user command is invalid and then waits to receive next user input
Let parseCommand throw IllegalArgumentException when receive invalid user input
Add JUnit tests for invalid commands and check if bye command quits program
Add checkstyle tests to ensure coding standard
Add JavaDoc to allow people to use program easily
Fix coding standards for improved readability
Add find function so users can easily filter tasks with specific keywords
# Conflicts: # src/main/java/duke/FastReader.java # src/main/java/duke/UI.java
Add JavaDoc for find methods for developer clarity
Adjust JavaDoc for GUI
Curent code might not be able to detect some bugs So that major bugs can be detected when code is changed in the future Add some asserts to ensure that responses should not be empty for most commands Assert is low cost and is worth the extra security
Users can add duplicate tasks into the list Using equals and contain methods allows duplicate checking Easy to implement and understand
Change the user picture and input text to be always at the bottom of the dialog box, and constantly refreshes as users shouldn't have to know what input they have previously typed, and can infer by just looking at Duke's output
Add User Guide for users to use program comprehensively
No description provided.