Setting delays programmatically within Apex represents a unique challenge. We don't have access to the current thread instructions that are being carried out, nor do we have any kind of higher-level `delay` function. While this is frequently fine for internal usage, where the last thing you would want is for your compiled code to be slow, that's not always the case when interacting with external APIs. It's common for APIs to be 'rate-limited' - go over the number of requests you're supposed t...| www.jamessimone.net
Identifying areas for potential code reuse is not always obvious. People learn and remember things in different ways; on a large team, and in a large project, keeping the entirety of a code base in your head is frequently an improbable proposition. Some manage. Some find themselves rewriting functions monotonously, either on a tight sprint deadline or simply because it’s easier to copy paste than it is to generalize. Refactoring is, ultimately, a luxury - but one that is worthwhile to inves...| www.jamessimone.net
The Singleton pattern is frequently used to represent objects that should only be initialized once; either because in being constructed, they feature CPU intensive operations, or because they revolve around atomic operations (like logging a specific time) that should always be referenced consistently. Learn how to improve upon the idiomatic Apex singleton pattern in Salesforce to reap performance benefits and save lines of code at the same time!| www.jamessimone.net