Created a page for defensive programming in resonite. |
Added a transitional sentence. |
||
Line 2: | Line 2: | ||
When using [[ProtoFlux]] for your projects, you may run into an issue where something unexpected will happen when another user tries to use your created item, object, or [[World|world]]. These unexpected occurrences may lead to your code breaking, revealing sensitive information, or some other unfavorable event or action. | When using [[ProtoFlux]] for your projects, you may run into an issue where something unexpected will happen when another user tries to use your created item, object, or [[World|world]]. These unexpected occurrences may lead to your code breaking, revealing sensitive information, or some other unfavorable event or action. | ||
These provided strategies will help you in cases where unexpected or unknown problems may happen when developing your projects. | |||
== Strategies == | == Strategies == |
Revision as of 10:09, 17 July 2024
Defensive Programming is the abstract concept of writing code to prevent bugs from happening and preventing security breaches from what a user would input. This is in reference to an article on Defensive Programming on Wikipedia, but is implemented differently in a Resonite context.
When using ProtoFlux for your projects, you may run into an issue where something unexpected will happen when another user tries to use your created item, object, or world. These unexpected occurrences may lead to your code breaking, revealing sensitive information, or some other unfavorable event or action.
These provided strategies will help you in cases where unexpected or unknown problems may happen when developing your projects.
Strategies
User Input Checking
Using strings in a text field may give any user a chance to put in wrong information into the field (i.e. Typing a letter instead of a number in a text field, which may break code that only wants a number).
To check against that, using the Parse node's IsParsed
field to check if that user's input is correctly parsed. Also using the Is Digit node can be just as effective when checking.