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
Anyone could develop using the standard import statements that import all public symbols from a module, and then run dfix over the source and have the imports modified to only specify the symbols actually pulled in. This is useful for those reading the source later because it's easy to tell exactly what was imported and from where, without having to go searching for which module it came from.
Another optimization would be to move the import inside a function if it's the only function that uses the import, ie scoped imports, which is already starting to be done in pieces in druntime/phobos. Of course, you could also chuck imports that are unused, which you've talked about listing with Dscanner before.
D provides a lot of power with these selective and scoped import constructs, but it's not easy to develop using them. Also, this feature added to dfix could go a long way towards untangling phobos.
The text was updated successfully, but these errors were encountered:
Anyone could develop using the standard import statements that import all public symbols from a module, and then run dfix over the source and have the imports modified to only specify the symbols actually pulled in. This is useful for those reading the source later because it's easy to tell exactly what was imported and from where, without having to go searching for which module it came from.
Another optimization would be to move the import inside a function if it's the only function that uses the import, ie scoped imports, which is already starting to be done in pieces in druntime/phobos. Of course, you could also chuck imports that are unused, which you've talked about listing with Dscanner before.
D provides a lot of power with these selective and scoped import constructs, but it's not easy to develop using them. Also, this feature added to dfix could go a long way towards untangling phobos.
The text was updated successfully, but these errors were encountered: