The method used by such people as Tom Christiansen to avoid importing names by default, is to avoid use of the default export mechanism altogether. Import the names you need, or else live with the chance that too many names are imported.
Re: inlined comments do not describe code flow, I mean that the comments do not provide me additional insight into understanding the code flow. It may be that adjusting the indenting scheme to use a more common strategy would drastically reduce the apparent complexity. My opinion is only based on the fact that I am accustomed to reading code, and I could not easily follow your code. This may mean that your code is too advanced for me, or it may mean that your code is difficult to read. Take it how you wish. I tried to find your problem, and I became lost.
| [reply] |
I still don't know what you mean by "code flow". if statements, while statements, etc. mean what they mean and don't need further explaination except to the youngest novice: we know how program execution "flows".
My indenting is 3 spaces per level, which I think is a median value (2 to 4 is common, 8 rare but sometimes seen), and subordinate stuff is indented relative to the controlling line, which is also normal enough. So I don't know what you find "extremely odd".
I do find that it's easy to become lost, and I think that's because of the meta-ness involved. That is, function there actually generate the functions that are then called. And, the same mechanism that generates the export for the Module is the one that the Module subsequently uses to export its stuff to the Client, so thinking about "the module", "the symbol", etc. makes one forget which role one is in. I'm trying to overcome that by careful and consistent nominclature.
—John
| [reply] |
In terms of indenting -- Nobody that I know of indents the '{' on a line by itself after 'sub name'. This is one example.
If the author finds himself easily lost, it is no wonder that others trying to understand the code would become lost. My claim is that I suspect a simpler, and more straight-forward implementation is possible, and also that the feature being provided, can be provided in simpler, and more straight-forwards ways.
Consider this: You have a problem in your code that you are not able to solve, and at least three other people find difficult to come close to knowing where to look. I believe this is a very obvious hint.
| [reply] |