计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
swift-best-practices【效率与协作】Apply Guard, Value Types, Immutability, and Naming conventions in Swift. Use when writing idiomatic Swift with guard, value types, immutability, or naming conventions—not Swift concurrency/actor-isolation, persistence, linting, or release tooling.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
guard let over nested if statements for better readability and to unwrap optionals early.guard for precondition checks at top of function to reduce nested depth.@unknown default for freezing enums (enums from frameworks).if case .success(let value) = result for simple enum pattern matching.class only when reference identity or inheritance required.var only when change required.final for all classes that not intended to subclassed to improve performance (static dispatch).final classes.is, has, or can. Example: isValid, hasErrors, canEdit. Makes boolean state clear.camelCase for clear names and PascalCase for types.-able, -ible, or -ing suffixes (e.g., Codable, Identifiable).some View or some Collection for return types where underlying type internal.compactMap, filter, and reduce instead of explicit for-where loops for data transformations..lazy for large sequences when result consumed partially.default values in dictionary access to avoid double optional unwrapping.guard for early exits.! on optionals. Use ?? (nil-coalescing) or if let.static let shared) or DI.