[GRASS-dev] making grass modules less verbose

Maciej Sieczka tutey at o2.pl
Sat Sep 23 04:45:45 EDT 2006


Brad Douglas wrote:
> On Sat, 2006-09-23 at 09:04 +0200, Jachym Cepicky wrote:

>> On Fri, Sep 22, 2006 at 11:11:35PM +0000, Brad Douglas wrote:

>>> G_message("\n") = '\n\n' on screen.  G_message(" ") seems a bit obscure.
>>> But yes, that particular problem would go away, but potentially creating
>>> a new one.
>>>
>>> Also, in loops outputting text, G_message() is generally not desirable
>>> because of it's "auto-CR" feature.
>>>
>>> Would be better to add a function [eg. G_message2()] that does not
>>> automatically append '\n' to text?

>> This should occure in only few cases, because loops are mostly used not
>> for messages, but for printing results of calculation.

What are those "few cases"?

>> The results are not "messages", program is not "verbose", if it prints
>> results, so printf should be used.
>>
>> IMHO there is no need for G_message2()

> I just wanted to make a note of the potential problem because there are
> cases that do exist.  Adding such a function at a later date, if it is
> truly useful, is trivial.

I'd vote for doing this now, while Jachym is working on the subject.
Minor issues leaved for later as trivial, usually don't get fixed at all.

Maciek




More information about the grass-dev mailing list