5 ms·
I don't think it should be designed to save keystrokes at the cost of readability.
by ChrisSD 7y ago
I don't think it should be designed to save keystrokes at the cost of readability.
- jimmaswell 7y agoIt already does that elsewhere, yet strange backwards type definitions are much less readable by default to most programmers. It's like making us learn French when we could have learned British English, assuming American English as a starting point.
- ChrisSD 7y agoI think you have to be careful when presuming to speak for "most programmers".
- jimmaswell 7y agoHere, at least 40% of programminging is done in C style syntax. The rest isn't in any consistent majority style. Most programmers are probably most familiar with C style and almost all are familiar in some form. https://www.tiobe.com/tiobe-index/ https://www.tiobe.com/tiobe-index/
- a1369209993 7y agoI don't think anyone's disputing the claim that "strange backwards type definitions are much less [familiar]". We're saying that familiar is not the same thing as readable(-once-you-know-what-it-is), and that you're talking about the former, not the latter.
- Thorrez 7y agoPlenty of other languages including a large percent of recent languages have the return type on the right. Haskell, Visual Basic, Scala, F#, Go, (Rust), Kotlin, TypeScript, Swift. Even c++ allows you to put return types on the right. Why? Because putting the types on the right allows return type deduction. I think it's better to have a single syntax (all types on the right) rather than 2 syntaxes like c++ has. https://medium.com/@elizarov/types-are-moving-to-the-right-22c0ef31dd4a https://medium.com/@elizarov/types-are-moving-to-the-right-2...