A lot of newer languages seem to prefer the return type coming after the function declaration. I suspect some people believe it's better for newer programmers.
Whether or not that's true I don't know, but as someone who has a project that's written in C++ and Angular (Typescript), I will say that a lot of the typescript code tends to look cleaner aesthetically than the C++ does. Granted, the C++ is usually doing much more complicated things.
poster 1: A lot of newer languages seem to prefer the return type coming after the function declaration. I suspect some people believe it's better for newer programmers.
poster 2: The reason basically every new language does this is to make parsing simpler
poster 3: Make the parsing harder, then. Code is for humans, and trading off programmer time for compilation complexity is not a smart trade.
poster 4: Making compilation faster saves programmer time.
me, joking: rust uses this modern syntax, I don't think it has "faster compilation"
you, whooshing: That has nothing to do with the syntax.
-7
u/ShakaUVM i+++ ++i+i[arr] Sep 17 '22
Does rewriting C++ to look like Rust make it as safe as Rust? Why not leave the syntax alone? I don't like return values after functions.