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

[shadhankkk] iP #649

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

Conversation

shadhankkk
Copy link

No description provided.

damithc and others added 22 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.
/**
* Returns void, just prints a horizontal line
*/
void printHorizontalLine() {

Choose a reason for hiding this comment

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

method names follow convention (start with verb, written in camelCase) and are really organized! great work on that

int len = userInput.length();
int startIndex = ptr;

while(ptr < len) {

Choose a reason for hiding this comment

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

The recommended Java coding standard requires a space after reserved keywords such as while. But you'll probably figure this out after adding checkstyle in Week 4, so you can fix it then!


ui.printHorizontalLine();

for(int i=0; i<numberOfMessages; i++) {

Choose a reason for hiding this comment

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

Same here for space after for

* in our array of tasks
*/
void markTask(int rank) {
if(rank < 1 || rank > tasks.size()) {

Choose a reason for hiding this comment

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

Same here for space after if, etc.

Copy link

@weiseng18 weiseng18 left a comment

Choose a reason for hiding this comment

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

overall very organized code!

there are some minor coding style issues that you'll probably notice after adding checkstyle in Week 4, so you can fix it once you've worked on that!

you might want to add .class and .jar to .gitignore since we don't want to commit binaries

Copy link

@yooplo yooplo left a comment

Choose a reason for hiding this comment

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

Overall, well done!

/**
* Returns void, just prints the opening text
*/
void printOpening() {
Copy link

Choose a reason for hiding this comment

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

Looks good!I don't know if adding access modifiers to the methods would make it better though.

* Returns void, just prints the latest task unmarked
*
* @param task the task that was unmarked
*/
void printTaskUnmarked(Task task) {
System.out.println(horizontalLine);
System.out.println("OK, I've marked this task as not done yet:");
task.print();
System.out.println(horizontalLine);
}

Choose a reason for hiding this comment

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

Ui class has all needed methods, using abstraction very very well.

shadhankkk and others added 19 commits September 20, 2024 13:19
Some parts of the code assume certain conditions hold, but these assumptions are not explicitly enforced. This could lead to errors or unexpected behavior during execution if those assumptions are violated.

Without enforcing these conditions, the code may fail silently, which could make debugging more difficult and reduce code reliability.

Let's add assert statements to verify critical conditions at runtime. This ensures that assumptions are checked and provides immediate feedback if they are violated.

Using assert is appropriate here because it adds minimal overhead and is disabled in production, keeping performance unaffected.
The program contains blocks of code that are no longer executed or necessary. These portions of the codebase add unnecessary complexity and make it harder to maintain and read the code.

Dead code can confuse developers and lead to misunderstandings about the program's behavior. It's important to keep the codebase clean and focused only on what is required.

Let's remove the dead code to simplify the codebase, reduce maintenance overhead, and improve overall readability.

Removing dead code helps avoid future bugs and keeps the project lean.
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.

6 participants