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

【Heng Jee Kuan] iP #457

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

Conversation

hengjeekuan
Copy link

@hengjeekuan hengjeekuan commented Feb 4, 2025

JeeniusPro

"Your mind is for having ideas, not holding them." - David Allen (source)

JeeniusPro 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 for you 😉

And it is FREE!

Features:

  • Managing tasks
  • Managing deadlines (coming soon)
  • 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);
    }
}

damithc and others added 27 commits July 11, 2024 16:52
In build.gradle, the dependencies on distZip and/or distTar causes
the shadowJar task to generate a second JAR file for which the
mainClass.set("seedu.duke.Duke") does not take effect.
Hence, this additional JAR file cannot be run.
For this product, there is no need to generate a second JAR file
to begin with.

Let's remove this dependency from the build.gradle to prevent the
shadowJar task from generating the extra JAR file.
Copy link

@nictjh nictjh left a comment

Choose a reason for hiding this comment

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

Good work man, learnt alot from ya

ui.printTaskList(tasks.getTasks());
} else if (input.startsWith("todo")) {
String[] parts = input.split(" ", 2);
if (parts.length < 2) throw new JeeniusException("bro how do you todo nothing??? ADD A DESCRIPTION FOR YOUR TODO");
Copy link

Choose a reason for hiding this comment

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

The conditional should be put on a separate line, could help in future debugging if necessary :>!
Other than that LGTM!!

boolean isDone = parts[1].trim().equals("1");
String description = parts[2].trim();

switch (taskType) {
Copy link

Choose a reason for hiding this comment

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

The case clauses shouldn't have any indentation as per coding standards. Can try to configure IDE to standardise the style

return this.description;
}

public Boolean getDone() {
Copy link

Choose a reason for hiding this comment

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

This getter function can follow the "use a prefix such as is, has, was, etc. for boolean variables and methods". (Small things man give chance need fill quota)

loadedTasks = new TaskList(storage.load());
} catch (JeeniusException e) {
ui.printError(e.getMessage());
loadedTasks = new TaskList(new ArrayList<>());
Copy link

Choose a reason for hiding this comment

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

The Generic here could be filled with the super class (Task) for clarity, readability, and type safety. Prevent any inference made by Java.

import java.util.ArrayList;
import java.util.List;

public class TaskList {
Copy link

Choose a reason for hiding this comment

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

LGTM man

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

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.

LGTM!

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Event extends Task {
Copy link

Choose a reason for hiding this comment

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

LGTM bro


import java.util.List;

public class Ui {
Copy link

Choose a reason for hiding this comment

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

Good job man, there's really nothing to nitpick at all

Copy link

@pastchum pastchum left a comment

Choose a reason for hiding this comment

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

Very good code, apart from few minor nits this code was very well done!

ui.printError(e.getMessage());
}
}
}
Copy link

Choose a reason for hiding this comment

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

Good naming conventions, good code

ui.printTaskList(tasks.getTasks());
} else if (input.startsWith("todo")) {
String[] parts = input.split(" ", 2);
if (parts.length < 2) throw new JeeniusException("bro how do you todo nothing??? ADD A DESCRIPTION FOR YOUR TODO");
Copy link

Choose a reason for hiding this comment

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

Line is too long, can be difficult to read. consider splitting into 2 lines.

} catch (Exception e) {
throw new JeeniusException("Failed to mark/unmark. Use: mark/unmark [task number]");
}
} else {
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 you format the code in each "if" case. Very readable and neat, except for the few lines that seem to be very long and can be split into 2.

public Task getTask(int index) {
return tasks.get(index);
}

Copy link

Choose a reason for hiding this comment

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

Should name method getSize to follow naming standard for methods. Apart from that LGTM


public class Ui {

public void printWelcomeMessage() {
Copy link

Choose a reason for hiding this comment

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

Good use of already defined functions to neaten and reduce repeated code. LGTM

hengjeekuan and others added 30 commits February 12, 2025 00:56
Assertions have been added to Tasklist.java to document important assumptions and prevent potential runtime errors. These assertions serve to verify that critical conditions hold throughout the program execution reducing chances of unexpected behaviour.

Let's:
- Add an assertion in the constructor to ensure the task list is never null after initialization
- Add an assertion in 'findTasks()' to prevent a 'NullPointerException' when processing a search keyword
- Add an assertion in 'deleteTask()' and 'getSize()' to validate that the provided index is within bounds before performing operations
- Add an assertion in 'addTask()' to prevent null tasks from being added
…straints

Assertions have been added to Parser.java to ensure that critical conditions
are met before executing commands. These assertions help catch logical errors
early during development and debugging, improving the robustness of the parser.

Let's:
- Add assertions to validate that `input`, `tasks`, `ui`, and `storage`
  are not null before processing commands.
- Ensure that `deleteTask()`, `mark/unmark`, and `getSize()` only operate on
  valid task indices, preventing out-of-bounds errors.
- Add assertions in `findTasks()` and task creation commands (`todo`,
  `deadline`, `event`) to verify that input strings are not null or empty.
- Enforce correct splitting of parameters in `deadline` and `event` tasks
  to prevent index errors.
…put handling

Assertions have been added to Jeenius.java to ensure that essential components
are properly initialized and critical input validations are enforced. These
assertions help catch logical errors early, preventing unintended behavior.

Let's
- Add assertions to validate that `filePath` is not null or empty before initializing storage.
- Ensure that `ui`, `storage`, `parser`, and `tasks` are not null after initialization.
- Add assertions in `run()` to verify that the `ui` and `parser` are ready before execution.
- Includ an assertion in `getResponse()` to ensure the input string is never null.
- Verifiy that user input in `run()` is not null before processing.
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.

5 participants