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

[Edward Alvin] ip #305

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

Conversation

ThePrevailingOne
Copy link

No description provided.

return Duke.LIST.equals(word);
public static void processInput(InputType inputType, String value) {
switch(inputType) {
case LIST:

Choose a reason for hiding this comment

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

According to the codestyle, there should be no intentation for 'case' clauses in the switch block.

public static boolean isList(String word) {
return Duke.LIST.equals(word);
public static void processInput(InputType inputType, String value) {
switch(inputType) {

Choose a reason for hiding this comment

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

Minor style-related thing, but there should be a space before the bracket i.e switch (inputType)

@@ -25,7 +25,7 @@ public static void main(String[] args) {

Object[] parseResult = InputParser.parseInput(input);
InputType inputType = (InputType) parseResult[0];
String value = (String) parseResult[1];
String[] value = (String[]) parseResult[1];

Choose a reason for hiding this comment

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

Why the cast to String[] array here, instead of making InputParser::parseInput(input) return a String[] instead of Object[]?

value = "";
if (inputType.label.length() < input.length()) {
value = input.substring(inputType.label.length() + 1);
if (inputType == InputType.BYE || inputType == InputType.LIST) {

Choose a reason for hiding this comment

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

Maybe it would be neater to separate out into boolean variables for example isBye, isList, etc to be in line with the code quality guideline

Copy link

@muraddurrani muraddurrani left a comment

Choose a reason for hiding this comment

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

Generally I found it quite easy to read all the code. I think you just need to adjust some small things like renaming arrays and arraylists to be plural form.

Comment on lines 23 to 25
Object[] parseResult = InputParser.parseInput(input);
InputType inputType = (InputType) parseResult[0];
String[] value = (String[]) parseResult[1];

Choose a reason for hiding this comment

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

I think parseResult and value could both be renamed in plural form (results and values perhaps?) to be consistent with naming conventions. I noticed this in a few other places.

}
}

public static void processInput(InputType inputType, String[] value) {

Choose a reason for hiding this comment

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

Small thing because its just a parameter but maybe change value to values so its plural?

@@ -0,0 +1,12 @@
public class Todo extends WordListItem{

Choose a reason for hiding this comment

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

I think there should be a space between WordListItem and {.

@@ -0,0 +1,5 @@
public class UnknownInputException extends Exception{

Choose a reason for hiding this comment

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

I think there should be a space between Exception and {.

import java.util.ArrayList;

public class WordList {
private ArrayList<WordListItem> wordList;

Choose a reason for hiding this comment

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

Perhaps this could be renamed to words or something similar to be plural?

System.out.println(this);
}

public int length() {

Choose a reason for hiding this comment

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

The coding standards suggest that method names be verbs. Perhaps this could be changed to getLength or something like that.

@ThePrevailingOne
Copy link
Author

Duked

“Your mind is for having ideas, not holding them.” – David Allen

Duked frees your mind of having to remember things you need to do. It's,

  • text-based
  • easy to learn
  • FAST SUPER FAST to use

All you need to do is,

  1. download it from here.
  2. double-click it.
  3. add your tasks.
  4. let it manage your tasks for you 😉

And it is FREE!

Features:

  • Managing tasks
  • Managing deadlines (coming soon)
  • Sorting tasks (coming soon)

Just double click on the jar and it should open the app GUI :)

or

Run

java -jar Duke.jar //depending on the relative location of the app

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