Closed eeue56 closed 8 years ago
I will work on my solution to this problem.
FWIW, browser support is not a valid concern to close this PR. Every modern browser supports get functions - more than support webgl, including mobile. So, that's an invalid concern.
Compare this:
https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API
with this:
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/get
Notice that webgl does not work on a lot of platforms, whereas the getter style in this PR are supported on every platform. Browser support is a strawman argument.
@eeue56 if WebGL is not supported, then the library should render a div. But if the browser cannot parse the source code, it will break the whole application.
Browser support was not the only concern.
@w0rm Elm does not support IE 8 anyway, so again, it's not a valid concern.
But yeah - other approaches are fine. I'm just saying that browser support is not a valid concern, and that you shouldn't be afraid of getters.
@eeue56 sorry for being conservative here. I really care about the library, and I want to avoid silly things like this:
@eeue56 thanks for the proposal, I'm still thinking that having simple getter functions is less error prone because it allows to find undefined functions, and allows to track the dead code with the current
.eslint
setup.Also, even if we don't really support ie8, it's still good to not break its parser with the js code that contains
get
keywords.