[Gambas-user] C like #include for Gambas

Jussi Lahtinen jussi.lahtinen at ...626...
Mon Jun 11 19:38:29 CEST 2012


> As I see it include is a pre-processing directive. It simply replaces the
> #include statement with
> the contents of an external file. This is a project management
> consideration and not a programming paradigm i.e. OOP, Functional,
> Procedural, etc..


I agree, but I think with OOP, C style #include is obsolete management
choice.



The include statement in C/C++ was intended to allow
> libraries of code to be pulled into the current project.


Here is the main point.
In Gambas we already have Extern, Export etc commands for external
libraries,
whether they are written with Gambas, C or whatever.




> Allowing the developer to split a large project up into smaller, more
> manageable files.
>

With OOP I don't think you need to do that with files, you do it with
classes.
But maybe someone want to write code with non-OO style.




> Contrast this to Ada's use of packages.
>

I don't know Ada, so I cannot say anything it being useful in Gambas.



As for includes, I think this could be a useful tool for some but wonder
> why simply refactoring the program into
> more manageable class' wouldn't give a better solution. IMHO, doing so
> would make the project more maintainable over the long haul....
>

I agree.



Jussi



More information about the User mailing list