Answer the question
In order to leave comments, you need to log in
Are input and output parameters in the function body OK?
Although my field is PLC programming, but the question is "universal".
At the new place, I began to look at the texts of the programs and already timidly raised the question, but they told me - what's the matter, everything is fine.
I'll ask you too.
There are certain functions that are called in the program, functions have input, output (returned, input-output), internal variables... Well, sort of like in normal programming.
So, I have always believed that a function should only work with the variables that it received and return values to those that are written outside.
I immediately see that once in the text of the function there is a call immediately directly to global variables and everything protests in me.
Who is right, is it written somewhere that this style is bad?
Answer the question
In order to leave comments, you need to log in
there is an appeal immediately directly to the global variables and everything protests in me.
I repeat once again, maybe not everyone is watching in the comments:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question