Fork me on GitHub
#pathom
<
2020-09-28
>
imre15:09:38

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?

👍 3
wilkerlucio15:09:37

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

imre16:09:06

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

cjmurphy09:09:35

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.

imre09:09:40

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