Reputation: 133
The problem is that I've declared all my variables as public and simultaneously I'm passing those to subroutines. Which solution is better and what are the differences? BR Michał
Upvotes: 1
Views: 59
Reputation: 198
The difference:
Try to avoid using public variables whereever you can. They might seem like the easy way out but can cause alot of problems the longer the code gets, use up unnecessary memory space and make the code structure quite confusing.
Passing values to a subfunction or -routine is usually the more elegant way and good coding practise.
Upvotes: 1