Prompt
Choose identifier names that clearly communicate their purpose while maintaining an appropriate balance between brevity and clarity.
Guidelines:
- Use descriptive names that reflect types and purpose:
// Poor: Using abbreviated or generic names cap, err := GetModel(n.String()) // Good: Name reflects the actual type model, err := GetModel(n.String()) - Avoid abbreviations unless universally understood:
// Poor: Unnecessary abbreviation type RopeOpts struct {} // Good: Full word for clarity type RopeOptions struct {} - Balance verbosity - aim for 1-2 word components:
// Too verbose var templateToolPrefix, templateToolPrefixFound := ToolPrefix(model.Template.Template) // Better balance prefix, found := toolPrefix(model.Template.Template) - Be consistent with naming patterns:
// Inconsistent with other handlers func (s *Server) version(w http.ResponseWriter, r *http.Request) // Consistent with other handler naming func (s *Server) VersionHandler(c *gin.Context) -
Avoid single-letter variables outside of short-lived scopes like simple loops.
- In environment variables and constants, spell words completely:
// Poor: Ambiguous abbreviation OLLAMA_GPU_DEVS // Good: Clear, fully spelled out OLLAMA_GPU_DEVICES
When choosing names, prioritize clarity for future readers over saving a few keystrokes now.