Re: [hackers] [quark] Use sizeof() instead of magic constants || FRIGN

From: Pickfire <pickfire_AT_riseup.net>
Date: Tue, 6 Sep 2016 16:24:12 +0800

On Mon, Sep 05, 2016 at 09:55:49AM +0200, Anselm R Garbe wrote:
>On 5 September 2016 at 09:52, FRIGN <dev_AT_frign.de> wrote:
>> On Mon, 5 Sep 2016 09:48:34 +0200
>> Anselm R Garbe <garbeam_AT_gmail.com> wrote:
>> Using typedefs destroys this beautiful hierarchy.
>
>Beware! There have been zealots arguing that using goto is a bad
>practice for similar reasons.
>
>typedef's have to be considered more carefully.

I think using goto loops sometimes is good, depend on the use case.

For example in spt.c:

run:
        notify_send(timers[i].cmt);

        for (timecount = 0; timecount < timers[i].tmr; timecount += inc)
                sleep(1);

        if (++i >= LEN(timers)) i = 0; /* i infinal loop */
        goto run;

I tried using for and while loop, the goto loop still looks a lot
better.
    

-- 
Do what you like, like what you do.  -- Pickfire
Received on Tue Sep 06 2016 - 10:24:12 CEST

This archive was generated by hypermail 2.3.0 : Tue Sep 06 2016 - 10:36:15 CEST