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

[Cher Wei Jie] Duke Increments #113

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

Conversation

Cherweijie
Copy link

No description provided.

j-lum and others added 30 commits August 6, 2019 15:25
Add toolVersion block in to Gradle code sample to prevent errors.
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.
Copy link

@CharmaineKoh CharmaineKoh left a comment

Choose a reason for hiding this comment

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

Overall good job on the code! Consider tweaking some portions to follow SOLID principles.

* input will generate.
*/
class Task {
private static String horizontalLine = "__________________________________________";

Choose a reason for hiding this comment

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

This variable is not used and it should be removed.

Comment on lines +49 to +53
System.out.println("\n" + "Alright, I've added this task:" + "\n");
System.out.println(toDo + "\n");
System.out.println("You currently have "
+ tasks.getTaskList().size()
+ " task(s) in the list.");

Choose a reason for hiding this comment

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

Consider exporting magic strings to another class for neater code.

ui.showLine();
ui.showDoneMessage();
doneTask.markAsDone();
System.out.println(doneTask + "\n");

Choose a reason for hiding this comment

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

Good job using SLAP.

Comment on lines 14 to 32
if (command.equals("bye")) {
return new ExitCommand();
} else if (command.equals("list")) {
return new ListCommand();
} else if (command.startsWith("done")) {
String[] arrOfCommands = command.split(" ");
int num = Integer.parseInt(arrOfCommands[1]);
return new DoneCommand(num);
} else if (command.startsWith("deadline")) {
return new AddCommand(command);
} else if (command.startsWith("todo")) {
return new AddCommand(command);
} else if (command.startsWith("event")) {
return new AddCommand(command);
} else if (command.startsWith("delete")) {
return new DeleteCommand(command);
} else if (command.startsWith("find")) {
return new FindCommand(command);
}

Choose a reason for hiding this comment

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

Agreed! 👍

Comment on lines +27 to +31
String readCommand() {
Scanner scan = new Scanner(System.in);
String command = scan.nextLine();
return command;
}

Choose a reason for hiding this comment

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

Consider creating a single scanner object in the main method instead of creating a new object every time the method is called.

Copy link

@nishantbudhdev nishantbudhdev left a comment

Choose a reason for hiding this comment

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

In general, clean code! Good job. Please keep up the good work.

fxmlLoader.setRoot(this);
fxmlLoader.load();
} catch (IOException e) {
e.printStackTrace();

Choose a reason for hiding this comment

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

In general, printing stack trace is not considered good exception handling. Think what better you can do here when an exception occurs?

/**
* You should have your own function to generate a response to user input.
* Replace this stub with your completed method.
*/

Choose a reason for hiding this comment

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

update the header comments

);
userInput.clear();

if (response.startsWith("Bye-bye!")) {

Choose a reason for hiding this comment

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

You can improve SLAP here.

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.

None yet

8 participants