|
|
|
|
|
by tremon
1114 days ago
|
|
not knowing whether it modifies an array created remotely or locally Yes, good language design allows the programmer to ignore details such as how an object was created or where it is stored. Having to remember something like that violates so many design principles. Why would a programmer using the array need to know how it was created? It just adds unnecessary complexity to the code, making the programmer's job harder than it needs to be. It's accidental complexity ossified in the programming language. |
|
While I am inclined to agree, this is the case for many languages. Python and JS for example IRC. When you receive a dictionary or an object as a function argument you have no write protection if you poke around inside of it. Perl makes it at least a bit more obvious.
In C++ you have constant reference signatures if you happen to use them but the syntax is also not exactly pretty.
In C you only may pass pointers to an array which is even done implicitly. No write protection either.