Sometimes, so-called ‘context’ data structure is used to handling set of related information. And this context data tends to be required as parameter by various functions. Here is pros and cons.
– It is easy to handle lots of related data – data allocation and free etc.
– We can save costs of parameter passing; Passing context is enough.
– It is difficult to know which one is input and which one is output, because whole context is passed as parameter. This decrease readability very much.
– Usually, context is passed as parameter to lots of functions. So, just like ‘global’ data, it is very difficult to trace the value-change-history. That is, debugging/maintaining becomes difficult.
One good way to using context structure; Only very few modules can change/modify context data. And others only can read this one. Than, lot’s of issues in “Cons” can be overcome.