In essence I often find when building GUI's that large amounts of my code are replicated and therefore I try to write functions which can be used multiple times.
An example of this are when I have multiple sliders with corresponding edit boxes where changing the value in one updates the other. I found the concisest way of writing the function was to pass the entire GUI handles structure to the function with a reference to which slider / edit pair I wanted to update.
However does passing a large number of variables (within the handles structure) that are essentially unused dramatically increase the execution time of the function / is it considered bad practice?
Appreciate this is a very general broad question with lots of different cases and therefore probably difficult to answer so thanks in advance 🙂
Best Answer