top | item 41217539

(no title)

doytch | 1 year ago

Reading the code is a joy. I love seeing different approaches to what we all take as givens, such as design.css rather than style.css, or the usage of an `else if (1 == 1)` compared to `else` or even `else if (true)`.

(So I guess, thanks for not teaching her about bundlers and minifiers yet :))

discuss

order

seeknotfind|1 year ago

One reason programmers do this is so that they can make a one character change, e.g. "else if (1 === 1)" -> "else if (1 === 2)" in order to change the logic there. For C programers you see a lot of '#if 0' '#if 1' for this same purpose. Though, given that it's used everywhere, I'm not sure if it's really for that purpose.

roblh|1 year ago

I’m a big fan of tacking on “&& false” or “|| true” as well.