Better Apex.
One good pattern
at a time.
Practical tips, clear examples, and a little more confidence in the code you ship.
Explore the articles// A little structure goes a long way.
Set<Id> accountIds = new Set<Id>();
for (Contact person : Trigger.new) {
accountIds.add(person.AccountId);
}
// Query once. Work with the whole set.
Map<Id, Account> accounts = new Map<Id, Account>([
SELECT Id, Name FROM Account
WHERE Id IN :accountIds
WITH USER_MODE
]);Think in collections.
Your future self will thank you.
A few ideas worth keeping.
Start with a topic.
Leave with something useful.
Think in collections. Write bulk-safe Apex.
A small shift in how you query, loop, and save can make your code ready for more than a single record.
Make your Apex permissions explicit.
Sharing, object permissions, and field access answer different questions. Make each choice visible in your code.
Write tests that tell you what broke.
Use deliberate fixtures, a focused execution window, and assertions that explain the behavior you care about.
Give your Queueable jobs a clear purpose.
Pass a bounded set of IDs, make the work repeatable, and keep the job ID so you can follow what happened.
No notes match that search. Try a different word or choose All articles.
Good code starts
with a good question.
What happens with 200 records? Which permissions apply? What would make this test fail? We work through the small questions that lead to more thoughtful Apex.
Learn the reason behind the pattern.
Short articles that explain the decision, alongside the code.
Try it in a practice org.
Teaching examples, with context and edge cases to explore.
Go straight to the source.
Official Salesforce references for a deeper understanding.