pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
imre 2020-09-28T15:04:38.009600Z

Hey all. I was just going through some parts of the pathom code and found that there are lots of single-branch if s, if-let s etc. Is there some advantage of these in pathom's (or a more general) context over their when... counterparts?

1👍
cjmurphy 2020-09-29T09:24:35.010200Z

It makes the code slightly harder to read, because it is unconventional. With an if I'm always looking for two branches. When I first saw it it really broke my concentration! At least now I know it is intentional. In my own code it would be a 'mistake', that sometimes does happen.

imre 2020-09-29T09:36:40.010400Z

Yeah, we'd also request these to be changed in our own codebase.

wilkerlucio 2020-09-28T15:43:37.009800Z

no, they are the same, its a preference thing, to me its just that if has half of the letters of when, but for a single branch they are equivalent

imre 2020-09-28T16:00:06.010Z

Makes some sense I guess, thank you for the explanation 🙂