Re:Carbon Language: An experimental successor to C++
by amai on Tuesday July 26, 2022 @08:33AM
(#32237418)
On the other side `name:Type` doesn't allow an IDE to suggest a name based on the type, because you type the name first. Also setting values looks pretty confusing. I claim writing the type before the name is much more readable. Compare
five: integer = 5
or integer five = 5
Re:Carbon Language: An experimental successor to C++
by notriddle on Tuesday July 26, 2022 @09:02PM
(#32245867)
> I claim writing the type before the name is much more readable. Compare
I claim writing the name first is much more readable. Compare
integer five = 5
or five: integer = 5
Re:Carbon Language: An experimental successor to C++
by nyanpasu64 on Tuesday July 19, 2022 @02:07PM
(#32155667)
It would make sense if Carbon started allowing omitting ": Type", which they currently don't: https://github.com/carbon-language/carbon-lang/blob/trunk/do...
Even better, when you start having more complex patterns on the left-hand side of `=`, you can type annotate them as you want. Hypothetical syntax would be:
That's harder to do when you have a type declaration on the left imho.