programming-idioms
programming-idioms copied to clipboard
Discourage overwriting an impl
Often, users click "Edit impl" and then write a very different implementation in the code snippet textarea. In this cas, they should have created a new implementation alongside the existing one, instead of overwriting it.
Please implement the following prompt:
IF the user clicks [SAVE] in the Impl Edit form of an existing impl, AND the user has modified the code snippet AND the modification of the code snippet is substantial (e.g. diff>5 characters) THEN display a new popin prompt containing
- old code snippet on the left
- new code snippet on the left
- "Are you fixing a bug in the implementation, or writing a different implementation?"
- Button [Fix existing implementation (overwrite)]
- Recommended button [Different implementation (create new)]