And not even because of CSS, just because I think "do-thing" looks better than both "doThing" and "do_thing". Of course, I would think differently if I tended to write "a-b" instead of "a - b", but at the moment I quite enjoy this feature.
This language may require whitespace around all operators, though. It's not clear to me.
let some-var = a-number-another-number
instead of
let some-var = a-number - another-number
Because I like subtraction.
Something like:
result = balance-sheet - ledger-total + discount-total
Is harder to read than result = balanceSheet - ledgerTotal + discountTotalAnyhow, I feel that this is the kind of feature you just stop noticing after a while. I think we often tend to assume that what we are used to is more readable than what we aren't used to, but the brain will adapt to nearly anything. Doesn't mean we ought to go crazy with changes, but hey, I like hyphens.
Me too, and I've wondered if it's because it's activating the same part of my brain that gets aggravated when people decide to use capitals on seemingly random words within the sentence.
Also, it feels morally wrong that the first word typically doesn't get the capitalization (and often languages ask/require programmers to follow some arbitrary first letter capitalization rules...). Yes, that's right, it's about ethics in programming language design.
This code example doesn’t actually have any examples of unspaced subtraction in it, but there are a bunch of other binary operators with space removed. In my opinion adding spaces around all the operators in this file would make the code less readable, especially if trying to follow along from the formal published spec describing the algorithm: https://github.com/jrus/chromatist/blob/master/src/ciecam.co...
Still, you make a good point with the space savings. I guess I just find hyphens nice enough that I don't mind the tradeoff :)
A search on github etc might give some idea of how common it really is - though their search wasn't precise enough last time I tried. Google code was (regex) but I think they closed down? Or you could just clone a few of your favorite projects and grep it.
[1] And IMO people shouldn't, basic arithmetic isn't that frequent or complex enough to need such a dedicated treatment. But that's another lisp thing, you care more about having DSL opportunities for anything rather than a fixed set.