You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current CodingGuide contains a few recommendations that may have to be updated.
One specific point that was discussed as part of a recent PR is whether the Coding Guide should contain a recommendation like
Don't use Array.push.apply() for large arrays. Use addAllToArray or the [...spread] syntax instead (Maybe with details about where the spread syntax should also be avoided...)
I looked at the the Coding Guide, thinking about where something like this might be added. But there are two and a half issues with that:
There are some plainly outdated statements in the Coding Guide
Some recommendations there are obsolete, because they already are enforced with linting rules
2½. The specific case of push.apply is already covered with a newly introduced linting rule
I think that very roughly speaking, the Coding Guide should not repeat things that are covered by the linter. (One could argue that it could explainwhy these rules exist, but that's a slippery slope, and might bloat it up to a point where nobody is reading it any more...)
Some preliminary points that I noticed and that might have to be updated accordingly, starting at the the Basic Code Construction section:
"Cesium uses JavaScript's strict mode, so each module (file) contains "use strict"
That's as wrong as it can be. No file contains this anymore 🙂
I strongly disagree here. I always considered these file-scoped, free-floating functions to be obscure, and I'm sure that they now will make a clean transition to Use ES6 "class" as module syntax #8359 much, much harder...
The text was updated successfully, but these errors were encountered:
The current
CodingGuide
contains a few recommendations that may have to be updated.One specific point that was discussed as part of a recent PR is whether the Coding Guide should contain a recommendation like
I looked at the the Coding Guide, thinking about where something like this might be added. But there are two and a half issues with that:
2½. The specific case of
push.apply
is already covered with a newly introduced linting ruleI think that very roughly speaking, the Coding Guide should not repeat things that are covered by the linter. (One could argue that it could explain why these rules exist, but that's a slippery slope, and might bloat it up to a point where nobody is reading it any more...)
Some preliminary points that I noticed and that might have to be updated accordingly, starting at the the Basic Code Construction section:
"use strict"
push.apply
-to-[...spread]
(with caveats) might fit here...Some further (potential) updates are connected to open issues or pending PRs - just a quick summary:
The text was updated successfully, but these errors were encountered: