the `using` keyword in ts is underrated for tests and scripts. temp files, db connections, child processes: cleanup runs when the scope ends, even when something throws.
no more try/finally pyramids
5
89
git log -S "name" finds the commit where a string appeared or disappeared.
way faster than blame when the line you're hunting for doesn't exist anymore
1
4
79
rust tip: put #[must_use] on your builder types.
forgetting .send() at the end of a chain turns into a compiler warning instead of a request that silently never happened
solana rpc tip: getProgramAccounts without filters is how you get rate limited.
dataSize + memcmp cut the scan server side, and dataSlice means you only download the bytes you actually read
1
85
when something works locally and fails in prod, i stopped guessing and started diffing: env vars, versions, region, flags. dump both sides to a file and diff them.
the answer is in that diff more often than in the code
1
50
ts tip: take readonly arrays in function params. readonly string[] instead of string[].
callers can pass either, and the function can't sort or push into an array it doesn't own. caught a sneaky in-place .sort() for me
3
46
question for devs using coding agents on a real codebase: do you review every diff line by line, or do you trust tests and only skim? i keep going back to line by line every time i try the other way
5
5
157
rust habit: newtype anything with a unit. struct Lamports(u64), struct Millis(u64).
the compiler then refuses to add seconds to milliseconds, which is a bug i'd rather never get to write
anchor tip: if an account might grow later, plan for realloc from day one. a version field plus spare space is cheap now and saves a painful migration of every existing account later
2
111
unpopular opinion: a well placed print statement still beats the debugger for most bugs i hit. the debugger shows one moment, a log shows the whole sequence, and the bug is almost always in the sequence
1
1
76
ts tip: brand your ids. type UserId = string & { __brand: "UserId" }.
zero runtime cost, and passing an order id where a user id goes stops compiling instead of quietly returning nothing
1
79
small thing that made agent work easier to review later: make it write the commit message before the code. if it can't say what the change is in one line, the change isn't clear yet
87
cargo tree -d is the fastest way i know to find out why a rust build got slow. two versions of the same big crate compiling side by side, usually pulled in by one dep that hasn't bumped yet
1
88
solana tip: "processed" is not "it happened". read your own write at processed and act on it, and sooner or later that slot gets skipped and your ui shows state that never existed.
confirmed for ux, finalized for anything that moves money
64
if a tokio service gets weirdly slow under load, grep for sync file io or heavy cpu work inside async fns first.
one blocking call on a worker thread stalls everything scheduled behind it. spawn_blocking exists for a reason
81
ts habit: treat every catch (e) as unknown and narrow it.
half the "cannot read properties of undefined" in error handlers i've hit came from assuming e.message exists when something threw a string
2
112
question for people running coding agents daily: what's the one rule in your agent instructions file that saved you the most pain? mine is "never edit a test to make it pass"
1
3
92
a flaky test that passes on rerun is still a failing test. it's just failing at a rate you haven't measured yet.
most of mine turned out to be shared state or a hidden dependency on test order
2
1
96
solana tip: store the pda bump in the account when you create it and pass it back in.
re-deriving with find_program_address on every call burns compute for an answer you already had
70










