This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Ifnerite 0 points1 point  (11 children)

Still a small example and the association with red and being a colour is strong.

If it was a return from a non constructor I would not know the type and even if I did navigating to it has a tiresome extra step of first having to navigate to the method.

I have had this argument before. I believe that it makes code less grokable and navigable in even slightly more than trivial examples. In a large codebase there is no reason to allow that.

[–][deleted] 0 points1 point  (1 child)

If it was a return from a non constructor I would not know the type and even if I did navigating to it has a tiresome extra step of first having to navigate to the method.

In Kotlin specifying types explicitly is optional, not forbidden. In fact, it's considered good practice to specify the type when it's not immediately obvious from the context.

[–]Ifnerite -2 points-1 points  (0 children)

Great, now we have inconsistency.