It is still read-only.

Closed due to the fact that it is necessary to reformulate the question so that it was possible to give an objectively correct answer by the participants of Kromster , Pavel Mayorov , Olter , Vladimir Martyanov , aleksandr barakin July 29, '15 at 11:10 .

The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    there would be a method - would be GetResult - KoVadim

2 answers 2

You have some strange understanding of what a property is (let's leave behind the scenes here the fact that, in fact, properties are methods). Properties can be very read-only, it is quite normal practice. Moreover, what sense would it be to make it a method if it takes no parameters and returns the same result each time? This behavior is typical for the field (or for properties that "intuitively" look like fields).

If we talk about the properties that should be methods, then a good candidate for the role of a method is DateTime.Now. It returns different values ​​each time, and this can be confusing, why it would be more correct to make it a method.

  • I am just learning C # after the heat, so I’ll ask you not to kick much :) For the method, it is obvious that it calls the code. A property can return an existing variable, or it can do something more. Or is there a lazy property and the result is cached? So it seems no. - Smit Johnth
  • > A property can return an existing variable, or it can do something more. um ... well, so what? what is the contradiction? - DreamChild pm
  • What is the difference between a method and a property in c #? - Smit Johnth
  • @SmitJohnth properties are the same methods that are syntactic sugar that looks like fields. And therefore they act as fields, and not as methods - DreamChild pm

Because it wanted to developers.

  • And why did they want so? - Smit Johnth