3 ms·
I never use comma, I always define one variable per line. Much easier to edit and read. However, the way it works is certainly not inconsistent. As to your oth
by jstimpfle 2y ago
I never use comma, I always define one variable per line. Much easier to edit and read. However, the way it works is certainly not inconsistent.
As to your other concerns, it makes perfect sense.
int WHATEVER;
read as "WHATEVER is an int" and you can work backwards from there. There is no more type syntax than that. The thing is, it's much easier to look at stuff this way since otherwise you'll have to shift back and forth between 2 different syntaxes (types and expressions) all the time.
I've been looking a lot for a better more algebraic syntax too. All syntaxes I've found have lost on two axes _in the common and simple cases_
- low cognitive overhead
- terseness
Yes, the principle of declaration follows usage is already stretched to its limit, and C++ has certainly overstretched it. But still for the bread-and-butter use cases, the "better" syntaxes seem to always lose on those 2 axes.