Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #383269

Re: Calculate date of Easter or Good Friday

From Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups comp.lang.c
Subject Re: Calculate date of Easter or Good Friday
Date 2024-03-03 10:23 -0800
Organization A noiseless patient Spider
Message-ID <864jdntbso.fsf@linuxsc.com> (permalink)
References <urdmac$1d3vr$1@dont-email.me> <urfu0e$1tvc8$2@dont-email.me> <87sf1d8iav.fsf@bsb.me.uk>

Show all headers | View raw


Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

> Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
>
>> On Sat, 24 Feb 2024 21:15:56 +0000, Mike Sanders wrote:
>>
>>> Calculate the date of Easter Sunday or Good Friday:
>>>
>>> https://busybox.neocities.org/notes/is-easter-or-goodfriday.txt
>>
>> I don't have the expertise to discuss whether or not your code
>> properly implements the calculations necessary to determine the
>> date of Good Friday and/or Easter.  However, I /do/ have some
>> expertise on writing understandable code.
>>
>> My suggestions, with respect to your program, would be to
>> a) name your objects with relevant, understandable names
>>    You code uses quite a lot of meaningless one-letter
>>    objects, and it is difficult to keep track of the
>>    purpose of the calculations using them.
>> b) Don't place your calculations /in/ the object initializations.
>>    Doing so obfuscates the intent of the logic, and makes
>>    problem determination and resolution difficult.
>
> I urge those making these suggestions to have a go at doing both.  I
> suspect the result will be far less understandable.

I have the same reaction regarding point (b).  Regarding
point (a), I have mostly the same reaction, although in some
cases I think there are meaningful names that could be given.
Whether it is better to do that by changing variable names or
by describing what's going on in a block comment is another
matter.

In my view the key issue here is not what names are used but the
structure of the algorithm.  Someone has taken a complicated set
of integer relationships and put them into a meat grinder, with
the result being a method that is (perhaps) computationally
efficient but horribly difficult to follow.  If the goal is
understandability, I suggest taking a different approach so that
both the method and the code itself are directly comprehensible.

