Please do not attempt to simplify this code
Space-shuttle style and purpose of the comment
- File header warns “do not simplify” and describes “space shuttle style”: explicit branches, matching
if/else, heavy commenting. - Some infer this was added after a failed refactor that broke subtle behavior; it’s meant as a guardrail for future maintainers.
- Several readers note the stated “every if has an else” rule is not actually followed consistently, especially around early returns and error checks.
Code style, verbosity, and structure
- Many find the code fairly normal for Go: verbose, but understandable, consistent, and preferable to “clever” or heavily abstracted designs.
- Others criticize: long file (~2k lines), large functions, deep nesting, and comments that restate the obvious rather than describe intent.
- Defenders argue:
- For critical orchestration logic, keeping related paths in one place aids reasoning.
- Over-abstraction and fragmentation across many files can hurt readability more than length.
- Explicit “guard” checks and comments make it easier for non-experts and future maintainers.
- Critics prefer:
- Smaller, composable functions and rule‑ or table‑driven designs.
- Using interfaces/traits or state-machine abstractions instead of large imperative if/else trees.
Comments, tests, and safety guarantees
- Strong divide on comments:
- Pro: comments capture business intent, units, and rationale that tests cannot; even “what” comments can speed scanning.
- Con: comments drift from code, compiler can’t validate them; tests are better for enforcing behavior.
- Some advocate exhaustive test coverage plus mutation testing to ensure all branches are meaningfully exercised.
- Others point out that NASA’s shuttle software quality also relied on intense process: heavy review, verification, and strict standards, not just style.
Kubernetes complexity and reliability
- Mixed experiences:
- Some say core Kubernetes components almost never crash; issues are usually with workloads, not the control plane.
- Others report instability at large scale: controller crashes, etcd issues, and tricky upgrades.
- Debate over appropriateness:
- One side: k8s is overkill for most apps; simple servers or nginx suffice and are cheaper to operate.
- Other side: even “simple” apps benefit from blue/green deploys, scaling, and secret management; managed k8s reduces operational burden.
Language and expression-oriented design
- Thread branches into language design:
- Go criticized for being statement‑oriented, lacking ternary operators and expression-based
if/switchor pattern matching. - Advocates of expression-oriented languages praise destructuring, match/case expressions, and algebraic data types for more concise yet explicit control flow.
- Go criticized for being statement‑oriented, lacking ternary operators and expression-based
- Some see the verbose Go style here as a direct consequence of Go’s limited abstraction and expression facilities.