Re:Sigils are an underappreciated programming technology
by G3rn0ti on Tuesday May 30, 2023 @11:40AM
(#36126144)
> Having to remember something like that violates so many design principles.
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 at least makes it 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.
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.