plugins/conductor/templates/code_styleguides/general.md
Universal coding principles that apply across all languages and frameworks.
# Bad
d = 86400 # What is this?
temp = getUserData() # Temp what?
# Good
secondsPerDay = 86400
userData = getUserData()
calculateTotal(), validateInput()is/has/can for booleans: isValid(), hasPermission()sendEmailNotification() not send()User, OrderProcessor, ValidationResultManager, Handler, Data# Bad
i += 1 # Increment i
# Good
# Retry limit based on SLA requirements (see JIRA-1234)
maxRetries = 3
# Bad: Silent failure
try:
result = riskyOperation()
except:
pass
# Good: Explicit handling
try:
result = riskyOperation()
except SpecificError as e:
logger.error(f"Operation failed: {e}")
raise OperationFailed("Unable to complete operation") from e
# Describe behavior, not implementation
test_user_can_login_with_valid_credentials()
test_order_total_includes_tax_and_shipping()