News for hackers. Stuff that matters.
Re:ES6 in Depth: Classes by dsp1234 on Friday July 24, 2015 @12:17AM (#9940084)
I don't know the author's intention specifically, but I generally use a pattern of:

1.) If a value read/write, then it's a property via getters/setters

2.) If a value is computed, then it's a function

Specific to this case, area is 'generally' a computed value of other attributes of a 'shape':

  c.radius() = 10 'Bad, overwrote the radius function
  
  c.area = 314.15 'Ok, radius is settable from just area. But doesn't match the area signature of other "shape"-like objects.
  
  let rect = new Rectangle(10, 30);
  c.area = 200 'Bad, which do we change, width or height?

There are no comments on this comment yet.