4 ms·
I found dashes are by far easier to type than underscores and I'd certainly have whitespace between operators in my code, so I'd never run into the problem you
by zoffix222 11y ago
I found dashes are by far easier to type than underscores and I'd certainly have whitespace between operators in my code, so I'd never run into the problem you describe. It is possible to have variables without sigils and in that case, your first example would be a parse error about undeclared users-churn-rate. Also, apostrophes are valid in variable names as well.
- 3dfan 11y agoyour first example would be a parse error about undeclared users-churn-rate What if users is 10 and churn-rate is 3 and i want to substract the churn-rate from users?
- zoffix222 11y agoUse the space, Luke ;)
- JadeNB 11y agoJust use white space! (EDIT: Sorry, I hadn't refreshed for a while, and so didn't see that zoffix (https://news.ycombinator.com/item?id=10795739 https://news.ycombinator.com/item?id=10795739) beat me to the punch by quite a bit.)
- labster 11y agoYou can either use U+2212 MINUS SIGN instead of a hyphen, too. Spaces would probably be preferable from a maintenance point of view, though.