Back to comp.lang.c | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Calculate date of Easter or Good Friday porkchop@invalid.foo (Mike Sanders) - 2024-02-24 21:15 +0000
  Re: Calculate date of Easter or Good Friday Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-24 22:54 +0000
    Re: Calculate date of Easter or Good Friday Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-02-24 23:57 +0100
      Re: Calculate date of Easter or Good Friday Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-24 23:02 +0000
        Re: Calculate date of Easter or Good Friday Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-02-25 02:00 +0100
          Re: Calculate date of Easter or Good Friday Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-25 02:27 +0000
          Re: Calculate date of Easter or Good Friday Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-02-25 16:58 +0000
            Re: Calculate date of Easter or Good Friday Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-02-25 18:50 +0100
            Re: Calculate date of Easter or Good Friday Dan Purgert <dan@djph.net> - 2024-02-26 12:43 +0000
        Re: Calculate date of Easter or Good Friday Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-02-24 18:00 -0800
        Re: Calculate date of Easter or Good Friday Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2024-02-26 11:24 -0700
          Re: Calculate date of Easter or Good Friday Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-26 23:20 +0000
            Re: Calculate date of Easter or Good Friday scott@slp53.sl.home (Scott Lurndal) - 2024-02-26 23:31 +0000
              Re: Calculate date of Easter or Good Friday Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-02-27 12:50 +0100
            Re: Calculate date of Easter or Good Friday James Kuyper <jameskuyper@alumni.caltech.edu> - 2024-02-27 05:02 -0500
              Re: Calculate date of Easter or Good Friday Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-27 22:48 +0000
                Re: Calculate date of Easter or Good Friday James Kuyper <jameskuyper@alumni.caltech.edu> - 2024-02-27 19:06 -0500
                Re: Calculate date of Easter or Good Friday Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-28 00:11 +0000
                Re: Calculate date of Easter or Good Friday James Kuyper <jameskuyper@alumni.caltech.edu> - 2024-02-27 19:24 -0500
                Re: Calculate date of Easter or Good Friday Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-28 20:47 +0000
                Re: Calculate date of Easter or Good Friday Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-02-28 14:06 -0800
                Re: Calculate date of Easter or Good Friday Kaz Kylheku <433-929-6894@kylheku.com> - 2024-02-28 22:20 +0000
                Re: Calculate date of Easter or Good Friday James Kuyper <jameskuyper@alumni.caltech.edu> - 2024-02-29 13:21 -0500
              Re: Calculate date of Easter or Good Friday Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-27 22:50 +0000
                Re: Calculate date of Easter or Good Friday James Kuyper <jameskuyper@alumni.caltech.edu> - 2024-02-27 19:41 -0500
                Re: Calculate date of Easter or Good Friday David Brown <david.brown@hesbynett.no> - 2024-02-28 13:13 +0100
    Re: Calculate date of Easter or Good Friday porkchop@invalid.foo (Mike Sanders) - 2024-02-25 01:33 +0000
      Re: Calculate date of Easter or Good Friday Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-25 06:20 +0000
    Re: Calculate date of Easter or Good Friday G <g@nowhere.invalid> - 2024-02-26 09:47 +0000
    Re: Calculate date of Easter or Good Friday Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2024-02-26 11:20 -0700
      Re: Calculate date of Easter or Good Friday David Brown <david.brown@hesbynett.no> - 2024-02-27 10:08 +0100
        Re: Calculate date of Easter or Good Friday Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-02-27 13:00 +0100
      Re: Calculate date of Easter or Good Friday Michael S <already5chosen@yahoo.com> - 2024-02-27 13:12 +0200
        Re: Calculate date of Easter or Good Friday Michael S <already5chosen@yahoo.com> - 2024-02-27 14:36 +0200
  Re: Calculate date of Easter or Good Friday Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-02-25 17:39 +0000
    Re: Calculate date of Easter or Good Friday porkchop@invalid.foo (Mike Sanders) - 2024-02-26 03:12 +0000
      Re: Calculate date of Easter or Good Friday Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-02-26 05:20 +0100
        Re: Calculate date of Easter or Good Friday porkchop@invalid.foo (Mike Sanders) - 2024-02-26 14:26 +0000
          Re: Calculate date of Easter or Good Friday Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-02-26 16:31 +0100
          [OT] personal things (was Re: Calculate date of Easter or Good Friday) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-02-26 16:43 +0100
        Re: Calculate date of Easter or Good Friday porkchop@invalid.foo (Mike Sanders) - 2024-02-26 14:32 +0000
          [OT] Re: Calculate date of Easter or Good Friday Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-02-26 17:10 +0100
            Re: [OT] Re: Calculate date of Easter or Good Friday David Brown <david.brown@hesbynett.no> - 2024-02-26 18:26 +0100
    Re: Calculate date of Easter or Good Friday David Brown <david.brown@hesbynett.no> - 2024-02-26 11:45 +0100
      Re: Calculate date of Easter or Good Friday Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-02-26 13:04 +0000
        Re: Calculate date of Easter or Good Friday David Brown <david.brown@hesbynett.no> - 2024-02-26 15:46 +0100
          Re: Calculate date of Easter or Good Friday Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-02-26 16:17 +0100
            Re: Calculate date of Easter or Good Friday Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-02-26 17:15 +0100
      Re: Calculate date of Easter or Good Friday porkchop@invalid.foo (Mike Sanders) - 2024-02-26 14:38 +0000
        Re: Calculate date of Easter or Good Friday scott@slp53.sl.home (Scott Lurndal) - 2024-02-26 16:29 +0000
          Re: Calculate date of Easter or Good Friday porkchop@invalid.foo (Mike Sanders) - 2024-02-26 19:54 +0000
            Re: Calculate date of Easter or Good Friday scott@slp53.sl.home (Scott Lurndal) - 2024-02-26 20:06 +0000
              Re: Calculate date of Easter or Good Friday porkchop@invalid.foo (Mike Sanders) - 2024-02-26 21:18 +0000
              Re: Calculate date of Easter or Good Friday Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-27 00:59 +0000
        Re: Calculate date of Easter or Good Friday David Brown <david.brown@hesbynett.no> - 2024-02-26 18:07 +0100
      Re: Calculate date of Easter or Good Friday Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2024-02-26 16:09 +0100
      Re: Calculate date of Easter or Good Friday Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2024-02-26 17:26 +0000
        Re: Calculate date of Easter or Good Friday David Brown <david.brown@hesbynett.no> - 2024-02-27 10:17 +0100
        Re: Calculate date of Easter or Good Friday Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-03-03 11:05 -0800
      Re: Calculate date of Easter or Good Friday vallor <vallor@cultnix.org> - 2024-02-27 01:28 +0000
        Re: Calculate date of Easter or Good Friday Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-02-27 02:25 +0000
        Re: Calculate date of Easter or Good Friday Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-03-03 10:03 -0800
    Re: Calculate date of Easter or Good Friday Ben Bacarisse <ben.usenet@bsb.me.uk> - 2024-02-28 01:54 +0000
      Re: Calculate date of Easter or Good Friday Tim Rentsch <tr.17687@z991.linuxsc.com> - 2024-03-03 10:23 -0800

csiph-web