Re:C++ Modules Might Be Dead-On-Arrival
by ModernMech on Monday January 28, 2019 @08:38AM
(#19017299)
As the other poster mentioned, you gain more than just the dash when forcing white space; you get forced readability and characters like / ? and ^ in identifiers. Then you can name things like foo/bar or e^x
[ Parent
| on HN ]
Re:C++ Modules Might Be Dead-On-Arrival
by mikepurvis on Monday January 28, 2019 @08:59AM
(#19017423)
I suppose I could get used to that, but it sounds like a nightmare at first blush.
I don't think I could handle i ++ instead of i++
You wouldn't have to require whitespace around all operators; you could, for example, decide that infix math/bitwise/logic operators must have a space around them, while other operators (like the infix operators `.` and `->`, and the prefix/suffix `++`, `--`, `[...]`, and `!`) wouldn't require whitespace.
I agree that nobody would want to write `i ++` or `foo [10]` or `myvar . mymember`, but I think a lot of people could get behind `10 - 20` and `foo && bar` instead of `10-20` and `foo&&bar`.