1.5 KiB
1.5 KiB
Patterns and Anti-Patterns
Last Updated: 2026-04-05
Capture recurring implementation patterns that impact compile stability.
Pattern Entry Template
- Context: where this applies
- Good pattern: concise example/description
- Anti-pattern: concise example/description
- Why it matters: one sentence
Starter Patterns
-
NT8 override signatures
- Good pattern: copy exact signature from official NT8 docs before coding.
- Anti-pattern: infer or copy from outdated examples.
- Why it matters: prevents
CS0115and runtime integration drift.
-
Access modifier on overrides
- Good pattern: use
protected overridefor NT8 lifecycle/event methods. - Anti-pattern:
public overrideorprivate override. - Why it matters: prevents
CS0507.
- Good pattern: use
-
C# 5 compatibility discipline
- Good pattern:
string.Format, explicit null checks, block-bodied members. - Anti-pattern: string interpolation, null-conditional, expression-bodied members.
- Why it matters: prevents avoidable language-version compile failures.
- Good pattern:
-
Managed order sequencing
- Good pattern: set stop/target before entry on the same bar.
- Anti-pattern: entry first, then stop/target.
- Why it matters: avoids silent behavior defects and rejected assumptions.
-
Scope-first fixes
- Good pattern: smallest safe change in scoped files only.
- Anti-pattern: broad cleanup or adjacent-file edits during bugfix.
- Why it matters: reduces regression risk and review churn.