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

[Jacob-109] iP #234

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

Conversation

Jacob-109
Copy link

@Jacob-109 Jacob-109 commented Jan 28, 2021

The intended commits are those done on 21Jan 2021, i wanted to edit Level 3 but in the end it duplicated the commits above as well. I should have fixed the issue already. Sorry for the inconvenience caused if you saw the extra commits.

@Jacob-109 Jacob-109 force-pushed the master branch 2 times, most recently from e348e78 to 7e03915 Compare January 28, 2021 13:29
@Jacob-109 Jacob-109 changed the title CS2103T Project Week 2 [Jacob-109] iP Feb 1, 2021
Copy link

@litone01 litone01 left a comment

Choose a reason for hiding this comment

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

Keep it up Jacob! You can do it:)

@@ -0,0 +1,14 @@
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.

Should the class be added or grouped inside a package? This applies to other classes as well.

Scanner sc = new Scanner(System.in);
ArrayList<Task> list = new ArrayList<>();

while(sc.hasNext()) {
Copy link

Choose a reason for hiding this comment

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

Will it be better to abstract and break this method into many smaller units? It will help in the future also.

import java.lang.reflect.Array;
import java.util.Scanner;
import java.util.ArrayList;

public class Duke {
Copy link

Choose a reason for hiding this comment

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

Will it be better to add javadoc to all public classes and methods? The same applies to all other public classes and methods.

@@ -1,10 +1,75 @@
import java.lang.reflect.Array;
Copy link

Choose a reason for hiding this comment

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

Can I check if this import is being used? Because Array should be present by default in Java.

Copy link

@chewwh09 chewwh09 left a comment

Choose a reason for hiding this comment

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

Name convention could have been better overall and some nitpicking.

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

protected String by;
Copy link

Choose a reason for hiding this comment

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

You could have a better convention such as dateTime. "by" alone doesn't have any meaning.

Copy link

Choose a reason for hiding this comment

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

so sorry I thought this was my iP, please ignore my replies if any:)

String logo = " ____ _ \n"
+ "| _ \\ _ _| | _____ \n"
+ "| | | | | | | |/ / _ \\\n"
+ "| |_| | |_| | < __/\n"
+ "|____/ \\__,_|_|\\_\\___|\n";
System.out.println("Hello from\n" + logo);
Scanner sc = new Scanner(System.in);
ArrayList<Task> list = new ArrayList<>();
Copy link

Choose a reason for hiding this comment

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

Should be lists instead of list. Also, the naming convention could have been better, perhaps using tasks is better? After all, your code is being read by many people with different backgrounds. So it would be better if your naming convention is clearer.

@@ -0,0 +1,14 @@
public class Event extends Task {

protected String datetime;
Copy link

Choose a reason for hiding this comment

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

Your deadline by naming convention should have followed this format as well.


while(sc.hasNext()) {
String word = sc.nextLine();
if (word.equals("bye")) {
Copy link

Choose a reason for hiding this comment

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

You can change the if-else to switch case for better readability.

} else if (word.equals("list")) {
int size = list.size();
System.out.println("Here are the tasks in your list:");
for (int i = 1; i <= size; i++) {
Copy link

Choose a reason for hiding this comment

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

Could have just do for (int i = 1; i <= list.size(); i++)

public class Duke {
public static void main(String[] args) {
public static void main(String[] args) throws DukeException{
Copy link

Choose a reason for hiding this comment

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

You should catch the DukeException, if not your program would stop running due to the exception.

this.isDone = false;
}

public String getStatusIcon() {
Copy link

Choose a reason for hiding this comment

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

It seems like getStatusIcon() is used in this task class only, hence you can change public to private.

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