dragora-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dragora-members] Qi 2.0rc13


From: Michael Siegel
Subject: Re: [Dragora-members] Qi 2.0rc13
Date: Fri, 24 Jul 2020 00:59:47 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Hi there.

Am 21.07.20 um 23:23 schrieb Matias Fonzo:
> El 2020-07-21 09:29, Michael Siegel escribió:
>> Is there any reason not to use basename(1) and dirname(1) as offered by
>> the system? I mean, they're both defined in POSIX.
>>
> 
> It helps to avoid having to check for its existence (as an external
> requirement) and can also carry out the task a little faster.

I think this is actually not advisable.

I mean, doing that results in adding about 50 lines of code to Qi just
to recreate something that is already present. On the contrary, checking
for the existence of the external tools merely takes two additional
items in the arguments to the `for' loop doing the checks, i.e., it adds
virtually no code.

Also, the names of the functions used to re-implement basename(1) and
dirname(1) break the usual way of naming functions in Qi because they
need to start with an underscore (or some other character that is
allowed) to be different from the names of the system commands.

In the interest of compactness, maintainability and consistency, I would
therefore recommend sticking with the external tools.

If that slows things down a bit, that's okay, I think.

Form another quick look through Qi's source, I think there are some
other places where we can optimize things without re-implementing system
commands.


Best
Michael



reply via email to

[Prev in Thread] Current Thread [Next in Thread]