The risks of code execution by default on widget change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 12:14 PM - edited 02-05-2024 12:21 PM
Taking from my experience, the default action of widgets triggering code execution upon value change poses risks that outweigh the convenience in certain scenarios.
While this feature may seem advantageous in some cases, it can lead to unintended consequences and a less controlled development environment. Having a widget's value change automatically trigger code execution during the midst of development or maintenance can have significant ramifications if the code is not adequately structured or tested. Moreover, it becomes even more problematic if the inattentive user fails to perceive that an execution has occurred.
Given these considerations, I believe the default behavior for widget value change should be to do nothing, or at least make it so that the user can customize this setting in their preferences. Additionally, implementing a visual cue in the IDE to indicate that widget changes will trigger code execution would provide developers with a clearer understanding of the potential impacts of their actions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 07:28 PM
click gear icon on top right, set Widget panel settings
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 04:08 AM
Yes, I'm aware that it can be changed for each notebook. What I don't think is safe is for it to 'Run' by default instead of 'Do nothing'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2024 07:50 AM
I definitely have to agree with the original point- if you have a notebook that you import, and you touch any widget value you're running code, most likely accidentally. I'd love to see a workspace or user type option where you can change the default to "do nothing" for all widgets/notebooks.

