Kill the reuse-by-shared-name pattern
- Vorherrschende Sprache
- Haskell
- Sterne
- 1.3k
- Forks
- 201
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
There are several places where JavaScript code relies on the pattern of calling a function, and assuming that some other referenced JavaScript will define it. For example, `clearCode` and `updateUI` and `compile` are defined separately in codeworld.js and funblocks.js, and which one is called depends on which JavaScript code is loaded into the containing page.
That's an awful pattern. Code should be reorganized so that dependencies are passed in to the relevant functions, not picked up from the global namespace.
See #66
Beitragsleitfaden
Rechercherichtung
Start by reading the shared-name uses of clearCode, updateUI, and compile in codeworld.js and funblocks.js, then review the related discussion in #66. Reorganize the functions so dependencies are passed explicitly rather than resolved through the global namespace; done means these functions no longer rely on same-named definitions from whichever JavaScript the page loads.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- frontend
- Issue-Typ
- Refactoring
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100