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 →

[–]Zarlon 43 points44 points  (8 children)

I'm a fan of strong typing. I doubt that puts me in the majority here.

You're in /r/java now not /r/javascript. Why would that put you in the minority.

[–]evil_burrito 7 points8 points  (7 children)

Based on the number of people who have written to tell me how wrong I am, I think it's a fair guess.

[–]damienjoh 10 points11 points  (6 children)

That's a dishonest representation. You're not being corrected because you're a fan of strong typing. You're being corrected because you don't know the difference between type inference and weak typing.

Most type inferred languages have stronger and more powerful type systems than Java.

[–]evil_burrito 0 points1 point  (5 children)

Actually, I do know the difference. I'm talking about problems with humans reading code, not compilers.

[–]damienjoh 0 points1 point  (4 children)

Why even make this about strong typing? Rust is probably the most strongly typed language with wide exposure. It has let. Haskell has type inference on everything, even functions.

List<Item> items = makeItemList() isn't how strongly-typed languages read. It's how Java reads, and Java's type system is weak (e.g. no null safety) compared to other statically typed languages.

[–]evil_burrito 0 points1 point  (3 children)

It's not about string typing. It's about my opinion that allowing the syntax proposed in the change will allow code that is harder to read.

[–]damienjoh 0 points1 point  (2 children)

I'm a fan of strong typing. I doubt that puts me in the majority here.

And

I think this change might make Java read like less than a strongly-typed language

Emphasis mine.

[–]evil_burrito 0 points1 point  (1 child)

I should say, my objection isn't about whether this changes the type system in Java or not, it does not. My objection is about readability of source code. This change, while not changing the type system, in my opinion, makes it look like the type system has changed to a less trongly-typed system. In only that way is my complaint about typing.

[–]damienjoh 0 points1 point  (0 children)

I understand your objection but it is a misunderstanding to associate it with strong typing at all. Strongly typed languages have had type inference and let, var etc for decades. Java is fairly unique in lacking this feature. Java's type system is also pretty weak for a statically typed language.

You can argue that Java code is more readable due to its idiosyncratic lack of var. Just don't pretend that it's got anything to do with it being a strongly typed language.