Jump to content

Should Au3Check Count Global Variables Declared Inside Functions?


TheDcoder
 Share

Recommended Posts

Ughh! Don't use global variables unless you have a really good reason to do so: that's my 2c. There are alternatives, such as using Static and hard coded assignments within functions. It's often much cleaner to fetch data rather than having to deal with all these strange issues.

Link to comment
Share on other sites

3 hours ago, czardas said:

I tend to pass GUI IDs (or arrays of controls) to various functions - often ByRef. Although I see the temptation to use globals in this case.

This approach, invest effort on avoiding globals is outcome of fear that it would be difficult to manage the software  (I assume).

But you have to pay attention to a certain point

in order to have a system that can grow and be more complex & dynamic  more easily , It need to know about itself.. the human brain for example is such a system and probably uses a lot of global variables.. Probably more than 80% are globals.. 

Avoid globlas is also potentially and in theory is - limit the maximum  potential complexity of the system (and I mean to what the system can do and how many features it have..)

Edited by Guest
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...