clima icon indicating copy to clipboard operation
clima copied to clipboard

Code sanitisation

Open phuongdoan13 opened this issue 2 years ago • 0 comments

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

phuongdoan13 avatar Mar 24 '23 10:03 phuongdoan13