Skip to content

[enamourous] iP#655

Open
enamourous wants to merge 18 commits into
nus-cs2103-AY2526S1:masterfrom
enamourous:master
Open

[enamourous] iP#655
enamourous wants to merge 18 commits into
nus-cs2103-AY2526S1:masterfrom
enamourous:master

Conversation

@enamourous

@enamourous enamourous commented Sep 3, 2025

Copy link
Copy Markdown

Note

A task bot built with saves, dates, and search.

Features

  • Add todos, deadlines, events
  • Mark/unmark, delete, list
  • Task list stored in disk automatically
  • Search with find

Milestones

  1. Level-0: Greet & Exit
  2. Level-4: Todo/Deadline/Event
  3. Level-7: Save to disk
  4. Level-8: Dates (LocalDate)
  5. Level-9: find command
  6. Level-10: GUI version

Task list

  • Open PR
  • Finish CA1
  • Complete iP
  • Get A in CS2103T

Sample usage

// Add a deadline with ISO date, then search
deadline return book /by 2019-12-02
find book

@wangyuanchi wangyuanchi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The code is generally clean and good!

Comment thread src/main/java/Note/ui/Note.java Outdated
Comment on lines +37 to +38
switch (command) {
case "bye":

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think it would be better to align the switch and case statements to better match the coding guidelines.

Suggested change
switch (command) {
case "bye":
switch (command) {
case "bye":

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seconded!

@seokjoon27 seokjoon27 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nicely done with coding conventions, all coding standards seems to be well adapted.

Comment thread src/main/java/Note/ui/Note.java Outdated
@@ -0,0 +1,185 @@
package ip;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice packaging for classes

Comment on lines +8 to +12
/**
* The Note class represents a simple command-line task manager chatbot.
* Users can add todos, deadlines, and events, mark/unmark tasks as done,
* delete tasks, find tasks by keyword, and save/load tasks from a file.
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All methods and classes containing header comments

* delete tasks, find tasks by keyword, and save/load tasks from a file.
*/
public class Note {
private static final String FILE_PATH = "data/duke.txt";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SCREAMING_SNAKE_CASE well used

*/
public class Task {
protected String description;
protected boolean isDone;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

camelCase well used

@ashmitahaldar ashmitahaldar left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overall great work! Apart from some small tweaks to adhere to coding standard, your chatbot aligns well with code quality standards with regards to naming 😄

Comment thread data/duke.txt Outdated
@@ -0,0 +1 @@
T | 0 | eat rice

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perhaps you could add this data storage file to the .gitignore file, so that your saved task lists don't get added to the repository on GitHub!

@@ -0,0 +1,50 @@
package Note.ui;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could task classes perhaps be placed in a separate package with a different name? Such as Note.task

Comment thread src/main/java/Note/ui/Note.java Outdated
Comment on lines +37 to +38
switch (command) {
case "bye":

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seconded!

for (Task t : tasks) {
String line = "";
switch (t.getTypeIcon()) { // use getTypeIcon() instead of getType()
case "T":

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It would be great if you could match the indentation of the switch and case staements here to align with the coding standard.

Suggested change
case "T":
switch (t.getTypeIcon()) { // use getTypeIcon() instead of getType()
case "T":

damithc and others added 7 commits September 5, 2025 16:12
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.

@YSTey0808 YSTey0808 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overall well done. Maybe can take note of packages and some code standard. Good job

@@ -0,0 +1,47 @@
package Note.ui;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think it would be better to have more packages for your ui part. Maybe can abstract out tasks, then storage so on and so forth.

@@ -0,0 +1,55 @@
package Note.ui;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same idea. Abstract to new package.

case "bye":
return "Bye! Hope to see you again soon!";

case "list":

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

My idea is that would be better to abstract out those command implementation to a new method

@@ -0,0 +1,111 @@
package Note.ui;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same idea. Abstract to new package would be better.

Comment thread src/main/java/Note/ui/Storage.java Outdated
try (BufferedWriter writer = new BufferedWriter(new FileWriter(filePath))) {
for (Task t : tasks) {
String line = "";
switch (t.getTypeIcon()) { // use getTypeIcon() instead of getType()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should take note of swtich case code style

@@ -0,0 +1,36 @@
package Note.ui;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same idea. Abstract to new package would be better.

@@ -0,0 +1,61 @@
package Note.ui;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same idea. Abstract to new package.

The code for parsing dates and extracting command arguments relies on
assumptions that are not explicitly documented in the code itself. For
example, Deadline.parseDateTime assumes that the input string follows
the d/M/yyyy HHmm format, while methods in Parser assume the presence
of certain flags or spacing in user input.

Without explicit documentation, such assumptions are easy to overlook.
This can make debugging harder when unexpected input causes failures in
non-obvious places.

Let's add Java assert statements in critical places to document these
assumptions. Assertions make the expectations clear to both the developer
and future maintainers, while also allowing failures to be detected early
during testing.

Using assert instead of exceptions is appropriate here because:

These conditions reflect developer assumptions, not user errors.

They act as internal documentation that disappears in production
(when assertions are disabled).

This improves code clarity, ensures that hidden assumptions are explicit,
and strengthens maintainability without affecting runtime behavior for
end users.
Add assertions to document parser and deadline 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.

7 participants