The first best practice is understanding the environment you're working in, not blindly repeating lessons you have been taught.
I'm a Notes programmer. I have been for most of my career now. Back in the 90s, the documentation indicated that, when looping through documents in a view, the old document would be removed from memory.
I believed that and programmed accordingly until one day I was working on a database that had a really large amount of documents that I had to loop through. Somehow, my code was never able to get to the end. I debugged several times, thinking maybe there was a document corruption issue, but the code never failed on the same document. It was incomprehensible.
Until I had a thought : what if all these documents were still in memory and not being removed as I had been taught ? I toyed with that idea for a few minutes and then thought, what do I have to lose ? So I changed the loop structure to not just drop the previous document, but delete it from memory (not from the database, from memory). I tried my code again and it worked flawlessly.
Lesson learned : even official documentation can get it wrong sometimes.