Code-level signals beyond just years of experience.
Bulkification mindset: every method accepts and returns Lists, not single records. Junior code has processRecord(Account a); senior has processRecords(List<Account> accs).
Null safety: explicit checks before dereferencing. Use ?. (safe navigation) or guard with if (a != null). Junior code throws NPEs in production; senior anticipates them.
Governor limit awareness: SOQL/DML never inside loops. Senior devs know 100 SOQL / 150 DML / 10s CPU / 6 MB heap from memory and design accordingly.
Testable architecture: classes built around interfaces; dependencies injected. Junior code has hard-coded new SomeService(); senior takes services in the constructor.
Single Responsibility: classes have one reason to change. Junior code has 1500-line "do everything" classes; senior splits into Service / Repository / Domain layers.
Custom exceptions for business errors: throw new CustomerNotFoundException() not throw new Exception('not found'). Catch by type, not by string match.
Logging at the right level: System.debug(LoggingLevel.ERROR, ...) not just System.debug(...). In production, route to a log object via a logging utility.
Writes thoughtful tests: AAA structure, factory pattern, bulk testing (200+ records), negative cases. Junior tests hit coverage; senior tests assert behaviour.
Reviews their own diff: re-reads the change before submitting. Senior devs catch their own SOQL-in-loops in code review prep.
Knows when to use Flow / no-code instead of Apex: not every problem is an Apex problem. Senior devs default to declarative when adequate.
Performance instinct: profiles before optimising. Senior devs read debug logs fluently and reason about CPU/heap/SOQL counts.
Integration savvy: knows REST vs SOAP, OAuth flows, webhooks vs polling, async vs sync trade-offs. Junior makes synchronous callouts from triggers; senior knows why that's blocked.
Documents non-obvious decisions: comments explain why, not what. Senior code has fewer but more meaningful comments.
Reads release notes: knows when new platform features (before-save flows, Pub/Sub API, LWS) eliminate old workarounds.
Owns the production behaviour: monitors error rates, debug logs, governor-limit consumption. Senior devs aren't surprised by their own production failures.
Says no to bad asks: "Can we do this in Apex?" "Yes, but we shouldn't because <reason>." Junior fulfils the brief; senior refines it.
Keeps the team safe: writes code others can read, modify, and test. No clever one-liners that nobody else understands.
A senior Apex developer's value is less about knowing more language features and more about consistently making decisions that age well.
