Skip to content
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

【Heng Jee Kuan] iP #457

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

hengjeekuan
Copy link

No description provided.

damithc and others added 27 commits July 11, 2024 16:52
In build.gradle, the dependencies on distZip and/or distTar causes
the shadowJar task to generate a second JAR file for which the
mainClass.set("seedu.duke.Duke") does not take effect.
Hence, this additional JAR file cannot be run.
For this product, there is no need to generate a second JAR file
to begin with.

Let's remove this dependency from the build.gradle to prevent the
shadowJar task from generating the extra JAR file.
Copy link

@nictjh nictjh left a comment

Choose a reason for hiding this comment

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

Good work man, learnt alot from ya

ui.printTaskList(tasks.getTasks());
} else if (input.startsWith("todo")) {
String[] parts = input.split(" ", 2);
if (parts.length < 2) throw new JeeniusException("bro how do you todo nothing??? ADD A DESCRIPTION FOR YOUR TODO");
Copy link

Choose a reason for hiding this comment

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

The conditional should be put on a separate line, could help in future debugging if necessary :>!
Other than that LGTM!!

boolean isDone = parts[1].trim().equals("1");
String description = parts[2].trim();

switch (taskType) {
Copy link

Choose a reason for hiding this comment

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

The case clauses shouldn't have any indentation as per coding standards. Can try to configure IDE to standardise the style

return this.description;
}

public Boolean getDone() {
Copy link

Choose a reason for hiding this comment

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

This getter function can follow the "use a prefix such as is, has, was, etc. for boolean variables and methods". (Small things man give chance need fill quota)

loadedTasks = new TaskList(storage.load());
} catch (JeeniusException e) {
ui.printError(e.getMessage());
loadedTasks = new TaskList(new ArrayList<>());
Copy link

Choose a reason for hiding this comment

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

The Generic here could be filled with the super class (Task) for clarity, readability, and type safety. Prevent any inference made by Java.

import java.util.ArrayList;
import java.util.List;

public class TaskList {
Copy link

Choose a reason for hiding this comment

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

LGTM man

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Deadline extends Task {
Copy link

Choose a reason for hiding this comment

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

LGTM!

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Event extends Task {
Copy link

Choose a reason for hiding this comment

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

LGTM bro


import java.util.List;

public class Ui {
Copy link

Choose a reason for hiding this comment

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

Good job man, there's really nothing to nitpick at all

Copy link

@pastchum pastchum left a comment

Choose a reason for hiding this comment

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

Very good code, apart from few minor nits this code was very well done!

ui.printError(e.getMessage());
}
}
}
Copy link

Choose a reason for hiding this comment

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

Good naming conventions, good code

ui.printTaskList(tasks.getTasks());
} else if (input.startsWith("todo")) {
String[] parts = input.split(" ", 2);
if (parts.length < 2) throw new JeeniusException("bro how do you todo nothing??? ADD A DESCRIPTION FOR YOUR TODO");
Copy link

Choose a reason for hiding this comment

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

Line is too long, can be difficult to read. consider splitting into 2 lines.

} catch (Exception e) {
throw new JeeniusException("Failed to mark/unmark. Use: mark/unmark [task number]");
}
} else {
Copy link

Choose a reason for hiding this comment

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

I like the way you format the code in each "if" case. Very readable and neat, except for the few lines that seem to be very long and can be split into 2.

public Task getTask(int index) {
return tasks.get(index);
}

Copy link

Choose a reason for hiding this comment

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

Should name method getSize to follow naming standard for methods. Apart from that LGTM


public class Ui {

public void printWelcomeMessage() {
Copy link

Choose a reason for hiding this comment

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

Good use of already defined functions to neaten and reduce repeated code. LGTM

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.

5 participants