casouri / vundo

Visualize the undo tree.
469 stars 23 forks source link

Cleanup: prefer 'when' over 'if' #31

Closed ideasman42 closed 2 years ago

ideasman42 commented 2 years ago
casouri commented 2 years ago

Thanks. IMHO when isn't strictly superior to if in all occasions, and this kind of change obscures history with no significant benefit (kind of like whitespace changes). So I'm not going to merge this. Just for curiosity, did you use some kind of tool to scan for these things?

ideasman42 commented 2 years ago

Hi, no I didn't use a tool for this.

To make the case for when, I find it helps readability as there is no need to visually scan for an else clause, also you can add more lines without having to add a progn or convert it to a when - both add noise too.

But I'm not pushing so hard for this, on balance I think it's a slight improvement but don't find it terrible without either.