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

[vivienherq] iP #529

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

Conversation

vivienherq
Copy link

@vivienherq vivienherq commented Sep 3, 2023

Dude

Dude 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 your tasks for you 😉

And it is FREE!

Features:

  • Managing tasks
  • Managing deadlines
  • Managing events
  • 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

@garylow2001 garylow2001 left a comment

Choose a reason for hiding this comment

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

LGTM. Overall just some nits about coding standards!

this.from = from;
this.to = to;
}
public String getType() {

Choose a reason for hiding this comment

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

Perhaps you can add a @Override above your getType() method to specify that you wish to override this method from Task


// static Task[] taskList = new Task[100];
static ArrayList<Task> taskList = new ArrayList<Task>();
static int nTasks = 0;

Choose a reason for hiding this comment

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

Instead of having an nTasks to keep track of the number of tasks in taskList why not use taskList.size()?

public static void list() {
for (int i = 0; i < nTasks; i++) {
Task task = taskList.get(i);
// Task task = taskList[i];

Choose a reason for hiding this comment

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

You are using comments to temporarily remove code, however comments should be used to describe the code to the reader. They should also be indented to the relative position to your code i.e. the // needs to be on the same line as Task on line 47


public static void mark(int n) {
// taskList[n-1].setDone(true);
taskList.get(n-1).setDone(true);

Choose a reason for hiding this comment

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

For clarity, perhaps you can split this line up into

selectedTask = taskList.get(n-1);
selectedTask.setDone(true);

String input = scanner.nextLine();
String[] words = input.split(" ");

if (words[0].equals("list")) {

Choose a reason for hiding this comment

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

Perhaps you can use switch statements for the control flow instead of if-else statements

Copy link

@samuelim01 samuelim01 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 few nits about coding standards. Overall, good job 😄

@@ -0,0 +1,213 @@
import java.io.*;

Choose a reason for hiding this comment

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

Imported classes should be listed explicitly 😁

Suggested change
import java.io.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

@@ -0,0 +1,35 @@
public class Task {
private String description;
private boolean done;

Choose a reason for hiding this comment

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

booleans variables should be named to sound like booleans

Suggested change
private boolean done;
private boolean isDone;

}

public static void unmark(int n) throws IOException {
taskList.get(n-1).setDone(false);

Choose a reason for hiding this comment

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

Operators should be surrounded by a space character.

Suggested change
taskList.get(n-1).setDone(false);
taskList.get(n - 1).setDone(false);

import java.util.Locale;

public class Deadline extends Task {
LocalDateTime by;

Choose a reason for hiding this comment

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

Variables should be non-public.

Suggested change
LocalDateTime by;
private LocalDateTime by;

static ArrayList<Task> taskList = new ArrayList<Task>();
static int nTasks = 0;

private static final String FILE_PATH = "./data/dude.txt";

Choose a reason for hiding this comment

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

This constant doesn't seem to be used. Did you forget to replace your instances of "./data/dude.txt" with FILE_PATH?

data/dude.txt Outdated

Choose a reason for hiding this comment

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

This file can be excluded from commits!

Copy link

@andrefoo andrefoo left a comment

Choose a reason for hiding this comment

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

LGTM, minor fixes only.


import java.util.Scanner;
public class Ui {
Scanner sc;

Choose a reason for hiding this comment

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

Logical units within a block should be separated by one blank line.
Consider making the variable 'sc' private as well!

vivienherq and others added 30 commits September 14, 2023 19:50
Set up CI

To run workflow (as per gradle.ymp file) every time certain
project events are triggered.
Add classes and methods to support Notes in Dude
Current structure is not very organised after adding new classes.

New packages are added and classes are moved into packages.

* dude.ui package added
* dude.note package added
Null values are returned for Task and Note.

Null values in loaded data can lead to unexpected behaviour
and errors in the application.
Find command is case-sensitive.

A case-insensitive find is more user-friendly because users cannot be
expected to remember the exact case of the keywords.

* Update search algorithm to use case-insensitive matching
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