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

[Li Beining] iP #453

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

[Li Beining] iP #453

wants to merge 39 commits into from

Conversation

dearvae
Copy link

@dearvae dearvae commented Aug 28, 2020

No description provided.

Copy link

@Wincenttjoi Wincenttjoi left a comment

Choose a reason for hiding this comment

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

Keep up the good work! Just a few nits to make and LGTM. Don't forget to add JavaDoc for the public methods and classes 👍

package Duke.exceptions;

public class DukeException extends Exception {
public DukeException(String errorMessage) {

Choose a reason for hiding this comment

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

Can consider adding an empty line here so as to standardize with the rest of the files, just something trivial 👍


import java.lang.annotation.Inherited;

public enum TaskType {

Choose a reason for hiding this comment

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

I like how you consolidate the possible task types in enum class for checking 👍

public class Parser {

public static Command parse(String command) throws DukeException {
if(command.equals("bye")) {

Choose a reason for hiding this comment

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

Should there be a space here? Eg: if[space](command...
I notice this in some other places as well, feel free to edit! :)

import Duke.utils.Ui;

public class AddCommand extends Command {
String taskType;

Choose a reason for hiding this comment

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

Shall we privatize variables for encapsulation? If I'm not mistaken, its part of the coding standard that this mod enforces

Task task;
String[] parts = data.split("( \\| )");
switch(parts[0]){
case("T"):

Choose a reason for hiding this comment

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

Should there be no indentation after switch case? You can change the IDE formatting in settings for this :)

Choose a reason for hiding this comment

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

I notice this is some other places as well. Feel free to edit

public static void save(String path, String fileName, List<String> data) {

File directory = new File(path);
if (! directory.exists()){

Choose a reason for hiding this comment

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

Should there be no space after "!" ?

Copy link

@davidliew9 davidliew9 left a comment

Choose a reason for hiding this comment

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

Overall very good naming convention, and follow code quality very well, good abstraction also. could consider making commits more detailed, and in present tense.

return tasks.size();
}

public Task get(int index) {

Choose a reason for hiding this comment

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

could consider being more specific such as 'getTask'?

return tasks.get(index);
}

public void remove(int index) {

Choose a reason for hiding this comment

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

Similarly could also try being more specific here?

Copy link

@hhdqirui hhdqirui left a comment

Choose a reason for hiding this comment

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

week 4 ip PR review on coding standard

README.md Outdated
@@ -15,7 +15,7 @@ Prerequisites: JDK 11, update Intellij to the most recent version.
1. Click `Open or Import`.
1. Select the project directory, and click `OK`
1. If there are any further prompts, accept the defaults.
1. After the importing is complete, locate the `src/main/java/Duke.java` file, right-click it, and choose `Run Duke.main()`. If the setup is correct, you should see something like the below:
1. After the importing is complete, locate the `src/main/java/duke.java` file, right-click it, and choose `Run duke.main()`. If the setup is correct, you should see something like the below:
Copy link

Choose a reason for hiding this comment

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

It is better for "duke" to be PascalCase.

Choose a reason for hiding this comment

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

If I remember correctly, the standard convention is that folders will be in small letters, whereas classes to start with capital letter. Maybe you can double confirm this first before the change :)


/**
* Represents command that stops the Duke from running upon execution.
*/
Copy link

Choose a reason for hiding this comment

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

Documentation format is a bit off.

return true;
}

@Override
Copy link

Choose a reason for hiding this comment

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

Can add javadoc for this method.

@@ -0,0 +1,102 @@
package duke.task;
Copy link

Choose a reason for hiding this comment

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

Can add javadoc to this class

@@ -0,0 +1,48 @@
package duke.utils;

import duke.command.*;
Copy link

Choose a reason for hiding this comment

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

Can be more specific instead of using "*".

@@ -0,0 +1,66 @@
package duke.utils;

import duke.command.*;
Copy link

Choose a reason for hiding this comment

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

Can be more specific instead of using "*".

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.

4 participants