On Sat, 24 Feb 2024 21:15:56 -0000 (UTC), Mike Sanders wrote:
Calculate the date of Easter Sunday or Good Friday:
Did you know that one of the requirements of the rules was that Easter
would never coincide with Passover? Because the sight of Christians celebrating together with Jews was seen as heretical or something ...
... and that there's not a unique definition of Easter.
Calculate the date of Easter Sunday or Good Friday:
On Sat, 24 Feb 2024 23:57:16 +0100, Janis Papanagnou wrote:
... and that there's not a unique definition of Easter.
Easter, Christmas ... both ancient pagan festivals co-opted by the
Christians and given an invented meaning under their ideology, for their
own propaganda purposes.
Did you know that one of the requirements of the rules was that Easter
would never coincide with Passover? Because the sight of Christians celebrating together with Jews was seen as heretical or something ...
On 25.02.2024 00:02, Lawrence D'Oliveiro wrote:
On Sat, 24 Feb 2024 23:57:16 +0100, Janis Papanagnou wrote:
... and that there's not a unique definition of Easter.
Easter, Christmas ... both ancient pagan festivals co-opted by the
Christians and given an invented meaning under their ideology, for their
own propaganda purposes.
Yes, the associated rites were of pagan origin.
Oh yeah, lots of horror stories committed by & against the 'us & them'.
Isn't a culture on the planet, so far as I can see, that has not been
both prey & predacious. I want to say something like 'that's life', but
its not a very satisfying reply...
On 25.02.2024 00:02, Lawrence D'Oliveiro wrote:
On Sat, 24 Feb 2024 23:57:16 +0100, Janis Papanagnou wrote:
... and that there's not a unique definition of Easter.
Easter, Christmas ... both ancient pagan festivals co-opted by the
Christians and given an invented meaning under their ideology, for their
own propaganda purposes.
Yes, the associated rites were of pagan origin. The dates of Easter -
the topic here - still not unique. There's different calculations for different christian churches; the catholics calculate it differently
from the orthodox christians, still today.
So Easter is peobably
not a good choice for a C program calculation if not parameterized or explicitly documented to be restricted to only one specific religious culture.
Calculate the date of Easter Sunday or Good Friday:
https://busybox.neocities.org/notes/is-easter-or-goodfriday.txt
On Sun, 25 Feb 2024 02:00:43 +0100, Janis Papanagnou wrote:
[...] There's different calculations for
different christian churches; the catholics calculate it differently
from the orthodox christians, still today.
As some countries recognize Good Friday and/or Easter Sunday as
statutory holidays, and have /legal/ definitions for those dates.
For instance, the Government of Canada defines Easter Sunday as
"the first Sunday after the first full moon in spring (after March 21st)".
(I don't know if this coincides with /any/ religious definition or not.)
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.
Otherwise, it /appears/ to do the job. Good first attempt.
One thing while I'm thinking about it: allot of discussion up-thread
failed to note that officially mandated Easter dating is really
based a Lunar date mapped onto the Gregorian calendar. [...]
On Sat, 24 Feb 2024 21:15:56 -0000 (UTC), Mike Sanders wrote:
Calculate the date of Easter Sunday or Good Friday:
Did you know that one of the requirements of the rules was that Easter
would never coincide with Passover? Because the sight of Christians celebrating together with Jews was seen as heretical or something ...
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.
Otherwise, it /appears/ to do the job. Good first attempt.
On 25/02/2024 18:39, Lew Pitcher wrote:
On Sat, 24 Feb 2024 21:15:56 +0000, Mike Sanders wrote:
Calculate the date of Easter Sunday or Good Friday:I don't have the expertise to discuss whether or not your code
https://busybox.neocities.org/notes/is-easter-or-goodfriday.txt
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.
I agree here.
I'd also avoid single-letter capital letter variables, and avoid single-letter variables that are easily misread (so don't use "L" or "O",
big or small). Single-letter variables are fine if their scope is small
and their meaning is clear - such as "i" for a loop variable, and "x" and
"y" for coordinates.
Good names here, together with some comments, would go a long way to making it possible to understand your algorithm here.
Links to web pages for
reference are useful (and it's always polite to give your references), but remember that web pages don't last for ever - try to make your code stand alone as code, or at least have enough comments to cover the information.
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'd disagree with that one. Initialise your variables when you have something to put in them, and that is often a calculated value.
Don't have one function that appears to do two different things.
It's much
better to have "isEaster()" and "isGoodFriday()" functions. Clearly these
are heavily related, so have a static helper function that does the common calculations.
On Sun, 25 Feb 2024 02:00:43 +0100, Janis Papanagnou wrote:
[...]
Yes, the associated rites were of pagan origin. The dates of Easter -
the topic here - still not unique. There's different calculations for
different christian churches; the catholics calculate it differently
from the orthodox christians, still today.
As some countries recognize Good Friday and/or Easter Sunday as
statutory holidays, and have /legal/ definitions for those dates.
For instance, the Government of Canada defines Easter Sunday as
"the first Sunday after the first full moon in spring (after March 21st)".
(I don't know if this coincides with /any/ religious definition or not.)
And both dates, western and eastern, are anyway arbitrary. But if you
decide to neglect the existing facts, either by wrongly assuming that
there's only one "correct" Easter date, or by (arrogantly?) presuming
that one is more correct than the other, then you are discriminating Christian folks that follow the one [arbitrary] definition (or the
other).
Not sure which instance of "official" you are referring to; there's
just no "official" mandate unless you are restricting yourself to a
global authority instance (which does not exist) or not considering
that any single instance cannot define a "general" rule that would
be valid worldwide. Face it; Easter dates just differ on this planet!
PS: Just to prevent you from a fallacy; for the date calculation of
Easter it's irrelevant whether "we" have "now" switched to Gregorian
calendar [mostly]. (Think about it before you step into that pit.)
David Brown <david.brown@hesbynett.no> writes:
On 25/02/2024 18:39, Lew Pitcher wrote:
On Sat, 24 Feb 2024 21:15:56 +0000, Mike Sanders wrote:
Calculate the date of Easter Sunday or Good Friday:I don't have the expertise to discuss whether or not your code
https://busybox.neocities.org/notes/is-easter-or-goodfriday.txt
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.
I agree here.
I challenge the "use better names" to try it. The trouble with this
sort of code is, I suspect, that the quantities don't correspond to
anything that can be clearly named. I may be wrong as I don't know this form, but it true of the much better known Zeller's Congruence.
I think the correct way to present an algorithm like this if to include
a block comment than documents and explains the formula (using whatver
names are conventional), followed by code that uses the same names to do
the calculation.
I'd also avoid single-letter capital letter variables, and avoid
single-letter variables that are easily misread (so don't use "L" or "O",
big or small). Single-letter variables are fine if their scope is small
and their meaning is clear - such as "i" for a loop variable, and "x" and
"y" for coordinates.
In this case, I would use the conventional names (if there are any) even
if this violates the usual programming conventions. All supposing that
the formula has been explained in a comment using exactly those names.
Good names here, together with some comments, would go a long way to making >> it possible to understand your algorithm here.
Have you tried? It may well detract from the explanations in the
references. (I am hoping that the referenced URLs explain the formula.)
Links to web pages for
reference are useful (and it's always polite to give your references), but >> remember that web pages don't last for ever - try to make your code stand
alone as code, or at least have enough comments to cover the information.
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'd disagree with that one. Initialise your variables when you have
something to put in them, and that is often a calculated value.
Yes, and I'd make them all const to show that they just name quantities
to simplify later calculations. That would force the adjustments to the
day, month and year (to get good Friday) to be in another function.
The
logical one would be a separate test function for that date (as you have suggested):
Don't have one function that appears to do two different things.
Yes. I was taught a phrase about function arguments: "pass data not control".
It's much
better to have "isEaster()" and "isGoodFriday()" functions. Clearly these
are heavily related, so have a static helper function that does the common >> calculations.
On 25/02/2024 18:39, Lew Pitcher wrote:
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
[...]
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.
[...]
Good names here, together with some comments, would go a long way to
making it possible to understand your algorithm here. Links to web
pages for reference are useful (and it's always polite to give your references), but remember that web pages don't last for ever - try to
make your code stand alone as code, or at least have enough comments to
cover the information.
Consider making and using several general functions, rather than having
a single impenetrable function. You might have a "numberOfDaysInYear()" function, and functions for converting (day, month) pairs back and forth
to the number of days since the first of January. You can have lunar calculations also based on the number of days from a given starting
point (perhaps using Unix epoch time rather than struct tm). Then you
can have a "findEaster()" function that returns the date of Easter for a given year as the number of days from the first of January.
Don't use "int" when you mean "bool". That applies to parameters,
return types, and variables.
Yes, I realise that's likely to be a problem here. For variables that
exist solely to break up a long complicated calculation into manageable parts, good names are hard or impossible.
However, I would guess - without having looked at the details of the algorithm - that this could be split into parts that are a bit clearer,
and at least some of the variables could then have names showing what's
going on. You might have the offset into the lunar month, or the number
of days in February, or a boolean for before/after the spring equinox.
If the expressions can only be split in somewhat arbitrary positions,
and therefore the variables have arbitrary and meaningless names, so be
it. But if it is possible and practical to do better, then I'd
recommend that.
So tell me, what are you coding these days? Haven't seen much from you lately...
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
Not sure which instance of "official" you are referring to; there's
just no "official" mandate unless you are restricting yourself to a
global authority instance (which does not exist) or not considering
that any single instance cannot define a "general" rule that would
be valid worldwide. Face it; Easter dates just differ on this planet!
The inference is the 'official' governance of a given municipality or provence using the Gregorian calendar (updated the URL notes last night
to, I hope, clarify)...
PS: Just to prevent you from a fallacy; for the date calculation of
Easter it's irrelevant whether "we" have "now" switched to Gregorian
calendar [mostly]. (Think about it before you step into that pit.)
Not me =) I'm not touching the Julian variant, heck I got lucky (and
spent way too much time) with the one I cobbled together as it is.
On 26.02.2024 15:46, David Brown wrote:
Yes, I realise that's likely to be a problem here. For variables that
exist solely to break up a long complicated calculation into manageable
parts, good names are hard or impossible.
However, I would guess - without having looked at the details of the
algorithm - that this could be split into parts that are a bit clearer,
Unfortunately not, I fear.
and at least some of the variables could then have names showing what's
going on. You might have the offset into the lunar month, or the number
of days in February, or a boolean for before/after the spring equinox.
You seem to have chosen a source where "Spencer's" algorithm is
described. In a corresponding Wikipedia article (here in German:
e.g. https://de.wikipedia.org/wiki/Spencers_Osterformel)
you find the same non-descriptive names.
If the expressions can only be split in somewhat arbitrary positions,
and therefore the variables have arbitrary and meaningless names, so be
it. But if it is possible and practical to do better, then I'd
recommend that.
If you put in a reference to the document source - while not
explaining anything - that might suffice. Otherwise you'd have
to spend more effort describing the variables in detail.
Janis
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
And both dates, western and eastern, are anyway arbitrary. But if you
decide to neglect the existing facts, either by wrongly assuming that
there's only one "correct" Easter date, or by (arrogantly?) presuming
that one is more correct than the other, then you are discriminating
Christian folks that follow the one [arbitrary] definition (or the
other).
And what's this? c'mon now, there's nothing arrogant or presumptuous here. I'm not discriminating against anyone (I'm Catholic if it makes a difference).
Now then - don't start an argument where there is none...
David Brown <david.brown@hesbynett.no> wrote:
Don't use "int" when you mean "bool". That applies to parameters,
return types, and variables.
But I dont mean bool, I mean int, because the function (well my
private code at any rate) now includes other Holi/Holy days:
int foo(const struct tm *now, int hDay);
switch (hDay)...
But you all still raise some good points.
David Brown <david.brown@hesbynett.no> wrote:
Don't use "int" when you mean "bool". That applies to parameters,
return types, and variables.
But I dont mean bool, I mean int, because the function (well my
private code at any rate) now includes other Holi/Holy days:
int foo(const struct tm *now, int hDay);
On 25/02/2024 18:39, Lew Pitcher wrote:[snip]
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
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'd disagree with that one. Initialise your variables when you have something to put in them, and that is often a calculated value.
On 26.02.2024 15:32, Mike Sanders wrote:
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
And both dates, western and eastern, are anyway arbitrary. But if you
decide to neglect the existing facts, either by wrongly assuming that
there's only one "correct" Easter date, or by (arrogantly?) presuming
that one is more correct than the other, then you are discriminating
Christian folks that follow the one [arbitrary] definition (or the
other).
And what's this? c'mon now, there's nothing arrogant or presumptuous here. >> I'm not discriminating against anyone (I'm Catholic if it makes a difference).
Now then - don't start an argument where there is none...
While it may be personal arrogance (I can't tell; that's why I had put
it in parenthesis and with a question mark) I had more the often
observed "Western Arrogance" in mind. The country I'm living in is no exception here! Sadly we can observe (more often than desirable) that
other cultures than the ones we are used to or living in are ignored,
their culture despised or neglected.
Speaking (in general contexts), say, only about male people will
discriminate the female ones. Considering only the sexually straight
people (is that word correct?) will discriminate the "LGBT..." folks. Disregarding non-Christian religions will discriminate the majority
of religious people in the world. And if Christians exclude the
Orthodox Christians it's also a discrimination.
In case of the calendar issues even an unnecessary discrimination.
Whether you are a Catholic or not might explain a preference, or may
make some ignorance concerning other cultures understandable; I can't
tell, and it's not the relevant point when we're speaking about any
objective discrimination.
Janis
On Sat, 24 Feb 2024 21:15:56 -0000 (UTC), Mike Sanders wrote:
Calculate the date of Easter Sunday or Good Friday:
Did you know that one of the requirements of the rules was that Easter
would never coincide with Passover? Because the sight of Christians celebrating together with Jews was seen as heretical or something ...
On Sat, 24 Feb 2024 23:57:16 +0100, Janis Papanagnou wrote:
... and that there's not a unique definition of Easter.
Easter, Christmas ... both ancient pagan festivals co-opted by the
Christians and given an invented meaning under their ideology, for their
own propaganda purposes.
Just like they took a lot of existing pagan deities (e.g. in Celtic lands) and reinvented them as “saints”.
int foo(const struct tm *now, int hDay);
I would expect that an enumeration would be superior
to an 'int' for this purpose.
Scott Lurndal <scott@slp53.sl.home> wrote:
int foo(const struct tm *now, int hDay);
I would expect that an enumeration would be superior
to an 'int' for this purpose.
Just now getting around to thinking of that to be honest
Scott (seems you're step ahead of me), but enums are
great in my thinking, consider:
enum weekdays { Sun, Mon, Tue, Wed, Thu, Fri, Sat };
if (Wed > Sun) { ... }
Nice & easy to read yeah?
In any case, your 'hday' would have enumerated a
list of holidays, right? Where ordering wouldn't
be a prime criteria, rather the usefulness of an
enumeration would be in readability and maintainabilty
of the code.
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
Easter, Christmas ... both ancient pagan festivals co-opted by the
Christians and given an invented meaning under their ideology, for
their own propaganda purposes.
While that unquestionably true of Christmas, Easter very clearly comes
from Passover.
On Mon, 26 Feb 2024 11:24:29 -0700, Joe Pfeiffer wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
Easter, Christmas ... both ancient pagan festivals co-opted by the
Christians and given an invented meaning under their ideology, for
their own propaganda purposes.
While that unquestionably true of Christmas, Easter very clearly comes
from Passover.
Easter bunny? Eggs? Both fertility symbols, associated with (northern)
spring and the beginning of the planting season? And both with origins
older than Christianity and Judaism combined?
Somehow I doubt it.
porkchop@invalid.foo (Mike Sanders) writes:
if (Wed > Sun) { ... }
Nice & easy to read yeah?
When you're working with dates, wednesday both preceeds and follows
sunday; so your if statement is logically ambiguous.
On 25/02/2024 18:39, Lew Pitcher wrote:
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.
I agree here.
I'd also avoid single-letter capital letter variables, and avoid single-letter variables that are easily misread (so don't use "L" or
"O", big or small). Single-letter variables are fine if their scope is
small and their meaning is clear - such as "i" for a loop variable, and
"x" and "y" for coordinates.
Good names here, together with some comments, would go a long way to
making it possible to understand your algorithm here. Links to web
pages for reference are useful (and it's always polite to give your references), but remember that web pages don't last for ever - try to
make your code stand alone as code, or at least have enough comments to
cover the information.
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'd disagree with that one. Initialise your variables when you have something to put in them, and that is often a calculated value.
Otherwise, it /appears/ to do the job. Good first attempt.
Some other suggestions:
Don't use "int" when you mean "bool". That applies to parameters,
return types, and variables.
Don't have one function that appears to do two different things. It's
much better to have "isEaster()" and "isGoodFriday()" functions. Clearly these are heavily related, so have a static helper function that does
the common calculations.
Consider making and using several general functions, rather than having
a single impenetrable function. You might have a "numberOfDaysInYear()" function, and functions for converting (day, month) pairs back and forth
to the number of days since the first of January. You can have lunar calculations also based on the number of days from a given starting
point (perhaps using Unix epoch time rather than struct tm). Then you
can have a "findEaster()" function that returns the date of Easter for a given year as the number of days from the first of January.
I really wish the function easterg() was commented better.
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Sat, 24 Feb 2024 21:15:56 -0000 (UTC), Mike Sanders wrote:
Calculate the date of Easter Sunday or Good Friday:
Did you know that one of the requirements of the rules was that Easter
would never coincide with Passover? Because the sight of Christians
celebrating together with Jews was seen as heretical or something ...
That's an Eastern Orthodox rule, not Western. Last year (western)
Easter was April 9, while Passover was April 5 through 13 (this year
they don't overlap).
On Mon, 26 Feb 2024 11:24:29 -0700, Joe Pfeiffer wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
Easter, Christmas ... both ancient pagan festivals co-opted by the
Christians and given an invented meaning under their ideology, for
their own propaganda purposes.
While that unquestionably true of Christmas, Easter very clearly comes
from Passover.
Easter bunny? Eggs? Both fertility symbols, associated with (northern)
spring and the beginning of the planting season? And both with origins
older than Christianity and Judaism combined?
Somehow I doubt it.
On Mon, 26 Feb 2024 11:45:36 +0100, David Brown wrote:
On 25/02/2024 18:39, Lew Pitcher wrote:[snip]
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
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'd disagree with that one. Initialise your variables when you have
something to put in them, and that is often a calculated value.
I base my suggestion on the OP's source:
int isEasterOrGoodFriday(const struct tm *now, int checkGoodFriday) {
int Y = now->tm_year + 1900; // correcting the year
int a = Y % 19;
int b = Y / 100;
int c = Y % 100;
int d = b / 4;
int e = b % 4;
int f = (b + 8) / 25;
int g = (b - f + 1) / 3;
int h = (19 * a + b - d - g + 15) % 30;
int i = c / 4;
int k = c % 4;
int L = (32 + 2 * e + 2 * i - h - k) % 7;
int m = (a + 11 * h + 22 * L) / 451;
int month = (h + L - 7 * m + 114) / 31;
int day = ((h + L - 7 * m + 114) % 31) + 1;
if (checkGoodFriday) {
[rest of code elided]
The program code /depends/ on the specific order of
the declarations: <<Y>> /must/ be declared before <<a>>,
<<a>> /must/ be declared before <<h>>, etc.
If some good-meaning (or unknowledgable) maintainer decides to
reorder or consolidate the above declarations, the program
either fails or gives erroneous results.
The OP embedded the /logic/ of the program within the declarations.
That, to me. is /not/ good programming.
Hope this helps clarify my earlier remarks.
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Sat, 24 Feb 2024 21:15:56 -0000 (UTC), Mike Sanders wrote:
Calculate the date of Easter Sunday or Good Friday:
Did you know that one of the requirements of the rules was that
Easter would never coincide with Passover? Because the sight of
Christians celebrating together with Jews was seen as heretical or something ...
That's an Eastern Orthodox rule, not Western. Last year (western)
Easter was April 9, while Passover was April 5 through 13 (this year
they don't overlap).
March was the first month of the year in Roman times (which is why september is derived from the latin for seven). [...]
[...] I
thought the Eastern Orthodox churches used basically the same algorithm
as the Western churches, [...]
On Mon, 26 Feb 2024 11:20:14 -0700
Joe Pfeiffer <pfeiffer@cs.nmsu.edu> wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
On Sat, 24 Feb 2024 21:15:56 -0000 (UTC), Mike Sanders wrote:
Calculate the date of Easter Sunday or Good Friday:
Did you know that one of the requirements of the rules was that
Easter would never coincide with Passover? Because the sight of Christians celebrating together with Jews was seen as heretical or something ...
That's an Eastern Orthodox rule, not Western. Last year (western)
Easter was April 9, while Passover was April 5 through 13 (this year
they don't overlap).
This year Western Easter does not overlap with Passover because of approximately four day difference in definition of official start of
Spring. When there is a full moon between 21st and 24th of Martch, by
Western rules it's already Spring, but by Jewish rules it's still
Winter and does not count.
It happens approximately 3 times in 19-year cycle. Or, may be, exactly
3 times, I don't know for sure.
So, it seems, Western Easter overlaps with Passover in overwhelming
majority of years - 16 out of 19.
On 2/26/24 18:20, Lawrence D'Oliveiro wrote:
On Mon, 26 Feb 2024 11:24:29 -0700, Joe Pfeiffer wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
Easter, Christmas ... both ancient pagan festivals co-opted by the
Christians and given an invented meaning under their ideology, for
their own propaganda purposes.
While that unquestionably true of Christmas, Easter very clearly comes
from Passover.
Easter bunny? Eggs? Both fertility symbols, associated with (northern)
spring and the beginning of the planting season? And both with origins
older than Christianity and Judaism combined?
Somehow I doubt it.
He was not talking about Easter customs, he was talking about the *definition" of Easter ...
They were not co-opting a pagan date - they were trying to be MORE
correct than the Jews as to the timing of Passover.
On Tue, 27 Feb 2024 05:02:58 -0500, James Kuyper wrote:
They were not co-opting a pagan date - they were trying to be MORE
correct than the Jews as to the timing of Passover.
Religion is a matter of belief, not fact. Trying to be “more correct” than
official religious authorities has a name: “heresy”.
On 2/27/24 17:48, Lawrence D'Oliveiro wrote:
On Tue, 27 Feb 2024 05:02:58 -0500, James Kuyper wrote:
They were not co-opting a pagan date - they were trying to be MORE
correct than the Jews as to the timing of Passover.
Religion is a matter of belief, not fact. Trying to be “more correct”
than official religious authorities has a name: “heresy”.
Actually, no. The Christians had fully separated from Judaism by that
time - they no longer accepted the authority of Jewish religious
authorities.
whether the date of Easter was co-opted from a pagan religion. It wasn't
On Tue, 27 Feb 2024 05:02:58 -0500, James Kuyper wrote:...
He was not talking about Easter customs, he was talking about the
*definition" of Easter ...
In that case, that argument would also apply to the “definition” of Christmas. So that what was “unquestionably true of Christmas” (as stated above) must be the date. Which it is not.
On Tue, 27 Feb 2024 19:06:22 -0500, James Kuyper wrote:...
Actually, no. The Christians had fully separated from Judaism by that
time - they no longer accepted the authority of Jewish religious
authorities.
Or rather, the ones that still did were the ones considered “heretics”.
whether the date of Easter was co-opted from a pagan religion. It wasn't
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.
Otherwise, it /appears/ to do the job. Good first attempt.
On 2/27/24 17:50, Lawrence D'Oliveiro wrote:
On Tue, 27 Feb 2024 05:02:58 -0500, James Kuyper wrote:...
He was not talking about Easter customs, he was talking about the
*definition" of Easter ...
In that case, that argument would also apply to the “definition” of
Christmas. So that what was “unquestionably true of Christmas” (as stated
above) must be the date. Which it is not.
No, the date of Christmas was co-opted from a pagan Roman celebration.
The date of Easter was based upon Jewish traditions for Passover. With modifications, to be sure - but those modifications were not co-opted
from pagan religions, they were due to a disagreement about the details
of the rules for the Hebrew calendar.
You were the one who interrupted a discussion of the date of Easter by claiming that Easter had been co-opted from pagan celebrations. Many of
the customs followed during Easter were co-opted, but not the date,
which rendered your comment a non-sequitur.
because it has nothing to do with C. (C code that calculates the date
of Easter is topical here; debates about holidays being co-opted from
pagan religions are not.)
On Tue, 27 Feb 2024 19:24:05 -0500, James Kuyper wrote:
You were the one who interrupted a discussion of the date of Easter by
claiming that Easter had been co-opted from pagan celebrations. Many of
the customs followed during Easter were co-opted, but not the date,
which rendered your comment a non-sequitur.
Remember, you were the one who said that “the point under debate” was “whether the date of Easter was co-opted from a pagan religion”. Not me.
[...]
ncal(1) has the -e and -o options for both Easters. I went looking
for the source of the Easter-computation code, found one copy here:
https://github.com/lattera/freebsd/blob/master/lib/libcalendar/easter.c
On Ubuntu with source repositories enabled, one can get the BSD
ncal (with its bundled libcalendar) with
$ apt-get source ncal
I really wish the function easterg() was commented better.
/* Compute Easter Sunday in Gregorian Calendar */
date *
easterg(int y, date *dt)
{
int c, i, j, k, l, n;
n = y % 19;
c = y / 100;
k = (c - 17) / 25;
i = (c - c/4 -(c-k)/3 + 19 * n + 15) % 30;
i = i -(i/28) * (1 - (i/28) * (29/(i + 1)) * ((21 - n)/11));
j = (y + y/4 + i + 2 - c + c/4) % 7;
l = i - j;
dt->m = 3 + (l + 40) / 44;
dt->d = l + 28 - 31*(dt->m / 4);
dt->y = y;
return (dt);
}
The code is 27 years old. I will not pretend to understand it.
(Yet?)
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.
On 25/02/2024 18:39, Lew Pitcher wrote:
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
My suggestions, with respect to your program, would be to
[...]
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 base my suggestion on the OP's source:
int isEasterOrGoodFriday(const struct tm *now, int checkGoodFriday) {
int Y = now->tm_year + 1900; // correcting the year
int a = Y % 19;
int b = Y / 100;
int c = Y % 100;
int d = b / 4;
int e = b % 4;
int f = (b + 8) / 25;
int g = (b - f + 1) / 3;
int h = (19 * a + b - d - g + 15) % 30;
int i = c / 4;
int k = c % 4;
int L = (32 + 2 * e + 2 * i - h - k) % 7;
int m = (a + 11 * h + 22 * L) / 451;
int month = (h + L - 7 * m + 114) / 31;
int day = ((h + L - 7 * m + 114) % 31) + 1;
if (checkGoodFriday) {
[rest of code elided]
The program code /depends/ on the specific order of
the declarations: <<Y>> /must/ be declared before <<a>>,
<<a>> /must/ be declared before <<h>>, etc.
If some good-meaning (or unknowledgable) maintainer decides to
reorder or consolidate the above declarations, the program
either fails or gives erroneous results.
The OP embedded the /logic/ of the program within the declarations.
That, to me, is /not/ good programming.
Hope this helps clarify my earlier remarks.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 149:10:25 |
Calls: | 10,383 |
Calls today: | 8 |
Files: | 14,054 |
D/L today: |
2 files (1,861K bytes) |
Messages: | 6,417,764 |