Re: the Java Lang will support Properties in Futuere?



mttc wrote:
As other criticism on Java, Properties is also big missing. Many say
what problem with get or set?
the answer is simple. it's true! the get and set it's good. The
problem is when we use it:

i=s.getX();
s.setX(i);

why Java (after so many years) not able to give us simple code (as
Delphi):

i=s.X;
s.X=i;

The benefit of the latter form is more circumspect. In the three languages that I have experience with where this feature is implemented--PHP, (Mozilla) JavaScript, and python--I have found this to be a barrier to comprehension at least once in each language, often times multiple times.

I don't profess to know all the use-cases for Java programming, but I've never really felt such a feature to be needed. At least in the projects I've mucked around in, writing getters/setters for everything naïvely tends to be frowned upon. The boilerplate it would reduce is small, but then again, most of the same cases can be made against the for-each loop.

If your main reason for proposing feature inclusion is "XXX language has it," I recommend you just drop the idea. Why not include all those nice features that Cobol has, then?

There have many debate and page on the Internet. I say to java Leaders
do what developer ask!

Let's see what developers think. According to <http://www.javapolis.com/confluence/display/JP07/Whiteboard+results+-+Language+change> (the site seems to be down, so I checked the Way Back Machine)... hmm, the information is in images which are presently inaccessible.

Looking around on Google, I get this summary of results (<http://www.jroller.com/scolebourne/entry/voting_on_java_7_language>):
There was some support for Better null handling (with a new operator) and Properties. The balance was slightly against, but not overwhelming.

Recalling from memory, I think there was a fair number of "don't care votes," but don't hold me to that.

So it seems that developers aren't as gung-ho about the feature as you imagine.

I see the Bean-Properties Project, it's seem very poor solution. the
correct way is do it in the lang itself. but Java Guys not going to
confess on this big mistake. therefor we continue wasting time to
search right set or get from long members list. or typing extra dots
and parenthesis (or yield.. ).

I only use IDE autocompletion when I can't remember the name of a method.

Your complaint about having to view too many members in a list doesn't really make sense (you'd have just as many properties as you did getters...), and having to type 5 extra characters (4 for the setter) isn't exactly overwhelming, since that would be less than the average property name.

Java has undeniably bigger mistakes--not making int an object is one (mostly ameliorated via auto-(un)boxing), and the lack of generics reification is another. In both cases, certain tasks become actually impossible without having to throw more stuff around, as opposed to the lack of a properties where the workarounds consist of typing a few more characters.

--
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth
.



Relevant Pages

  • Re: Reddit Guys on the Pros and Cons of Lisp
    ... >> I never have to do that with Java. ... > language features, etc. ... They either have the feature or they don't. ... > libraries doing almost the same - for those languages. ...
    (comp.lang.lisp)
  • Re: Some thoughts on VB9
    ... A Document Outline for code that displays #regions as well as groups members ... feature but that's pretty much the extent of refactoring in VB2005. ... is for good reason that VB developers have a bad rep.... ... VB developers who are serious about the language wrong. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: my mother wants to code?
    ... C is a pain in the ass, with compilation and link problems, the associated makefiles, memory management etc etc, but IMHO if you want to be a decent programmer, you have to know enough C to be able to appreciate differences in other languages ... I'd have said any functional language, but Haskell seems to be the newest functional language so it's probably the most relevant to the current state of programming ... Nice environment, but material teaches bad practice, very few .Net developers know anything about unit testing, scripting builds ... y or z (Have you tried to run any tutorial for Java Web development ...
    (comp.lang.ruby)
  • Re: Why default parameter values where not included in Java
    ... If you create a language with a bunch ... Sun wanted to encourage fast adoption of Java by a very large group ... The issue is not whether the feature could save a few lines of code. ... and the reasons of various team members ...
    (comp.lang.java.programmer)
  • Re: is perl obsolete?
    ... developers share the language designers' views. ... Java developer. ... what an object model is after I had asked them to explain some aspect ...
    (comp.lang.perl.misc)