Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does 'fidelity' of accessor keywords mean?

I'm reading through .Net Docs and i came across this term "fidelity",

Type safety is also used to help enforce encapsulation by guaranteeing the fidelity of the accessor keywords.

What does it mean (in relation to accessor keywords)?

like image 854
chakmeshma Avatar asked Jul 18 '19 15:07

chakmeshma


1 Answers

Sigh.

There is simply too much documentation and not enough time for the development team to review it for accuracy in jargon. This overview is a mess of small errors and confusing, non-standard jargon usages.

The paragraph in question is:

Type safety is also used to help enforce encapsulation by guaranteeing the fidelity of the accessor keywords. Accessor keywords are artifacts which control access to members of a given type by other code. These are usually used for various kinds of data within a type that are used to manage its behavior.

Yuck. So much wrong here. "accessor keyword" should be "accessibility level". "Other code" is confusing; "other code" means code which is other than what exactly? Accessibility modifiers control access to members everywhere, not just in "other code". Why are we talking about members and then suddenly switching to data? What does "manage behaviour" mean?

Let's rephrase using standard C# jargon.

Static type checking helps enforce encapsulation by ensuring that a program respects the accessibility levels declared by a member of a type. For example, if type Dog has a private member mother, then static type checking helps ensure that attempts to access that member from code outside the Dog class will be prevented.

Fixing all the rest of the crazy mistakes in this document is left as an exercise to the reader. For example, what's wrong with this code sample?

Dog dog = AnimalShelter.AdoptDog(); // Returns a Dog type.
Pet pet = (Pet)dog; // Dog derives from Pet.
pet.ActCute();
Car car = (Car)dog; // Will throw - no relationship between Car and Dog.
object temp = (object)dog; // Legal - a Dog is an object.
like image 131
Eric Lippert Avatar answered Nov 15 '22 23:11

Eric Lippert