Good practice: change only functional parameters?

Say I'm developing a complex application. Within the member functions of an object, should I change only those objects that are passed to the member functions as parameters, or can I access and change any other objects that I have access to (for example, public or static objects)?

Technically, I know that everything that I have access to can be changed. I ask for best practice .

Sometimes it is difficult to pass an argument that I will receive and modify, especially if I know that the member function of the object will not be used by anyone other than me. Thank.

+3
source share
2 answers

( , , ), , , . (static ). : .

++ const, ( ), .

A const , , , const , .

, ... , const const .

+6

-, - - , - , . .

, , -, , ; - , , -.

+2

Source: https://habr.com/ru/post/1794171/


All Articles