Skip to content

[Ng Hong Liang] iP#277

Open
jinnhl wants to merge 37 commits into
nus-cs2103-AY2122S2:masterfrom
jinnhl:master
Open

[Ng Hong Liang] iP#277
jinnhl wants to merge 37 commits into
nus-cs2103-AY2122S2:masterfrom
jinnhl:master

Conversation

@jinnhl
Copy link
Copy Markdown

@jinnhl jinnhl commented Jan 27, 2022

Jeff the task manager

“My name is Jeff.” – Channing Tatum

Jeff allows you to have all your to-dos in one easy to access location. It's,

  • text-based 📝
  • easy to use 👌
  • fast SUPER FAST to use 🔥

How do I get Jeff? It's as easy as,

  1. download it from here.
  2. double-click it.
  3. add your task.

And voilà, Jeff would do everything for you!

Features:

  • Managing tasks
  • Managing deadlines
  • Reminders
  • Working GUI (coming soon)

Copy link
Copy Markdown

@DannyDakota DannyDakota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few suggestions to naming conventions and coding standards for switch cases. Otherwise, solid work handsome!

Comment thread src/main/java/TimeParse.java Outdated
this.helper();
}

private LocalTime helper() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe can use getTime here 😄

Comment thread src/main/java/DateParse.java Outdated
this.helper();
}

private LocalDate helper() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe can use getDate here? 😄

Comment thread src/main/java/DukeException.java Outdated
* @param curr Holds the capacity for the stored list, used to check if request is out of bounds
* @throws DukeException
*/
public void checker(String[] arr, int curr) throws DukeException {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe can use a more descriptive name for the method 😄
e.g
commandChecker
stringChecker
inputTester

Comment thread src/main/java/ReadFile.java Outdated
while (s.hasNext()) {
String[] inputLine = s.nextLine().split("\\| ", 4);
Task curr;
switch(inputLine[0]) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switch cases shouldn't be indented according to the coding standard 😄
otherwise v nice use of switch to differentiate the various commands

Copy link
Copy Markdown

@pyk595 pyk595 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, most of your code adheres to the coding standard, good job! Just a few minor nitpicks here and there

Comment thread src/main/java/Deadline.java Outdated
protected TimeParse time;

/**
* Constructor for Deadline class
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to put a line after the JavaDoc descriptor and the params?

Comment thread src/main/java/Duke.java Outdated
@@ -1,10 +1,104 @@
import java.io.FileNotFoundException;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can consider putting your Duke.java in a package?

Comment thread src/main/java/Duke.java Outdated
// If user inputs bye, terminate the program
if (input.equals("bye")) {
end = true;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good use of in-line comments, they adhere to the coding standard's requirement as well

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed! I like how you use in-line comments to help in code readability and understanding the code :)

Comment thread src/main/java/ReadFile.java Outdated
*/
public class ReadFile {

public static final String ADDRESS = "data/duke.txt";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good use of full caps for constants!

Comment thread src/main/java/WriteFile.java Outdated
fw.close();
}
//
// public static void main(String[] args) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can consider removing these few lines of code if they are not used?

Comment thread src/main/java/Task.java Outdated
@@ -0,0 +1,31 @@
public abstract class Task {
protected String description;
protected boolean isDone;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good boolean variable naming!

Comment thread src/main/java/ReadFile.java Outdated
case "T " :
curr = new Todo(inputLine[2]);
break;
case "D " :
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing as mentioned by @DannyDakota, indentation should be removed

Comment thread src/main/java/WriteFile.java Outdated

public static final String ADDRESS = "data/duke.txt";

public WriteFile(ArrayList<Task> store) throws IOException {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Store might not be the best name for a task list, maybe naming it taskList might be a better choice?

Copy link
Copy Markdown

@Tiffanylin21 Tiffanylin21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I found some minor issues in naming. Otherwise, I really like the in-line comments in the code :)

Comment thread src/main/java/DateParse.java Outdated
Comment on lines +1 to +4
import java.time.LocalDate;
import java.time.format.DateTimeParseException;
import java.util.ArrayList;
import java.time.format.DateTimeFormatter;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps consider separating similar ones into blocks?

Comment thread src/main/java/Deadline.java Outdated
this.dateInfo = this.date.toString() + " " + this.time.toString();
}

public String whatType() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps consider naming the method with verbs such as 'getType()'?

Comment thread src/main/java/Duke.java Outdated
System.out.println("Hello from\n" + logo);
Scanner scanner = new Scanner(System.in);
String input = "";
Boolean end = false;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps use a name that sounds more like a boolean? What about something like 'isEnd' or 'isExited'?

Comment thread src/main/java/Duke.java Outdated
Scanner scanner = new Scanner(System.in);
String input = "";
Boolean end = false;
ArrayList<Task> store = new ArrayList(100);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps consider using a plural noun as the name of the ArrayList?

Comment thread src/main/java/Duke.java Outdated
// While loop ends when user inputs bye
while(!end) {
input = scanner.nextLine();
String[] splitInput = input.split(" ", 2);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps consider using a plural noun as a variable name here?

Comment thread src/main/java/Duke.java Outdated
// If user inputs bye, terminate the program
if (input.equals("bye")) {
end = true;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed! I like how you use in-line comments to help in code readability and understanding the code :)

jinnhl and others added 10 commits February 18, 2022 02:35
Event and Deadline tasks does not check for assumptions that
string parsed as date and time are of correct size.

Event and Deadline tasks would cause Jeff to crash if certain
assumptions are not met.

Let's add assertions on those very variables have been added,
hence throwing an assertion failure instead of adding an
invalid entry into the list.

Assertions impact on performance is considered low compared
to its benefits.
Parser class have repeated conditional statements to check if the
user gave valid inputs.

To improve readability and code quality.

Let's refractor said conditional statements by
extract them into methods.

Easiest way to reuse code that have are duplicates of each other.
Allows easy navigation as they are on the same class file.
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.

4 participants