Get and Set difference

What’s the difference between doing this

public byte getCurrentMoves(){
	return currentMoves;
public void setCurrentMoves(byte info){
	currentMoves = info;

And doing this?

public byte CurrentMoves {
    get { return currentMoves; }
    set { currentMoves = value; }

Besides length of code, why is or isn’t the second way better?

The second method lets you make a property that looks like a variable:

  CurrentMoves = 1; //Calls the set method
  print(CurrentMoves); //Calls the get method

Obviously the first way is more wordy and doesn’t look like a normal field:


The difference between methods and properties, is just to the programmers, methods mean actions, while properties mean… well, properties, a description or feature of something.
to your immediate example would be like getCurrentMoves() would mean, getting the info of the variable currentMoves, and setCurrentMoves would mean, setting the bytes to currentMoves variable, which does not feels quite right, on the other hand, if you use it as a property (which could be just public byte CurrentMoves{get;set;}), it implies that you will get and set values to the CurrentMoves property. I think i could not explain myself well enough, but hope you get something from my explanation