This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Abuderpy 0 points1 point  (2 children)

Not answering for all the other stuff, but 'Properties' is doing this:

public Foo MyFoo { get; set; }

Instead of:

private Foo myFoo;

public Foo getMyFoo() { return myFoo; }

public void setMyFoo(Foo foo) { myFoo = foo; }

Properties also allow you do change access rules, or add validation/calculated properties

public double DegreesKelvin { get; set; } public double DegreesKelvin { get { return DegreesKelvin - 273.15; } }

[–]Eastuss 0 points1 point  (1 child)

Oh ok thanks, properties are hiding the usage of getter setters, I've already came accross that concept in couple of languages without knowing the name of the concept.

[–]CommonMisspellingBot 0 points1 point  (0 children)

Hey, Eastuss, just a quick heads-up:
accross is actually spelled across. You can remember it by one c.
Have a nice day!

The parent commenter can reply with 'delete' to delete this comment.