[Gambas-user] C like #include for Gambas

jm joem at ...2671...
Tue Jun 12 16:30:32 CEST 2012


On Tue, 2012-06-12 at 13:41 +0200, Benoît Minisini wrote:
> Le 12/06/2012 13:01, jm a écrit :
> > On Tue, 2012-06-12 at 12:03 +0200, Rolf-Werner Eilert wrote:
> >>> You already have at your disposal a program which fully understands
> >>> what to do with #include (and all the other pre-processor directives
> >>> which have been mentioned). Have you tried it out yet?
> >>>
> >>
> >> Is it possible to insert the C pre-processor into the Play-Button
> >> function of the Gambas IDE, maybe the way you can insert filters into
> >> kprinter? That would be ideal here.
> >>
> >> Just an idea... :-)
> >>
> >> Rolf
> >
> > Wow!
> >
> > Thinking about it, that is even more powerful to cooperate
> > with external preprocessor than just adding preprocesor functionality on
> > its own.
> >
> > A simple check box in project properties dialog box to enable/disable
> > preprocessing can turn the feature on/off. Some programs you may just
> > not want to allow preprocessing and so checking it off here will allow
> > the compiler to complain bitterly to go get it fixed.
> >
> 
> Hi,
> 
> Sorry if I disappoint you, but I'm strongly against any preprocessing 
> feature in Gambas.
> 
> I'm talking about code subsitution, not the features currently 
> implemented in the Gambas compiler, that just allow compiling one part 
> of the code or another.
> 
> Why ?
> 
> Preprocessing is mainly used (in C) for the three following reasons:
> 
> 1) Function and variable declaration.
> 2) Writing the same repeating pattern once.
> 3) Writing generic functions.
> 
> In interpreted OO languages, and especially in Gambas, these features 
> are not needed:
> 
> 1) Function and variable declaration are done automatically by the compiler.
> 2) OO has inheritance.
> 3) There is no templates (or 'generic') in Gambas as in Java. But you 
> have the Variant datatype.
> 
> Moreover, preprocessing makes programs mostly unreadable, can create 
> very difficult bugs, make the source code impossible to analyze (bye-bye 
> automatic completion...), and so on.
> 
> Developing a program is 20% writing it and 80% debugging it. So 
> preprocessing makes that worse.
> 
> If you need preprocessing in your project, then I think there is a 
> fundamental design flaw in it. I have never need it when writing any big 
> Gambas project.
> 
> Regards,


I take it that is a definite no then? :-)

If I'm really under pressure, then I'm sure I can go
write a lite preprocessor as needed and manage.

Any chance of exporting IDE's highlighted code as colorful HTML
for documentation purposes?

Thank you, best regards.



______________________________________________________________________________
This message has been checked for viruses and spam by Corpex using
the ArmourPlate Anti Virus and Anti Spam Scanning Service.
To find out more and see our email archiving service see
http://www.armourplate.com or call Corpex on UK 0845 050 1898.




More information about the User mailing list