3 ms·
A non-programming colleague asked me why I use so many underscores “wouldn’t it be easier to type a dash if you can’t use a space?” Why yes. Kebab case would b
by wodenokoto 4y ago
A non-programming colleague asked me why I use so many underscores “wouldn’t it be easier to type a dash if you can’t use a space?”
Why yes. Kebab case would be so much better.
Or dots, like R uses.
Neither of those are compatible with most languages, but they are a better options for current keyboards.
- tzs 4y agoOffhand I can't think of a good reason why many of the popular languages couldn't allow space. Most either don't have any places where you can have a keyword adjacent to a variable, or would just have to not allow variables containing space if the first word in the name matches a keyword.
- thefaux 4y agoIt is significantly easier to write a parser if you assume names don't have spaces in them. I also tend to think that names with spaces would be confusing to read as well: you'd end up with statements like this `x = foo bar baz (buzz)`. Certainly not unparseable, but I don't think the convenience is worth giving up space as an almost universal token separator.
- collyw 4y agoI imagine it's a lot harder to read as well - as in read and parse in your head