I was reviewing some VBA code someone else wrote recently. I always like to see how other people approach and solve development problems. I find that reviewing other devs code helps me think more deeply about the stuff I write.
One thing I have noticed in my code is that I rarely use
do ... while/until or
do while/until ... loop
(looping recordsets is one use, no others spring easily to mind)
I almost exclusively use
For... next and
For each ... next
for all looping.
Don’t know if its force of habit, defensive programming (I like to find the end and check its reasonable before looping to it), just the type of stuff I do in VBA, or maybe just lack of imagination.
What do you do?
Do you find yourself tending to repeat the same mini designs?
do you have a preference?