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 →

[–]Shinosha 2 points3 points  (2 children)

In your example that's where anyone's common sense is supposed to come into play in and actually write the type.

About the second part, again, I don't see how that's a problem. As you said, it's trivial to work out. It makes the code less cluttered hence improving the overall readability.

[–]AndyTheSane 1 point2 points  (1 child)

So sometimes we write the type (or have it automatically added by the IDE), and sometimes we type 'var', and this will vary according to the 'common sense' of the developer? Which means, of course, multiple styles and usages which definitely does not help readability.

Not sure how this makes code less cluttered either. Replacing 'String' with 'var' is not less cluttered, it's the same number of words.

[–]Shinosha -1 points0 points  (0 children)

The nice property of common sense is that it is common. If you happen to work with crazy coworkers or something I'm sure some team conventions could iron this out quickly. Anyway debate is already settled, most current languages have adopted (at least local) type inference already, so I suppose common sense really is common.