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

Show parent comments

1

u/[deleted] Mar 10 '16

[removed] — view removed comment

3

u/Northeastpaw Mar 10 '16

You're conflating terminology across languages. An interface in Java is a very specific thing. Yes, in general computer science interface means different things, but if Java developers are talking about an interface they almost always mean public interface Foo. Trying to change the contextual definition of interface doesn't help anybody.

Furthermore, you're in /r/java, not /r/csharp. Languages will have their own conventions. Complaining that Java doesn't follow C# conventions is asinine and a waste of everybody's time here. There's certainly room for improvement in all languages by looking at what other languages have done, but such changes have to be carefully considered and implemented as to not break backwards compatibility (which I will admit Java doesn't have a completely stellar record of).

You can also see how it evolved over time, with the public interfaces gaining new methods without breaking backwards compatibility by changing the abstract interfaces. (Unlike JDK, which still pisses me off.)

Java 8 provides default methods to do exactly this.

-1

u/[deleted] Mar 10 '16

[removed] — view removed comment

2

u/[deleted] Mar 10 '16

Computer science is still computer science regardless of which language you use to represent it

and equivocation is still equivocation...

1

u/evil_burrito Mar 10 '16

I agree that if one doesn't get the purpose of interfaces, Java is going to be a lot of fun for anyone.

Interestingly, since I'm not a C# guy, don't work on Windows, and don't have the Microsoft Family of Products ready and willing to display System.Data in all its interactive finery, I would have to just download the source of System.Data to look at it. And I would probably look at it in Emacs. I hope there isn't a lot of stuff defined with "var" in there.

1

u/[deleted] Mar 10 '16

[removed] — view removed comment

1

u/evil_burrito Mar 10 '16

Perhaps they have internal coding standards about using var. I know that I'm a lot more lax in terms of structure, encapsulation, all that, when writing tests.