Example code in documentation and tutorials should adhere to project style guidelines and demonstrate best practices. Avoid using internal classes or implementation details that are inaccessible to users. Instead, use public APIs and concrete resources that developers can directly copy into their applications.
Example code in documentation and tutorials should adhere to project style guidelines and demonstrate best practices. Avoid using internal classes or implementation details that are inaccessible to users. Instead, use public APIs and concrete resources that developers can directly copy into their applications.
For instance, instead of using test-specific utilities:
this.maplibreMap.setStyle(
Style.Builder().fromUri(TestStyles.getPredefinedStyleWithFallback("Streets"))
)
Use concrete, accessible resources:
this.maplibreMap.setStyle(
Style.Builder().fromUri("https://demotiles.maplibre.org/style.json")
)
Similarly, when demonstrating architecture patterns (like in SwiftUI), follow established best practices even if they require additional complexity. Since developers often copy example code directly into their projects, prioritize teaching proper patterns over shortcuts. This principle extends to all examples regardless of language or framework—always prefer clarity, correctness, and adherence to project style guidelines over brevity.
Enter the URL of a public GitHub repository