Guide lines on using a module vs local code?

Hi guys…
Is there a guide line on using a Module, or I think that’s what it is called as in old VB instead of coding all the time at the local level such as in several buttons that do the same thing on several forms for instance. Is it better to have the same code refered to in a module and using that code on each button that does the same thing on several forms? This might be a terrible example, but all I could think of off the top of my head. I had an old boss in the 9o’s that used loads of code in modules in VB 5 and 6 which It thought used more RAM for the user since the code is always in memory? This guy though wrote some huge programs in VB. Used many DLL’s, etc… I didn’t quite understand the docs for xojo as far as guide lines, except it basically said to be careful. I thought maybe someone had a more concrete guide line?
Thanks
Tim

you might - but I would separate the “business logic” out from the UI code as best as you can
that way changing the UI isn’t such a choise if no business logic changes

HOWEVER DO NOT try to write VB in Xojo
I see a lot of people try to do this and it makes a horrible mess
While the two are similar they are not the same and trying to do things in Xojo that were common in VB - like DoEvents - will give you no end of grief

Read Robert Martin’s “Clean Code”.