协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
kotlin-best-practices【开发与工程】Core Kotlin patterns for scope functions, backing properties, and read-only collection interfaces. Use for let/apply/run/also/with choices or encapsulating mutable state; defer general language constructs, extension functions, coroutines/runCatching, Android/Room recipes, and testing/tooling setup.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
apply: Object configuration (returns object).also: Side effects / validation / logging (returns object).let: Null checks (?.let) or mapping (returns result).run: Object configuration and mapping (returns result).with: Grouping multiple method calls on object (returns result)._state (private mutable, e.g., private val _state = MutableStateFlow(initial)) exposed as val state = _state.asStateFlow() (public read-only). Pattern: _prop private, prop public.List/Map (read-only) publicly; keep MutableList internal.runCatching for simple error handling over try/catch blocks.private or internal. Minimize public surface area.object singletons.