Hacker News new | ask | show | jobs
by J_Darnley 3897 days ago
? Those pages are identical.

[EDIT] Anyway, aside from your suggestion of "if false", yes writing code to make diffs smaller or cleaner is good in my opinion. On this specific point, why not just start with "if check 1"?

1 comments

With JavaScript enabled on GitHub, the separate links highlight different sections of the code.

If you start with if check 1 (such as in w.sh), a refactor-er would have to s/elif/if on check 2 and s/if/elif on check 1 if he wants to swap their order. By having all of the checks start with elif (such as in w2.sh), the refactor-er can change the order of the checks without having to modify them, making cleaner diffs.