See all glossary termsA dependency is any piece of code or data that another piece of code needs to function. If you remove a dependency, the code stops functioning as intended.
Dependencies exist at all levels in your code:
- Every time you define a variable and use it somewhere in your code, that variable is a dependency.
- If you access another node in the scene tree in a script (like using
get_node()
or $Player
), that node is a dependency.
- If you use a resource like a texture or a shader in your game, that resource is a dependency.
- If you make a game with Godot or any other engine, the engine itself is a big dependency!
Different kinds of dependencies have a different weight or impact on your codebase.
Generally, the more dependencies you have in your code, and the more distant or indirect these dependencies are, the more difficult your code becomes to change or maintain.
So, a big part of our jobs as developers is to pay attention to the number and nature of dependencies in our code and ensure they remain manageable.See Also
Related terms in the Glossary
school.gdquest.com - 0.3.5-2024-12-30T04:58:20.194Z-cada1d8dad35c7b416c143e8dc23e708df6bd9c8-main