3 ms·
On that note, I’m of the opinion that source code should by default be ordered from high level to low level, e.g. calling functions before called functions with
by layer8 5y ago
On that note, I’m of the opinion that source code should by default be ordered from high level to low level, e.g. calling functions before called functions within any given source file. More generally, the source code order should generally be close to a topological sort of its dependency structure. Of course, the programming language has to accommodate that, and many don’t (C is particularly bad). That approach would also imply for includes/imports to come last in the source code. Unfortunately most (all?) programming languages require them to come first.
- tlarkworthy 5y agoObservable is execution in topological sort order https://observablehq.com/@observablehq/how-observable-runs https://observablehq.com/@observablehq/how-observable-runs You can totally put imports at the bottom!