variable declaration....where should I declare them?
I've been declaring all of my variables on the top part of my class. I'm just wondering if it's a bad practice to declare some of the variables in the middle of the class?
Some of the variables in my class are only used for a few functions. Is it bad to group all the functions and those variables in a region? or should I declare all the variables in the class in one place? (I know it doesnt make a difference in functionality of the app, but I'm just wondering if it's considered a "bad habit" or not :D)
Re: variable declaration....where should I declare them?
Quote:
Originally posted by MrPolite
I've been declaring all of my variables on the top part of my class. I'm just wondering if it's a bad practice to declare some of the variables in the middle of the class?
Some of the variables in my class are only used for a few functions. Is it bad to group all the functions and those variables in a region? or should I declare all the variables in the class in one place? (I know it doesnt make a difference in functionality of the app, but I'm just wondering if it's considered a "bad habit" or not :D)
I dont think it really matters, just as long as your code is efficient and easy to read!