standards-and-practices icon indicating copy to clipboard operation
standards-and-practices copied to clipboard

Proposed new process standard for workarounds in code

Open coreyshuman opened this issue 6 years ago • 9 comments

I would like to propose a new Shift3 rule: If you add code that is a workaround, you should include a comment which explains why it's there, and links to an official Github issue.

We have an example in our Normalize app, where navigation doesn't work correctly when simultaneously closing a modal window. Under this rule, all instances of the workaround would look something like this:

// This is a workaround for a navigation issue when closing a modal:
// https://github.com/NativeScript/nativescript-angular/issues/1380 
return setTimeout(() => Helpers.getRoute("badges", this.router), 50);

This will avoid confusion during code review and during future maintenance. This also documents the issue, so the workaround reasoning is not forgotten in the future.

coreyshuman avatar Jan 31 '19 23:01 coreyshuman