When creating or modifying APIs, carefully consider what becomes part of your public API surface to ensure backward compatibility and consistent developer experience.
Key practices:
TerraformAuthorizationScopeFilter
instead of generic AuthorizationScopeFilter
)Example:
// GOOD: Specific, descriptive client name with consistent method naming
PersistentAgentsClient agentClient = projectClient.GetPersistentAgentsClient();
// BAD: Generic naming or inconsistent patterns
AgentsClient agentClient = projectClient.GetAgentsClient();
// GOOD: Strongly-typed parameters
private int GetHumidityByAddress(Address address)
{
return (address.City == "Seattle") ? 60 : 80;
}
// BAD: Generic dictionary parameters that hide the actual structure
private int GetHumidityByAddress(Dictionary<string, string> address)
{
return (address["City"] == "Seattle") ? 60 : 80;
}
Before adding new public API members, consider if they’re truly necessary and ensure they won’t need breaking changes in the future.
Enter the URL of a public GitHub repository