Skip to content

Tan Eu Zin iP#470

Open
euzintan wants to merge 39 commits into
nus-cs2103-AY2021S1:masterfrom
euzintan:master
Open

Tan Eu Zin iP#470
euzintan wants to merge 39 commits into
nus-cs2103-AY2021S1:masterfrom
euzintan:master

Conversation

@euzintan

Copy link
Copy Markdown

No description provided.

@BILLXYR BILLXYR left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Two main problems observed: "the websites says: "Class variables should never be declared public"
So, perhaps it should not public." and " Plural form should be used on names representing a collection of objects." Others are fine 👍 Good job 👍

Comment thread src/main/java/Duke.java Outdated
System.out.println("Hello from\n" + logo);
System.out.println(logo + "\nHello im Eu Zin's Duke, he spent thursday afternoon creating me cuz he forgot abt the iP");

ArrayList<Task> taskList = new ArrayList<>();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

From the websites it says that : "Plural form should be used on names representing a collection of objects."
So I think perhaps it should be taskLists instead of taskList.

@@ -0,0 +1,18 @@
public class Deadline extends Task {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the websites says: "Class variables should never be declared public"
So, perhaps it should not public.

Comment thread src/main/java/Duke.java
import java.util.Iterator;
import java.util.Scanner;

public class Duke {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the websites says: "Class variables should never be declared public"
So, perhaps it should not public.

@@ -0,0 +1,7 @@
public class DukeException extends Throwable {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the websites says: "Class variables should never be declared public"
So, perhaps it should not public.

Comment thread src/main/java/Event.java
@@ -0,0 +1,18 @@
public class Event extends Task{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the websites says: "Class variables should never be declared public"
So, perhaps it should not public.

Comment thread src/main/java/Task.java
@@ -0,0 +1,21 @@
public class Task {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the websites says: "Class variables should never be declared public"
So, perhaps it should not public.

@juandavinlie juandavinlie left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overall, your code is well written and understandable. Some names of variables and methods can be modified to make it self-explanatory. Good job!!

Comment thread src/main/java/TaskList.java Outdated
boolean isDone = taskDataDivided[2].equals("1");
switch (taskDataDivided[0]) {
case "E":
returnTaskList.add(new Event(taskDataDivided[2], taskDataDivided[3], 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.

Should taskDataDivided[0, 2, 3] be assigned to a variable that is self-descriptive? It would make the code easier to read and understand.

* @return copy of ArrayList
*/
public ArrayList<Task> getList() {
ArrayList<Task> returnTaskList = new ArrayList<>();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It might be more appropriate to name this variable as taskList instead of returnTaskList since return is a verb and could refer to a function.

Comment on lines +76 to +77
* Add Task given to the list
* @param task

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It is good to separate the description and parameter using a blank line.

public ArrayList<Task> searchFor(String searchString) {
ArrayList<Task> returnArrayList = new ArrayList<>();
for (Task task : taskList) {
if (task.getDescription().contains(searchString)) returnArrayList.add(task);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It may be better to use the Egyptian style when writing if-else statement as it becomes easier to read.

return taskList.size();
}

public ArrayList<Task> searchFor(String searchString) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

May be better to name it searchTaskWithName(String searchString), as it is understandable by just reading it.

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.

3 participants