[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: combining cond and let, to replace pcase.
|
From: |
Eli Zaretskii |
|
Subject: |
Re: combining cond and let, to replace pcase. |
|
Date: |
Sun, 19 Nov 2023 15:08:22 +0200 |
> From: Michael Heerdegen <michael_heerdegen@web.de>
> Date: Sun, 19 Nov 2023 13:50:26 +0100
>
> There is a problem. And I see it. I already said that.
>
> But the problem is "some people can't read pcase calls well". The
> problem is not "pcase is bad". The latter is a subjective conclusion,
> and this is the part I do not accept as objective truth.
Code that is hard to read, even if only to some of the people, is a
problem for us, since we are a project that advances mainly through
sporadic contributions of people who tend to disappear after a
relatively short time.
> I accept that people having a problem reading code involving pcase is a
> problem.
So we agree. Then arguments about how easy pcase is for some are not
relevant, because this is not what this is about, right?
> > The same is true for regular expressions. But we still have rx, and
> > some people really prefer it. Maybe this imperfect analogy will help
> > you understand the issue with pcase.
>
> This is an excellent analogy. Which one is the counterpart to `pcase'?
> `rx' or the string form?
The string, of course.
> Actually both and none, this is exactly the point I raised in my other
> reply - both have exactly the same complexity, and it is totally
> subjective and only habit which one you prefer.
It isn't only that. It is also that the obscure and subtle nature of
regexp strings makes it easy to make mistakes. Just look at the sheer
number of regexp mistakes uncovered in our code base by Mattias
Engdegård during the last year. It isn't an accident.
> The amount of knowledge you need to remember, the amount of
> documentation you need to consult, is the same.
The rx notation is easier to read and interpret, at least for some,
and I submit leads to fewer mistakes.
So no, I don't agree that it is "just the habit", and nothing else.
- Re: combining cond and let, to replace pcase., (continued)
- Re: combining cond and let, to replace pcase., Eli Zaretskii, 2023/11/19
- Re: combining cond and let, to replace pcase., Gerd Möllmann, 2023/11/19
- Re: combining cond and let, to replace pcase., Eli Zaretskii, 2023/11/19
- Re: combining cond and let, to replace pcase., Gerd Möllmann, 2023/11/19
- Re: combining cond and let, to replace pcase., Eli Zaretskii, 2023/11/19
- Re: combining cond and let, to replace pcase., Joost Kremers, 2023/11/19
- Re: combining cond and let, to replace pcase., Eli Zaretskii, 2023/11/19
- Re: combining cond and let, to replace pcase., Joost Kremers, 2023/11/19
- Re: combining cond and let, to replace pcase., Eli Zaretskii, 2023/11/19
- Re: combining cond and let, to replace pcase., Michael Heerdegen, 2023/11/19
- Re: combining cond and let, to replace pcase.,
Eli Zaretskii <=
- Re: combining cond and let, to replace pcase., Michael Heerdegen, 2023/11/19
- Re: combining cond and let, to replace pcase., Eli Zaretskii, 2023/11/19
- Re: combining cond and let, to replace pcase., Michael Heerdegen, 2023/11/20
- Re: combining cond and let, to replace pcase., Eli Zaretskii, 2023/11/20
- Re: combining cond and let, to replace pcase., Michael Heerdegen, 2023/11/21
- Re: combining cond and let, to replace pcase., Michael Heerdegen, 2023/11/21
- Re: combining cond and let, to replace pcase., Dmitry Gutov, 2023/11/19
- Re: combining cond and let, to replace pcase., Eli Zaretskii, 2023/11/19
- Re: combining cond and let, to replace pcase., Dmitry Gutov, 2023/11/19
- Re: combining cond and let, to replace pcase., Gerd Möllmann, 2023/11/19