Kill the reuse-by-shared-name pattern
- Lingua principale
- Haskell
- Stelle
- 1.3k
- Fork
- 201
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript
- Ambito
- frontend
- Tipo di issue
- Refactoring
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100