trilife:
So I take it my passing variables is the right habit to develop.
Out of curiosity, which method is more memory efficient, both RAM and ROM?
I've been using the same name of variable inside the function as the one I'm passing. Is this safe, or will to bite me in the rear in the future...
It depends. Generally, it's best to minimize the number of globals you use wherever possible; when you have a bug that involves one of them, your search space to find the problem is the entire program. Better if it's a smaller area.
However, Arduino programs are usually not huge and the people writing them aren't software engineers, neither are they interested in becoming one. So globals can get the job done, even if it isn't the best way.
For memory efficiency, globals are likely consuming less memory. Unless you're writing recursive stuff though, the difference probably doesn't overcome the advantages of parameters.
Don't use the same name in your function parameters as the variables you pass. It's legal and won't do any harm until you make a typo and create a subtle bug where you pass one thing but use another. It's just another one of those things that can cause you hours of unnecessary debugging.
A function is supposed to be self contained, do a well defined job and be reusable for multiple inputs. If it touches a global, it might manage 1 and 2, but 3 is questionable.
The point is that the software engineering discipline is stuffed full of practices that help you avoid shooting yourself in the foot. Most of them were discovered when someone did exactly that. You don't have to use any of those practices, but the bigger your program gets, the more likely it is that you'll be glad you did. Passing parameters is just one of those practices.