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

[Lim Yong En Dominic] iP #462

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

Conversation

Arixeyeion
Copy link

No description provided.

damithc and others added 30 commits January 7, 2024 18:33
Let's tweak the docs/README.md (which is used as the user guide)
to fit Duke better. Specifically,

1. mention product name in the title
2. mention adding a product screenshot and a product intro
3. tweak the flow to describe feature-by-feature
…ing for tasks concerning time like deadline and event.
…Zoe will read saved tasks from previous sessions and she will save new tasks from the current session.
# Conflicts:
#	data/SavedTasks.txt
#	src/main/java/Deadline.java
# Conflicts:
#	src/main/java/zoe/Parser.java
#	src/main/java/zoe/Ui.java
Copy link

@KhoonSun47 KhoonSun47 left a comment

Choose a reason for hiding this comment

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

Great work overall! Just a few minor refinements required to ensure alignment with Java Coding Standards and enhance overall code quality. Keep up the outstanding effort!

@@ -0,0 +1,52 @@
package zoe;

import java.io.*;

Choose a reason for hiding this comment

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

Should you list your imported classes explicitly to follow the Java Coding Standard?

package zoe;
public class Zoe{
private Parser parser;
private TaskList tasks;

Choose a reason for hiding this comment

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

I like that you have distinguish clearly between single-valued and multi-valued variables, nice!

* If invalid command like empty todo is given, calls the respective responses
* @param command
*/
public String carryOutShortCommand(String command) {

Choose a reason for hiding this comment

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

It is good that your method name explains the entity to the reader accurately and at a sufficient level of detail, nice!

* Saves data from the current zoe instance to a path when zoe closes
* @param path
*/
public void saveTo(String path) {

Choose a reason for hiding this comment

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

It is good that your methods and classes follow the Java Code Quality of using nouns for classes/variables and verbs for methods/functions, nice!

}

/**
* Checks if a task exists in the list given an index when isValid(index) is called.

Choose a reason for hiding this comment

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

I noticed that there is no line spacing in between the description and parameter sections for your Javadocs comments, should you consider following the Java Coding Standard?

One of the comment does not have a method associated with it, should you consider removing it?

Copy link

@JerryWang0000 JerryWang0000 left a comment

Choose a reason for hiding this comment

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

The progress is ahead of me so sorry I cannot comment on the graphic part, but I'm glad that the rest of the codes are "readable" and with clarity.


protected String date;
protected String formattedDate;
public Deadline(String desc) {

Choose a reason for hiding this comment

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

Will it be better if there is a blank line and no space at line 11?

LocalDate inputDate = LocalDate.parse(date);
this.formattedDate = inputDate.format(DateTimeFormatter.ofPattern("MMM d yyyy"));
this.type = "D";
this.isDone = false;

Choose a reason for hiding this comment

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

I like this naming

*/
public class Event extends Task {
protected String from;
protected String to;

Choose a reason for hiding this comment

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

Would it be better to state explicitly that the two strings represent timestamp?

this.from = str[1].split(" ",2)[1];
this.to = str[2].split(" ", 2)[1];
this.type = "E";
this.isDone = isDoneNumber.equals("1");

Choose a reason for hiding this comment

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

"this" might not be necessary here as there is no ambiguous reference.

if (directory.exists() && file.exists()) {
BufferedReader reader = new BufferedReader(new FileReader(file));
ArrayList<Task> loadedTasks = new ArrayList<Task>();
String line;

Choose a reason for hiding this comment

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

The guideline would suggest not creating the object without initialization, but I'm not sure how to write better here tbh.

*/
public class Task {
protected String description;
protected String type;

Choose a reason for hiding this comment

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

Is it better to have these attributes final? As I think they can be confirmed upon initialization.

/**
* Records whether a task is done or not for data loading
*/
public int isDoneNumerical() {

Choose a reason for hiding this comment

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

I thought the return type was boolean. Is it better to start the name with a verb?

/**
* Marks a task as done to reflect in zoe
*/
public void markAsDone() {

Choose a reason for hiding this comment

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

I like this naming as it is clearer than my version.

/**
* Prints opening statement
*/
public String saysHi() {

Choose a reason for hiding this comment

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

Is it better to simply write sayHi()?

Arixeyeion and others added 6 commits February 13, 2024 13:37
Assertions were implemented as a branch but not committed to before working on the CodingQuality branch.

Let's commit this version with some CodingQuality implementation first as practice for pull requests.
This way, I still get to see the effects of some merging conflicts and parallel pull requests.
There were some magic numbers in the code so this commits rectify that problem.

Doing away with magic numbers makes it easier to debug in future and provides clarity in code.
Add rest of the CodeQuality changes.
Copy link

@AjayArvind2207 AjayArvind2207 left a comment

Choose a reason for hiding this comment

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

This is very well written code! Aside from some nits in the naming convention, the code LGTM. Keep it up and I hope to see this project develop further!

Comment on lines 20 to 27
this.tasks.add(t);
}
/**
* Deletes a new task to the list, when delete(task) is called
* @param i
*/
public void delete(int i) {
tasks.remove(Integer.valueOf(i) - 1);

Choose a reason for hiding this comment

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

I feel there is an inconsistent usage of 'this'. Some methods use this referencing while others do not

}

public String getStatusIcon() {
return (isDone ? "X" : " ");

Choose a reason for hiding this comment

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

Maybe you can consider using this.isDone as opposed to isDone to be more consistent with styling

Suggested change
return (isDone ? "X" : " ");
return (this.isDone ? "X" : " ");

Comment on lines +43 to +47
} else {
if (command.equals("todo")) {
res += ui.todoDescription();
} else {
res += ui.invalidCommand();

Choose a reason for hiding this comment

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

I really like your method names and they are very descriptive!

…owing order: Todos, Events, Deadlines where Deadlines are sorted based on date.
…er input for better clarity. Also changed maximum size of chatbot text to allow for dynamic sizing based on output text.
# Conflicts:
#	data/SavedTasks.txt
…ata is processed for more flexible reading from file and neater presentation of data. Add more JUnit test to todo and event.
…. Change saving using bye to saving whenever a user input is parsed to avoid dataloss should the user choose to close the application using the "X" button.
Change Ui picture so that it reflects new functionality as stated above
…ource

Update README to let user know that keyword in find <keyword> is case sensitive
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