19
Mitiko
7y

Who wrote this??????Oh.... It's me

Comments
  • 3
    I would have understood the reasoning if it said "private set", thus limiting the ways in which you're able to modify the score.
    But this? This is just silly
  • 1
    @ElectricCoffee
    Probably be good to have a private variable too!

    I just love the API of this class is Face.Increase(), Face.Decrease() & Face.Reset()
  • 2
    @linux-colonel what would you need a private variable for this though? Having a private setter in the property should be enough
  • 1
    @ElectricCoffee
    Ah, I'm not too familiar with c#. I assumed 'public static int score' was a public variable.
  • 5
    @linux-colonel no, the {get; set} makes it an automatic property, i.e. a private variable with automatically generated getter and setter methods

    You can make them explicitly private or protected by slotting in keywords between the brackets
  • 2
    @ElectricCoffee
    Good to know! Appreciate the lesson :)
Add Comment