H
H
herr_kaizer2016-08-03 14:19:59
Programming
herr_kaizer, 2016-08-03 14:19:59

Create an intermediate variable or pass an argument from function to function?

I am writing an application for quantizing images while learning C#.
Now I have a static controller class that has a public method that takes an array (representing an image) and passes it to a private method, which in turn does something with that array and passes it to the next private method , and so on (in total, such a transfer occurs 5 times).
So, the question arose, how best to do it: leave everything as it is (pass an array from method to method) or is it worth creating an intermediate list (List) in a static class, and manipulating data already in it? What does OOP say about this and how will it affect performance? And if the array is passed strictly by reference through ref?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan, 2016-08-03
@herr_kaizer

It really doesn't matter that much. From the point of view of OOP, it would be logical to declare a private variable inside the class.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question