Hi.
As an old habit, I never declare my Subs as Private in any modules. I was wondering if it would be professionally wrong when I'm the only one working with the code.
I feel careless for making all subs public, but it causes no conflicts in the code, I'm sure.
Would declaring them as Private imply any difference besides its accessibility? Because if it does, I would feel obliged to fix my code.
Thanks a lot in advance.
For what it's worth, I do the opposite: I declare everything private - as a way to help me maintain a higher level of separation between different parts of the code.
(I have a history of creating glorious balls of spaghetti code where things call each other all over the place. Insanity ensued, but I prevailed and came out on the other side with a desire to keep things separated and have them interact cleanly instead.)
Yes, it is a mistake. It makes the code more difficult to maintain. When you see a private sub you immediately know that it can only be called from the current module so it is easier to know what will be affected by changes to this sub.
Thanks. I'll start making things private. There are a lot of subs, so thank God for the IDE's Find/Replace feature!
Fortunately, I didn't make the same mistake with process variables!