Closed AtiX closed 8 years ago
I'm not sure I understand. Is your claim that we promote a bad style of coding in our Readme?
Yes, "bad style" because code will break in unexpected ways when using the style used in the README. I've written a small example here.
Second point: @property is only recognized using the style above - so only when done wrong. A better alternative is to declare properties in constructor, so it would be good to parse the @property tag in the constructor.
I think you don't really understand prototype inheritance and how Coffee interacts with it. The property will not have the same value across all instances. It will prototypically override the value on the level of class object. You are missing it with static invocation badly. So this is no way a bad practice to start with.
But anyway. There was almost 2 years since I last time answered something similar before so let me be a bit more explicit. What you suggest us is to drop reasonable, straightforward and very well specified syntax and replace it with what? Reading the mind of a developer? Do you realize how many ways there exist to define a property? So even if we forget the wrong syntax
claim and go straight to rational core of adding more possible syntaxes... Oops, we can't. Sorry.
see coffeescript cookbook
nicknames
can be accessed by using@nicknames
in every instance, but will have the same value for all instances(!). This style of defining properties only works for primitives.My suggestions:
@property
in constructor as well.