[Lazarus] FPReport file names
Ondrej Pokorny
lazarus at kluug.net
Wed Sep 13 18:23:38 CEST 2017
On 13.09.2017 12:28, Michael Van Canneyt wrote:
> On Wed, 13 Sep 2017, Ondrej Pokorny via Lazarus wrote:
>> On 13.09.2017 12:03, Michael Van Canneyt via Lazarus wrote:
>>> On Wed, 13 Sep 2017, Ondrej Pokorny via Lazarus wrote:
>>>>> The benefit of writing fpreport.exporthtml versus
>>>>> fpreportexporthtml is zero.
>>>>
>>>> You forgot one thing: third-party libraries. E.g. your fpReport
>>>> could use the "fprep" namespace. In the fpReport package you then
>>>> define to use the fprep namespace - it means you can use units in
>>>> fpReport without the "fprep" namespace - and without any collisions.
>>>
>>> This is demonstrably not correct.
>>>
>>> It is *Only* correct if there are not 2 namespaces with the same
>>> unit in
>>> your project.
>>>
>>> See my example program, it demonstrates exactly that.
>>
>> You didn't understand me. I was talking about a 3rd party library
>> package and not about your/my project.
>
> Yes. And the same is true for this package.
You can play this game forever...
>> Of course there can be collisions - if it happens you have to resolve
>> them with explicit namespaces.
>
> Making the whole point moot.
You can understand namespaces and subnamespaces as a concept for folder
structure within code.
Of course you can have every single file in root D:\ and use endless
CamelCase names:
D:\MyCompanyAccounting201705Report1.xls
D:\MyCompanyAccounting201705Report2.xls
or you can have a decent folder structure:
D:\MyCompany\Accounting\2017\05\Report1.xls
D:\MyCompany\Accounting\2017\05\Report2.xls
It's up to you.
The -NSxyz is then similar to "use path" concept. If you see advantages
in using folders you just have to admit there are also advantages when
using namespaces.
Ondrej
More information about the Lazarus
mailing list