aspose file tools*
The moose likes Java in General and the fly likes what features of java need further improve ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "what features of java need further improve ?" Watch "what features of java need further improve ?" New topic
Author

what features of java need further improve ?

Alvin chew
Ranch Hand

Joined: Jan 08, 2004
Posts: 834
hi, was wondering since java are so powerful currently, are there any features that sun should taking care on further enchance or improve it ?
Cay Horstmann
author
Ranch Hand

Joined: Nov 14, 2004
Posts: 115
    
  11
Well, there is always something extra one wants, right? That's why SUVs get bigger every year...

I agree with you that the language and library seems pretty complete. Hopefully, Sun will focus future JDK versions on making programmers' lives simpler and more productive.

If I could ask for one thing, it would be properties, like in VB and C#. I am tired of coding getFoo/setFoo. I know that Eclipse could do it for me, but it's not the same thing--I still have to read all that code.

If I could ask for one more thing, it would be better syntax for trivial inner classes. I hate

myButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { /* ok, what did I want to put in here? */ });

Another thing that I see cropping up in scripting languages such as Groovy is a more compact notation for lists, maps, and so on. That sounds like a good thing too.

I'd like to know how others feel about this issue? Do we need more libraries? Do we need more convenience built into the language? What would you ask for if you had three wishes?

Cheers,

Cay


Author of Java 8 for the Really Impatient
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982

Another thing that I see cropping up in scripting languages such as Groovy is a more compact notation for lists, maps, and so on. That sounds like a good thing too.

Scripting language, just like some short forms, in fact is simplifed for developers to write codes, however, the compiler will still transform it back to old-day-style Java codes, isnt it? I have this feel from the experiences of JSP scriptlet and Servlet codes.

Even though it does not affect run time performance, but compiler developers might need more effort to parse and perform the transformation.

Nick


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Mark Neher
Greenhorn

Joined: Apr 28, 2004
Posts: 9
My pet peeve has always been the clunkiness of formatting. Coming from a C background, I've missed the power and simplicity of printf/scanf type statements.
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Originally posted by Mark Neher:
My pet peeve has always been the clunkiness of formatting. Coming from a C background, I've missed the power and simplicity of printf/scanf type statements.

I think I have to agree with this. Fortunately, this feature is now included in Java 5!

As for my wish list, a simplified I/O system would be nice. Don't get me wrong, the current java.io package provides a lot of power and flexibility. However, when you are starting to learn Java, it is quite overwhelming.

Layne


Java API Documentation
The Java Tutorial
Matthew Gerring
Greenhorn

Joined: Nov 18, 2004
Posts: 3
Perhaps SWT / Jfaces in the core Java distribution? Then GUIs would really start to compete with other toolkits. Perhaps this is already slated for a later release of Java?
Jayesh Lalwani
Ranch Hand

Joined: Nov 05, 2004
Posts: 502
Originally posted by Cay Horstmann:


If I could ask for one more thing, it would be better syntax for trivial inner classes. I hate

myButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { /* ok, what did I want to put in here? */ });


I like the .NET way of declaring methods as event handlers. So, if Java supports that, then the above will look like this

public void buttonActionPerformed(ActionEvent event)
{
// do what I want to do
}

myButton.addActionListener(buttonActionperformed)
Cay Horstmann
author
Ranch Hand

Joined: Nov 14, 2004
Posts: 115
    
  11
But I like inner classes better than .NET delegates because I can reference final local variables from an outer scope (i.e. they are closures).

If you don't care about that, you can use EventHandler in Java:



Maybe we could lobby Sun to add a convenience method to EventHandler, like this:



Cheers,

Cay
Jayesh Lalwani
Ranch Hand

Joined: Nov 05, 2004
Posts: 502
Yes, I agree that inner classes have advantages over .NET style event handlers, like being able to acces final local variables. But, inner classes are just too darn hard to read. Also, I have seen many newbies get confused by the inner clases. If you just casually glance at the code it looks like the implementation of the inner class is part of your function, but it's not.. well it is..sort of.

Inner classes definetly have their uses. I'm not saying Java should'nt remove Inner classes. However for most implementations, the listener function can be easily put in a private class level function. It makes the code much easier to read

Usually, unless one of my developers has a good reason to do otherwise, I recommend them to do something like this



compare that with this



Now if someone is glancing through the second version, it looks like "int i" is part of function "setup".. which it's not
[ November 18, 2004: Message edited by: Jayesh Lalwani ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what features of java need further improve ?