On 2020-08-17 18:25, Paul Reeves wrote:
I thought I would port the OO API examples to Object Pascal. After all, they
are quite simple, so how hard could it be?
In fact it is more difficult than I thought and I am not happy with the
results. I've done two examples - update and select - and I would like to
commit them but before doing so I'd like to discuss how we should proceed.
In my opinion we should start a new sub-directory to contain all the object
pascal code.
Yes.
As long as we had only one example - adding new dir was useless, if we
will have all set (or at least most) of them new dir is OK.
This is because the examples will actually need several
supporting files in a common directory. It would be best if the were kept
clearly separate from other examples.
But the main problem I have found is that if I try to copy the C++ style too
closely all we end up with is very bad object pascal. It succeeds in
demonstrating the new API but does not demonstrate good programming practice.
Must say that when writing c++ examples I specially avoided "too good"
c++ programming practice (starting with no RAII holders in examples),
but that was due to desire not to make them more or less usable for
people who need other language.
However, if we want to demonstrate good programming practice we should
probably integrate the examples into the VCL. And that might be a step too
far.
Does anyone have any thoughts on this?
First of all I'd like to see 2 new examples. Just to know what problems
do we discuss.
PS. Vcl de-facto becomes part of pascal standard (if I'm not mistaken -
I'm rather far from that last time), so may be that integration is ok...
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel