2 ms·
Drive-by, low-quality comment: Herb is great. Glad he's thinking about this. C++ syntax is garbage and needs help, but why deviate so much from existing synta
by 01100011 4y ago
Drive-by, low-quality comment:
Herb is great. Glad he's thinking about this.
C++ syntax is garbage and needs help, but why deviate so much from existing syntax? Why drop curly braces?
The decision to allow mixing new/old C++ syntax in the same file seems like a gross mistake that prevents a more incremental fix of the language.
Why the heck doesn't it support defining classes yet? Is it because of the aforementioned requirement to intermix new/old syntax?
I hope efforts like this continue, as we all know something is broken in C++ syntax. I think it can be fixed with tweaks and some breaking of backwards compatibility in the same source module.
- tricky777 4y agowhy no classes? I assume that it's meant just as an initial sketch/demo. Doing 100% is at least twice as hard as doing 80%.
- DerekL 4y ago> Why drop curly braces? What do you mean? It uses curly braces for compound statements. But it doesn't require curly braces to define a one-line function.
- 01100011 4y agoYeah, that just strikes me as weird.
- int_19h 4y agoIt makes it more consistent with statements, and more convenient for one-liner functions (e.g. those that just delegate to another function). It's also something that was adopted by other languages in the curly braces family - e.g. C# originally required curly braces for function bodies, but now allows you to write: int Sum(int x, int y) => x + y;