←back to thread

504 points azhenley | 1 comments | | HN request time: 0.313s | source
Show context
QuadrupleA ◴[] No.45773004[source]
Love Carmack, but hard disagree on this and a lot of similar functional programming dogma. I find this type of thing very helpful:

    classList = ['highlighted', 'primary']
    if discount:
        classList.append('on-sale')
    classList = ' '.join(classList)
And not having to think about e.g. `const` vs `let` frees up needless cognitive load, which is why I think python (rightly) chose to not make it an option.
replies(3): >>45774119 #>>45776812 #>>45776933 #
1. salutis ◴[] No.45776812[source]
Fennel (Lisp):

    (table.concat [:highlighted :primary (if discount :on-sale)] " ")