Eliminate use of glob imports in examples #1721
Labels
C-Code-Quality
A section of code that is hard to understand or change
C-Docs
An addition or correction to our documentation
C-Examples
An addition or correction to our examples
D-Trivial
Nice and easy! A great choice to get started with Bevy
What problem does this solve or what need does it fill?
Glob imports (aka `use bevy::prelude::*) are very convenient in real games, especially simple ones.
However, in example code, it makes it very hard to understand where imports are coming from (and risks running into namespace mangling when the boilerplate is used in real code).
What solution would you like?
Replace glob imports in the examples with explicit imports. Do not import from the prelude (or other re-exported locations), instead use full paths so users can find the original location.
This rule should be ignored in the
games
example folder and the Bevy book. The increased brevity / lowered conceptual overhead is more valuable there.What alternative(s) have you considered?
Use github1s.com + go to definition to track down the places where the functions are actually defined. This is only a workaround.
Additional context
Related to #1247.
Discussed on Discord here.
The text was updated successfully, but these errors were encountered: