I will start with the int part. int is the type of value, and in .Net means that you are really dealing with a copy. This is a really strange constructive restriction to say the method "You may have a copy of this value. This is your copy, not mine, I will not see it again, but you cannot change the copy." The method call implies that copying this value is OK, otherwise we could not safely call this method. If the method requires the original, leave it to the developer to make a copy to save it. Either give the method a value, or do not give the method a value. Do not go between them.
Go to reference types. Now this is a bit confusing. Do you mean a permalink where the link itself cannot be changed, or a completely locked immutable object? If the first, links in .Net are by default passed by value. That is, you get a copy of the certificate. Thus, we have essentially the same situation as for value types. If a developer needs a source link, they can save it themselves.
It just leaves us with a permanent (locked / unchanged) object. This may sound good in terms of runtime, but how should the compiler use it? Because properties and methods can have side effects, you should essentially be limited to read-only access. Such an object is unlikely to be very interesting.
Joel Coehoorn Feb 26 '10 at 2:23 2010-02-26 02:23
source share