3 ms·
> Do y’all look at the import path at the top of a file to understand a function on line 450? It depends on the language, the editor, and the development proce
by 015a 4y ago
> Do y’all look at the import path at the top of a file to understand a function on line 450?
It depends on the language, the editor, and the development process. There's no one-size-fits-all solution.
Regardless of all of that: code files are near their peak productivity when they can fit on-screen without scrolling, and when you can put all that aside and just immediately move your eyes from the token to the import path. And they're even closer to the peak when you can combine that with encoded contextual information about the import path (which is generally a reflection of what the token does) into the token itself; via, say, import aliasing or importing the module and accessing the token as a property on that imported module.
The reality that we have thousand-line source files obviously isn't ideal. No one who has ever worked with one would say "this is the way the world should be". But, they exist, and thus we have tools like Intellisense to make them manageable, and they'd definitely be less comprehensible without those tools. That doesn't make the whole situation ideal, when talking in hypotheticals. We shouldn't admit defeat to the God of Complexity by saying, even in this small corner of good practices, "well, the comprehensibility of the import path doesn't matter because we gave up on making anything comprehensible a long time ago."
> They’re pretty great these days, in my experience.
I don't mean that they don't work in the sense that they don't produce compileable import paths. Though this is true in some languages, or some projects with bespoke configuration systems, or in some editors.
I mean that they don't work because they don't oftentimes produce comprehensible import paths.
- lelandfe 4y ago> The reality that we have thousand-line source files obviously isn't ideal Cut that number by 2/3 and the situation is the same, right? How often are you working on files where the entirety of them fit on screen at all times… > well, the comprehensibility of the import path doesn't matter because we gave up on making anything comprehensible a long time ago I think they don’t matter because even modest complexity produces this situation. This isn’t a hypothetical, it’s the far reaching majority of real, practical code.