Native properties? Please not!

Seems like there are many opinions about native (language-level) property support for the Java language. I guess I am more the conservative type of programmer. I can’t figure out enough good reasons to add such a feature to the language without introducing a whole lot of possibilities to shoot yourself into the feet.

One of the cool things about properties (IMO) is that they are actually _not_ necessarily only getter and setter methods around field. If I understand it correctly, this is the whole idea behind properties. You can implement certain behaviour for properties (like, dynamically creating/fetching the property values). How would you do that if your property looks similar to a field? Ok, you could probably still write getters and setters, but this is where it starts confusing. And, honestly, auto-boxing, varargs, static imports, that is more confusion to the originally-clean language Java. I don’t need more of this.

But then again, maybe all those discussions will finally lead to a clean implementation of native properties. Then I will of course not stand against it. But please don’t add such half finished shit like it happened with auto boxing and some other things in jdk5. Ah, and did I already mention that I don’t like the idea of language-level XML support either? I mean, there’s JDOM, a couple of objectXML mappers etc. Who needs language level XML support then? But ok, this is another story…

About Roman Kennke
JVM Hacker, Principal Software Engineer at Red Hat's OpenJDK team, Shenandoah GC project lead, Java Champion

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: