Thank you Jussi.

That is just fantastic example that I intend to use for new projects.

The point I am trying to make should not have to become an OO v non-OO
programming debate.

The broadest difference is that #include and its cousins (#define,
#undefine, #ifdef, #ifndef, #endif) are to do with preprocessing before
a program runs.

I cover the argument in next post to Bruce.




On Sat, 2012-06-09 at 18:27 +0300, Jussi Lahtinen wrote:
> OK, while that solution might work, it sucks.
> Instead see new attachment (IncludeProblem-2.0.tar.gz).
> 
> Jussi
> 
> 
> 
> On 9 June 2012 16:57, Jussi Lahtinen <jussi.lahti...@gmail.com> wrote:
> 
> > Thinking more closely your problem, I think I know what you need.
> >
> > You try to avoid writing *many* lines like this;
> > sParameterNameArray = NEW String[MAXIMUM_CSV_PARAMETERS]
> >
> > That is caused by broken object design, usually because you need to use
> > old code which had different approach than OO.
> > I have had same problems.
> >
> > I attached my suggestion how to implement this
> > (IncludeProblem-0.0.1.tar.gz).
> > Is it working solution?
> >
> > Jussi
> >
> >
> >
> >
> >
> >
> > On 9 June 2012 16:18, Jussi Lahtinen <jussi.lahti...@gmail.com> wrote:
> >
> >>
> >> C thrives on #include without showing signs of design problems.
> >>>
> >>
> >> Yes, I know, I wasn't talking about C, I was talking about object
> >> oriented language, Gambas.
> >>
> >>
> >>
> >>
> >>> Tens of thousands of external lines of code can be pulled in with
> >>> a dozen #include statements, leaving the code completely manageable,
> >>> readable and a lot more powerful than any other competing method.
> >>>
> >>
> >> Yes, but you use #include with libraries, not with programs that aren't
> >> designed for that.
> >> Or you have design problem.
> >>
> >>
> >>
> >> For example, in module_a.module you might have
> >>>
> >>>    ...
> >>>
> >>>
> >>> and in a file called initialise_csv_variables.include it would contain:
> >>>
> >>>  PRIVATE WordMarker1 AS Integer
> >>>  :
> >>>  '200 further variable declarations and initialisations
> >>>  :
> >>>  PRIVATE sParameterNameArray AS NEW String[MAXIMUM_CSV_PARAMETERS]
> >>>  PRIVATE sParameterValueArray AS NEW String[MAXIMUM_CSV_PARAMETERS]
> >>>
> >>> The #include files can contain any amount of well trodden
> >>> proven gambas code which is maintained in only one file.
> >>>
> >>
> >> So, basically you would add module/class called initialise_csv_variables,
> >> and you use that module/class in modules a and b.
> >>
> >>
> >>
> >>
> >>> I will argue that adding C like #include functionality saves a ton of
> >>> work in mega programs which are already working well, but now
> >>> needs to be expanded even further.
> >>>
> >>
> >> I don't understand how.
> >> You would still need to write that initialise_csv_variables.include file,
> >> you could as well write it as module/class.
> >>
> >> Jussi
> >>
> >>
> >>
> >
> ______________________________________________________________________________
> This message has been checked for viruses and spam by Armourplate
> http://www.armourplate.com, the email archiving, anti virus and anti spam
> service from Corpex.
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________ Gambas-user mailing list 
> Gambas-user@lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/gambas-user


______________________________________________________________________________
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.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to