r/java • • Mar 09 '16

var keyword proposed for Java

http://openjdk.java.net/jeps/286
240 Upvotes

312 comments sorted by

View all comments

74

u/evil_burrito Mar 09 '16 edited Mar 10 '16

I think one of the problems of untyped or weakly-typed languages is that they can be difficult to debug or understand somebody else's code.

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

Edit: I'm simply stating a personal preference here: I think this will decrease the readability of source code. We don't all have to agree.

Edit: I can see how my original comment was poorly worded. I didn't mean to say, "I think this change will make Java less than a strongly-typed language", I meant to say, "I think this change might make Java read like less than a strongly-typed language".

1

u/[deleted] Mar 10 '16

Man, I switched to week-type language in my days jobs. It's fun, I'm learning. But at least once a day I miss something that can only be accomplish with strong type. ( Project wide refactor, Changing data model... )

3

u/evil_burrito Mar 10 '16

There you go - exactly. Making a change that ripples through a multi-person project is one of the flaws of a weakly-typed language.

3

u/[deleted] Mar 10 '16

Yeah. It's takes rigor and discipline. Where in a Strongly typed one its only takes a compiler. Why the downvotes ? Anyway...

3

u/evil_burrito Mar 10 '16

I'm not worried about understanding my own code (to the writing of which I could faithfully apply rigor and discipline). I'm worried about understanding the code of that one guy. You know him.

3

u/s888marks Mar 10 '16

Yeah, I know that guy. He wrote some terrible code a year ago, and he was quite inexperienced -- he had a year less experience than me when he wrote it. Oh, and he has the same name as me.

3

u/evil_burrito Mar 10 '16

No kidding. I swear, some of the worst code I've run across... checks SVN annotate ...shit.