I wrote a lot about what I had difficulty with before and made several proposals on the feature request board.
After firing up PureBasic again this past week I tried to approach things as Fred had suggested:
viewtopic.php?p=524913#p524913
I won't reiterate the major problems faced by this approach but decided to give it a try with a new project. Then I realized that you can't nest modules.Fred wrote:The proper way to this is to use a 'Common' or 'Global' Module and use UseModule in module which needs it:
Code: Select all
DeclareModule Stuff_I_Need Structure SomeStruct a.i b.i c.i EndStructure EndDeclareModule Module Stuff_I_Need EndModule DeclareModule SomeModule UseModule Stuff_I_Need Define a.SomeStruct EndDeclareModule Module SomeModule EndModule
There seems to be a strong misconception that modules are like namespaces in other languages and the documentation even reflects this thought. But every time I try to use them as such I quickly realize that this is simply not the case.
All modules seem to do is shift scope up from global into modules and no further. Therefore if you decide to write an entire application with an emphasis on modularizing everything, it effectively becomes the same thing, just shifted up one scope with a tremendous amount of additional verbosity.
I want to use PureBasic more often. I really, really do. But it's just so painful to be constantly reminded of so many limitations like this which tarnish an otherwise beautiful language.