Update bad practise section

This commit is contained in:
JeremyStar™ 2024-05-05 15:15:18 +02:00
parent 36d4b9e555
commit 5c2fe02c4e
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -11,8 +11,7 @@ Before you write any code, you should decide wheneter to write your code as a mo
## Bad practise
Before we finally come to some code, never avoid these things while writing a custom module:
- Access hardcoded classes, scripts, assets, etc. from your project. Use arrays and dictionaries aswell as get(), set() and other functions for that.
- Depend on your project code. Modules are intended to be project independent and work in every environment where CORE runs.
- Depend on your project code. Modules are intended to be project independent and work in every environment where CORE runs. If you need to access some asset or scene, use a variable to store the path.
- Never crash the entire framework on invalid user input, only crash when an internal error occurred. \
Let's say that you have two functions: An internal `_display_scene` method and a `transition_between_scenes` method. \
When the developer calls `transition_between_scenes` and supplies an invalid object to the method, you should call `logger.error` (and return the error) as the error comes from the developer and should be handled by the developer's code. \