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

Code sanitisation #159

Open
phuongdoan13 opened this issue Mar 24, 2023 · 0 comments
Open

Code sanitisation #159

phuongdoan13 opened this issue Mar 24, 2023 · 0 comments
Assignees

Comments

@phuongdoan13
Copy link
Contributor

This is the issue that our team has discussed with you in one of the previous pull request. I want to create this to formalise the task.

I noticed that the code contained repetition of raw string such as df['hour'], df['minute']. These repetitions can cause run-time errors(i.e. errors that are not caught during "compile" time, but only when the user interact with the UI) if someone accidentally mispell a string (e.g. "hours" instead of "hour").

A solution I learned at the workplace is putting these raw strings into variables. hour = "hour", minute ="minute". Putting these variable in classes if necessary. This will avoid repeting raw string, as well as allowing IDE suggestions

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

No branches or pull requests

1 participant