-
Notifications
You must be signed in to change notification settings - Fork 434
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
[Seng Zhen Hong] iP #468
base: master
Are you sure you want to change the base?
[Seng Zhen Hong] iP #468
Conversation
Let's tweak the docs/README.md (which is used as the user guide) to fit Duke better. Specifically, 1. mention product name in the title 2. mention adding a product screenshot and a product intro 3. tweak the flow to describe feature-by-feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice Code!. Keep working on it:)
src/main/java/Duke.java
Outdated
while (!command.equals("bye")) { | ||
System.out.println("____________________________________________________________"); | ||
try { | ||
if (command.equals("list")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code seems to be too long for me. Try to divide each commands into different functions.
src/main/java/Duke.java
Outdated
LocalTime endTime = LocalTime.parse(to, DateTimeFormatter.ofPattern("HHmm")); | ||
return new EventTask(description, startTime, endTime); | ||
default: | ||
return new ToDoTask(description); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider the case when the file is corrupted
src/main/java/Duke.java
Outdated
|
||
class Task { | ||
protected String description; | ||
protected boolean isDone; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice boolean naming👍
src/main/java/Duke.java
Outdated
} | ||
duke.saveTasksToFile(tasks); | ||
|
||
System.out.println("____________________________________________________________"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe consider connecting this three println statements using +.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM just some minor nits to consider!
src/main/java/Duke.java
Outdated
@@ -1,10 +1,283 @@ | |||
import java.io.File; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can consider ordering imports in lexical order
src/main/java/Duke.java
Outdated
System.out.println("Hello from\n" + logo); | ||
System.out.println("____________________________________________________________"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can consider making linebreaks into a constant variable which can make code cleaner
src/main/java/Duke.java
Outdated
String command = scanner.nextLine(); | ||
// Initialize tasks list here | ||
|
||
while (!command.equals("bye")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can consider breaking down this function into smaller functions to make it more readable for others, might be a little too long currently. Can break down into like two functions like run and commands
src/main/java/Duke.java
Outdated
scanner.close(); | ||
} | ||
} catch (IOException e) { | ||
System.out.println("Error loading tasks from file: " + e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can consider making this into your own exception class and include the additional error messages as part of the new exception
src/main/java/Duke.java
Outdated
protected boolean isDone; | ||
|
||
public Task(String description) { | ||
this.description = description; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why you added this. infront in task and not in Duke class? Can consider having a constant reference standard.
src/main/java/Duke.java
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good naming of functions and variables and all in all LGTM but just some minor nits
This commit adds an assertion to the parseCommand method in the Parser class to ensure that the array 'parts' has at least one element before further processing. The added assertion enhances the robustness of the code by catching unexpected conditions early in development. Changes made in this commit: - Added assertion 'assert parts.length > 0;' to validate the length of the array 'parts'. This assertion serves as a safeguard against potential runtime errors and improves the overall reliability of the command parsing logic.
Add assertion to ensure non-empty array in parseCommand method
Improved code quality
CharmBot
“Your mind is for having ideas, not holding them.” – David Allen (source)
DukePro 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,
add your tasks.
let it manage your tasks for you 😉
And it is FREE!
Features:
Managing tasks
Managing deadlines (coming soon)
Reminders (coming soon)