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

[HusseinSafwan02] iP #463

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

Conversation

HusseinSafwan02
Copy link

@HusseinSafwan02 HusseinSafwan02 commented Feb 6, 2024

ChillChief

"Simplicity boils down to two steps: identify the essential, eliminate the rest."– Leo Babauta (source)

ChillChief is your go to assistant 'bro' for managing tasks in your life. It is

  • Super Chill
  • Super Easy
  • Super Useful

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:

  • Add, Delete, and Find your tasks
  • Manage Deadlines, Events and Todo's
  • Receive Reminders (coming soon!)

If you are a Java programmer, you can use it to practice Java too. Here's the main method:

public class Main {
    public static void main(String[] args) {
        Application.launch(MainApp.class, args);
    }

Copy link

@Teeesa7 Teeesa7 left a comment

Choose a reason for hiding this comment

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

LGTM, just a tiny issue of unnecessary spaces at different places in the code.

public class Duke {

// confirmation comment after adding a task
public static String addComment (Task task, int n) {
Copy link

Choose a reason for hiding this comment

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

Shouln't there be no space following addComment and the arguments it takes in?

return message;
}

public static String introMessage() {
Copy link

Choose a reason for hiding this comment

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

Perhaps another name for the method? Something like getIntroMessage()?, as introMessage() sounds like a String variable instead 😅

return greeting + mickey + intro;
}

public static String outroMessage() {
Copy link

Choose a reason for hiding this comment

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

Please refer to the comment given for introMessage()

@@ -0,0 +1,16 @@
public class Deadline extends Task{
Copy link

Choose a reason for hiding this comment

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

There should be a space after Task and { right? I noticed the same issue in other places, so just mind that :)


private Task parseTask(String data) {
String[] parts = data.split(" \\| ");
if (parts.length < 3) return null; // Basic validation
Copy link

Choose a reason for hiding this comment

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

Maybe you can use the K&R style brackets (Egyptian style) brackets here for better readability?

Copy link

@Li-Zizhen Li-Zizhen left a comment

Choose a reason for hiding this comment

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

Overall, your code is easy to understand. Most of your code follows the coding standard. However, there are some minor things you may fix. In all, LGTM, good job!

return greeting + mickey + intro;
}

public static String outroMessage() {

Choose a reason for hiding this comment

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

Perhaps it's better to make the method name more understandable.

System.out.println(addComment(tasks.get(count - 1), count));
fileManager.saveTasks(tasks);
}

Choose a reason for hiding this comment

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

Not sure if this empty line is left on purpose or not.

return this.time;
}

@Override public String toString() {

Choose a reason for hiding this comment

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

Better to put Override above the method.

public static void listTasks(ArrayList<Task> taskList, int count) {
System.out.print("____________________________________________________________\r\n");
System.out.println(" Here are the tasks in your list:");
for (int i = 0; i < taskList.size(); i++ ) {

Choose a reason for hiding this comment

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

Better to delete space after ++

return message;
}

public static String replacer(String input) {

Choose a reason for hiding this comment

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

Better to use a verb for method naming.

Comment on lines 106 to 107


Choose a reason for hiding this comment

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

better not to leave so many empty lines.

if (isEvent) {
String task = getTask(userInput);
int index = userInput.indexOf("/");
String when = replacer(userInput).substring(index);

Choose a reason for hiding this comment

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

Better use a noun to name variable.

}
if (isDeadline) {
int index = userInput.indexOf("/");
String when = userInput.substring(index + 3);

Choose a reason for hiding this comment

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

same as above

}

private Task parseTask(String data) {
String[] parts = data.split(" \\| ");

Choose a reason for hiding this comment

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

Perhaps rename parts to something more understandable?

HusseinSafwan02 and others added 29 commits February 22, 2024 01:34
# Conflicts:
#	src/main/java/chillchief/ChillChief.java
A 'help' command is useful for new users who are using ChillChief
for the first time.

Let's,
* update the parser to handle the 'help' command
* update the TextUi to generate the text Ui for the user
No checking of important assumptions at various points in code.

Checking of assumptions through assertions ensures that different
points of the code is functioning as expected.

Assertions added at key points with assumptions in private methods.

Ensures arguments for private methods are valid.
Assertions for important assumptions.
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