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

[Grant Lee] Duke Increments #161

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

Conversation

grrrrnt
Copy link

@grrrrnt grrrrnt commented Jan 29, 2020

No description provided.

j-lum and others added 22 commits August 6, 2019 15:25
Add toolVersion block in to Gradle code sample to prevent errors.
Change file mode on `gradle` to be executable (#9)
Gradle defaults to an empty stdin which results in runtime exceptions
when attempting to read from `System.in`. Let's add some sensible
defaults for students who may still need to work with the standard
input stream.
Add configuration for console applications
The OpenJFX plugin expects applications to be modular and bundled
with jlink, resulting in fat jars that are not cross-platform. Let's
manually include the required dependencies so that shadow can package
them properly.
# Conflicts:
#	src/main/java/Deadline.java
this.dayTime = Parser.parseTime(dayTime);
}

public String getDayTime() {
Copy link

Choose a reason for hiding this comment

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

"dayTime" may not be as intuitive of a variable name to use

@@ -0,0 +1,10 @@
public class EventException extends DukeException {
public EventException() {
Copy link

Choose a reason for hiding this comment

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

Non-intuitive Class Name.

@@ -0,0 +1,10 @@
public class TodoException extends DukeException {
Copy link

Choose a reason for hiding this comment

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

Non-Intuitive Class Name

}

@Test
public void getStatusIcon_todo_ok() {
Copy link

Choose a reason for hiding this comment

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

Invalid function name

Copy link

Choose a reason for hiding this comment

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

Test functions should start with the word "test" and use camelCase instead of underlined_function_names

@@ -0,0 +1,3 @@
todo buy fruits
Copy link

Choose a reason for hiding this comment

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

Could have more extensive tests

@@ -1,4 +1,4 @@
# Gradle Tutorial
de# Gradle Tutorial
Copy link

Choose a reason for hiding this comment

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

I believe this was an unintentionally commit

Copy link

@RubaP RubaP left a comment

Choose a reason for hiding this comment

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

Please go through the detailed comments given especially handling Duke specific exceptions. You can discuss it with your team as well so that it will benefit you and the team project. You may focus on writing more Junit test cases as well.


@Override
public String getMessage(){
return "\u2639 OOPS!!! The description of a deadline cannot be empty.";
Copy link

Choose a reason for hiding this comment

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

Why it is always the same message for all DeadlineException? If this exception is dedicated for empty description, then you can have class name that indicates the purpose. E.g. EmptyDescriptionException

+ "| |_| | |_| | < __/\n"
+ "|____/ \\__,_|_|\\_\\___|\n";
System.out.println("Hello from\n" + logo);
// String logo = " ____ _ \n"
Copy link

Choose a reason for hiding this comment

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

Please remove commented code blocks


@Override
public String getMessage(){
return "\u2639 OOPS!!! I'm sorry, but I don't know what that means :-(";
Copy link

Choose a reason for hiding this comment

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

Is this Exception dedicated for unavailable commands? Then you can use a class name which indicates that


@Override
public String getMessage(){
return "\u2639 OOPS!!! The description of an event cannot be empty.";
Copy link

Choose a reason for hiding this comment

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

Same goes here. You can either have a generic Exception class which can handle different exceptions or you can make the Class name more intuitive

String msg = "";
if (input.equals("list")) {
msg = taskList.showList();
} else if (input.split(" ")[0].equals("done")) {
Copy link

Choose a reason for hiding this comment

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

If input.split(" ")[0] is repeated, again and again, then you can define that as a string and use it.

Task toAdd = new Task();
if (typeOfTask.equals("todo")) {
try {
String task = s.split(" ", 2)[1];
Copy link

Choose a reason for hiding this comment

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

Same goes here. If this logic is repeated, you can extract it out before the if statement

*/
public String delete(int i) {
Task t = taskList.remove(i-1);
String msg = "Poof! This task is gone:\n"
Copy link

Choose a reason for hiding this comment

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

You can define these messages as constants if they are not going to change

* @param s String to print.
*/
public void print(String s) {
System.out.println(s);
Copy link

Choose a reason for hiding this comment

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

Why do you need a separate method only to execute System. out.println

public Ui() {}

/**
* Prints string.
Copy link

Choose a reason for hiding this comment

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

You can avoid trivial comments

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