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

[Javier Lim] iP #446

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

Conversation

ijavierja
Copy link

No description provided.

damithc and others added 29 commits July 23, 2020 23:27
Incomplete note on some methods were removed
Save method puts the list of tasks into a text file.
This allows the client to access tasks even if Duke has been closed.
The path of the text file can be found in the Duke.java file as a global variable at the top of the file.
…to allow only a date time description

Level 8. Date and Times.
The Task class was modified to include a new field of type LocalDateTime.
This is to keep the Time and Date for the tasks.
Deadline method was also modified to only allow for a date and time description.
# Conflicts:
#	src/main/java/Duke.java
ui class deals with interaction with the user. Ui class takes commands from the user as well as print output to user.
TaskList stores an ArrayList<Task> and deals with all changes to this list. Additionally, the class deals with all outputs needed from this arraytist
Storage class deals with loading tasks from the file and saving tasks in the file
DukeException is thrown when no file is present with the name represented by filePath
Command is an interface with two abstract methods.
Parser deals with making sense of the user command. A Command instance is implemented using Parser's static parse method.
…hod, execute, output type to String from void

Test classes uses JUnit for testing of the classes' methods.
Only header comments for classes have been added
List all task that contains the phrase
# Conflicts:
#	src/main/java/Parser.java
#	src/main/java/TaskType.java
#	src/main/java/Ui.java
Copy link

@xz0127 xz0127 left a comment

Choose a reason for hiding this comment

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

Overall, I found your code easy to read in most of the parts except that some methods could be extracted into separate classes to further improve the readability and prevent the method being too complicated, if make sense. I noticed that there are several violations of the coding standard such as the completeness of Javadoc comments and indentation.


/**
* Constructor which takes in file path of the storage file.
* @param filePath
Copy link

Choose a reason for hiding this comment

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

Perhaps add a description to the parameter name in the Javadoc comments to make it clearer?

* Returns the first word in the string indicated by the first blank space.
* If there are no blank space, the entire string is returned.
*
* @param string
Copy link

Choose a reason for hiding this comment

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

Perhaps add a description for the return value for Javadoc comments to make it more complete? I noticed this issue in several other places as well.


public class Parser {
public static Command parse(String fullCommand) throws DukeException {
if(fullCommand.equals("list")) {
Copy link

Choose a reason for hiding this comment

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

I like the way the if-else conditions are constructed. They are really clear!:) 👍

public static Command list() {
return new Command() {
@Override
public String execute(TaskList taskList, Ui ui, Storage storage) {
Copy link

Choose a reason for hiding this comment

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

Should this part be extracted out? Perhaps consider creating multiple command class to handle different commands in order to improve the readability of following command method? :)

* TaskList contains an ArrayList of Task.
* It serves as a barrier to directly using the ArrayList class so as to limit the functions available to the client.
*/
public class TaskList {

Choose a reason for hiding this comment

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

missing javadocs for methods in this classs

}
public String getDoneString() {
String string;
if(isDone){
Copy link

@howtoosee howtoosee Sep 2, 2020

Choose a reason for hiding this comment

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

missing spaces between parentheses and brace

*/

public class Task {
duke.TaskType taskType;

Choose a reason for hiding this comment

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

use an import rather than referring to duke.TaskType

public class Task {
duke.TaskType taskType;
boolean isDone;
String string;

Choose a reason for hiding this comment

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

is there a better name than string? this isn't very informative


public ArrayList<Task> load() throws DukeException {
File file = new File(filePath);
ArrayList<Task> list = new ArrayList<>();

Choose a reason for hiding this comment

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

i think my tutor mentioned that 'list' as a collection name isnt very intuitive and informative.

Copy link

@howtoosee howtoosee left a comment

Choose a reason for hiding this comment

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

Very clean and readable code! goodjob! However, i noticed that you use 8 spaces for indentation while the convention is to use 4. also, remember to add javadocs for public methods!

other than that, code is clear and concise!

Copy link

@howtoosee howtoosee left a comment

Choose a reason for hiding this comment

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

Very clean and readable code! goodjob! However, i noticed that you use 8 spaces for indentation while the convention is to use 4. also, remember to add javadocs for public methods!

other than that, code is clear and concise!

// edit: sorry my internet lagged and i submitted two reviews oops

ijavierja and others added 23 commits September 10, 2020 14:44
Package classes into sub directories and imported relevant classes.

Duke:
Remove unused code (from previous iterations of GUI) from duke class.
Remove Constructor with single param filename.
Update main to use no param constructor.
Made changes to the JavaDocs.

Storage:
Add switch statement for Storage class

Task:
used unicode number instead of the cross and tick characters.
# Conflicts:
#	src/main/java/Duke.java
#	src/main/java/Parser.java
#	src/main/java/storage/Storage.java
#	src/main/java/task/Task.java
# Conflicts:
#	src/main/java/Duke.java
#	src/main/java/Parser.java
#	src/main/java/storage/Storage.java
#	src/main/java/task/Task.java
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