Unwrap errors type-safely with errors.AsType (Go 1.26)
GOerrors.AsType[E] (Go 1.26) is a generic, type-safe version of errors.As. It returns the matched error and a boolean ins…
Sandbox filesystem access to a directory with os.Root (Go 1.24)
GOos.Root (Go 1.24) confines all file operations to a directory: Open, Create, Stat, and friends resolve relative to the…
Write custom iterators with range-over-func (Go 1.23+)
GOGo 1.23 lets functions of type iter.Seq[V] be consumed by for range. You return a function that calls yield for each el…
Use b.Loop() for accurate benchmarks (Go 1.24)
GOb.Loop() (Go 1.24) is the new benchmark loop. Beyond being cleaner than for i := 0; i < b.N; i++, it keeps setup outsid…
Track tool dependencies in go.mod with tool directives (Go 1.24)
GOGo 1.24 tracks executable dependencies with tool directives in go.mod, retiring the old tools.go blank-import hack. go…
Attach request-scoped metadata with the Context facade so it flows into logs and jobs
LARAVELThe Context facade (Laravel 11+) stores key/value data for the current request that's automatically added to every log…
Turn N+1 queries into errors in development with preventLazyLoading()
LARAVELCalled in a service provider, this throws a LazyLoadingViolationException whenever a relation is accessed without being…
Lock down outbound HTTP in tests with preventStrayRequests()
LARAVELHttp::fake() alone lets un-matched requests fall through to the real network, which makes tests flaky and slow and can…
Auto-delete stale records with the Prunable trait instead of a custom command
LARAVELAdd Prunable and a prunable() query, and model:prune (scheduled) deletes matching rows in chunks — no bespoke cleanup c…
Use whenLoaded() in API resources to avoid firing queries during serialization
LARAVELReferencing $this->posts directly in a resource lazy-loads the relation for every model when it wasn't eager-loaded — a…
Throw IntrinsicException for expected errors to skip Nest's auto-logger
NESTJSNestJS 11 added IntrinsicException: throwing it bypasses the framework's automatic error logging while still propagatin…
Validate and convert date query params at the boundary with ParseDatePipe
NESTJSNestJS 11 ships ParseDatePipe, which validates an incoming date string and hands your handler a real Date. Parsing date…
Skip the HTTP layer for workers and CLI with createApplicationContext()
NESTJScreateApplicationContext() boots the DI container without starting an HTTP server. For cron jobs, queue consumers, and…
Keep the SWC builder (default in Nest 11) for ~20x faster builds
NESTJSNest 11 defaults to the Rust-based SWC compiler, which is dramatically faster than tsc for builds and dev restarts. SWC…
Configure a strict global ValidationPipe to strip unknown fields and coerce DTOs
NESTJSwhitelist: true removes any property not declared with a validation decorator — your defense against mass-assignment, s…
Prefer asymmetric visibility over readonly when a class mutates its own state
PHPpublic private(set) (PHP 8.4) makes a property readable from anywhere but writable only inside the class. readonly forb…
Chain methods directly off constructors in PHP 8.4
PHPPHP 8.4 allows new Foo()->method() without wrapping the instantiation in parentheses. It's a small ergonomic win that r…
Add #[\Override] in PHP 8.3 to catch broken method overrides at compile time
PHP#[\Override] (PHP 8.3) tells the engine you intend to override a parent or interface method. If no matching method exis…
Use property hooks in PHP 8.4 to compute and validate without getter methods
PHPPHP 8.4 lets a property define get/set hooks inline, so computed and validated values no longer need a separate method…
Type your class constants in PHP 8.3 to lock the contract across subclasses
PHPPHP 8.3 added type declarations for class, interface, and enum constants. Without a type, a subclass could override a c…
Pass inline async handlers with async closures and the AsyncFn traits (Rust 1.85)
RUSTRust 1.85 stabilized async closures (async || { ... }) and the AsyncFn/AsyncFnMut/AsyncFnOnce traits. These let higher-…
Use native async fn in traits and drop the async-trait crate
RUSTSince Rust 1.75, async fn works directly in traits (via return-position impl Trait), giving you static dispatch with ze…
Flatten guard clauses with let ... else
RUSTlet ... else binds a pattern or diverges — the else block must return, break, continue, or panic, so control flow leave…
Future-proof public types with
RUST#[non_exhaustive] on a public enum or struct forces downstream crates to include a wildcard arm when matching, and bloc…
Control impl Trait lifetime capture precisely with use<> (Rust 2024)
RUSTIn the Rust 2024 edition, return-position impl Trait captures every in-scope generic and lifetime by default. That's us…