The Artima Developer Community
Sponsored Link

Weblogs Forum
What Are Your Java Pain Points, Really?

264 replies on 18 pages. Most recent reply: Jan 17, 2008 10:07 AM by GJ sonke

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 264 replies on 18 pages [ « | 1 2 3 4 5 6 7 8 ... 18  | » ]
Mark Williamson

Posts: 14
Nickname: mjw
Registered: Jun, 2003

Re: What Are Your Java Pain Points, Really? Posted: Feb 12, 2007 5:15 AM
Reply to this message Reply
Advertisement
I stopped using Java in 2001 but there where three killer things for me:

The assumption that I am a moron and need protecting from myself

Verbosity - all of the declarations and guff that really the compiler can figure out (and when you go off and use dynamic languages you discover that sure enough compilers/interpreters *are* figuring this stuff out for themselves). Yes I know - use eclipse - but I still have to read the bloody stuff.

The Walled Garden. Java is great if you are talking to Java - when you go outside it gets harder and harder. Web services make this a bit easier* but really controlling java from other processes and working with other things from Java is a whole world of pain I am glad I don't have to live with anymore. Interestingly I gave up on Common Lisp for a very similar reason.


* this is also the things are more complex in java - In perl/python/ruby I can mess around with a program written in another language in a handful of lines of code. When I *need* to it can be scaled up - made a web service, add a more sophisticated API etc. In Java I have to go right in at the deep end. There is no sketch pad level.

Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: What Are Your Java Pain Points, Really? Posted: Feb 12, 2007 7:32 AM
Reply to this message Reply
> 1) Lack of interactivity in development environments. I
> recently had to update a java web service and was
> frustrated by my inability to write a two liner and run it
> to see what it did.

Set your project up to link to JMock and JUnit libraries (freely available), you can run Unit Tests on Java Projects,

I certainly haven't yet experienced any problem with checking Unit Tests.

> 2) Crappy and inconsistent api design. This consumes a
> LOT of extra time looking stuff up for every other line of
> code.

That's a matter of opinion.

> 3) Too much pointless boilerplate - too much typing to say
> too little. The stock answer to this is 'autocompletion'
> and 'tool support' but that's lame. When I say I can't
> walk, don't hand me crutches - fix my legs.

Check Intelli J's Idea (Ctl + Space or Ctrl + Alt + Space),
Check Eclipse (Ctrl + Space), that does you Auto Completion.

This post could have been avoided by a simple Google on Java IDE's and scheming through the User Manuals or Hot Key list.

Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: What Are Your Java Pain Points, Really? Posted: Feb 12, 2007 7:53 AM
Reply to this message Reply
Sorry the above Post is in reference to Todd's post and not the post in general.

Achilleas Margaritis

Posts: 674
Nickname: achilleas
Registered: Feb, 2005

Re: What Are Your Java Pain Points, Really? Posted: Feb 12, 2007 9:29 AM
Reply to this message Reply
Java is way too verbose. Most of the code of a Java app can be written in 1/10 of LOC in a declarative language.

Ivan Lazarte

Posts: 91
Nickname: ilazarte
Registered: Mar, 2006

Re: What Are Your Java Pain Points, Really? Posted: Feb 12, 2007 10:14 AM
Reply to this message Reply
I dont understand arguing against the tools, particularity when it comes to Java. To me this is like saying "i shouldn't need a crane to build a building, who needs skyscrapers anyway? i should only have to build small houses with hammers and saws."

Mark Williamson

Posts: 14
Nickname: mjw
Registered: Jun, 2003

Re: What Are Your Java Pain Points, Really? Posted: Feb 12, 2007 10:30 AM
Reply to this message Reply
> I dont understand arguing against the tools, particularity
> when it comes to Java. To me this is like saying "i
> shouldn't need a crane to build a building, who needs
> skyscrapers anyway? i should only have to build small
> houses with hammers and saws."

I think for me the verbosity is a big problem. A lot of Java advocates say use the tools and it will be all right - and in fairness Eclipse and the like *do* make Java considerably less painful.

But the thing is - you are still left with verbose code - even if you didn't need to type it. The number of Java programs that I have been through wondering - where is the program, seeing instead declarations and design patterns but very little code that *does* something as opposed to telling *me* what I ought or ought not to be doing.

And having left Java behind it is even more clear. Those same skyscrapers you claim you need a crane to build - well I am building things that scale just as well or better (in fact in one direct comparison where we replaced a Java component with a Python one the scale out point has been moved up considerably and I have one python box doing what three Java boxes where doing) and building them with simple lightweight tools - less things for me to need to know, less clutter in my environment.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: What Are Your Java Pain Points, Really? Posted: Feb 12, 2007 10:41 AM
Reply to this message Reply
> I dont understand arguing against the tools, particularity
> when it comes to Java. To me this is like saying "i
> shouldn't need a crane to build a building, who needs
> skyscrapers anyway? i should only have to build small
> houses with hammers and saws."

I don't think that's the idea. I think a more correct analogy would be saying you should need a crane to build a table and chairs.

A lot of these comments are basically saying that they wish Java was smalltalk or some other language. This is pointless. If you want these things, look to another language. These are things that are great for people who really know what they are doing but would make Java inaccessible to the average developer.

Having said that, as a Java developer these are the things that bother me the most (all have already been mentioned.)

1. The lack of closures and method pointers is a killer. It makes effective development strategies seem inelegant. Anonymous and inner classes are just too clunky and verbose for this purpose although they are useful in many contexts.

2. Generics is too complex and filled with gotchas. I don't think it's inherent, just a result of trying to maintain backwards compatibility.

3. Package scope is useful but hard to use. We need a more flexible way to give certain classes more access to others. I'm not sure 'friend' classes are the answer but something that fills that void is needed.

4. As some others have mentioned, beans are a plague on Java causing the frameworkitis that we are all familiar with. A reflective syntax is needed. I would say stop using beans but it's too late for that now.

Newton Hughes

Posts: 1
Nickname: feshenga
Registered: Sep, 2006

Re: What Are Your Java Pain Points, Really? Posted: Feb 12, 2007 12:43 PM
Reply to this message Reply
My main pain point is that i really hate JSPs. Maybe that doesn't count as part of the language, but it's a ubiquitous part of the platform. (btw: this is one area where RoR offers no great improvement, the RoR equivalent sucks just as bad.)
Requiring variables modified in an inner class to be final is pointless. i don't care if they come up with a less verbose closure syntax, i'm inured to klunky verbosity by now.
The java5 additions of generics, annotations, and enumerations needlessly complicated the language. Ken Arnold was right.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: What Are Your Java Pain Points, Really? Posted: Feb 12, 2007 12:58 PM
Reply to this message Reply
> Requiring variables modified in an inner class to be final
> is pointless. i don't care if they come up with a less
> verbose closure syntax, i'm inured to klunky verbosity by
> now.

Well, you can't modify local variables at all in an anonymous inner class (locals being the only variables that have to be final in this context.) You can only modify things that are on the heap in an anonymous inner class. Without changing this behavior, removing the final requirement would lead to a lot of confusion with no real benefit. You'd just have a local copy of the variable. You can do that now by declaring one.

I would actually like it if everything were final by default and had to be declared as modifiable. But that's not going to happen.

Frank Wilhoit

Posts: 21
Nickname: wilhoit
Registered: Oct, 2003

Re: What Are Your Java Pain Points, Really? Posted: Feb 12, 2007 1:14 PM
Reply to this message Reply
1) Garbage collection. Most important, the semantic issue. It is not possible to write object-oriented code without synchronous object destruction.

2) Garbage collection. Next in line, the argument from craftsmanship. It is *absolutely*necessary* for programmers to master their craft so as to be able to manage memory.

3) Garbage collection. Last and least, the unpredictable runtime impact.

Ivan Lazarte

Posts: 91
Nickname: ilazarte
Registered: Mar, 2006

Re: What Are Your Java Pain Points, Really? Posted: Feb 12, 2007 1:15 PM
Reply to this message Reply
Another - checked exceptions for common operations.
Josh Bloch has a good bit on this in a video somewhere where he discusses api design. This goes to the pointless boilerplate issue.

javier velilla

Posts: 1
Nickname: jvelilla
Registered: Aug, 2006

Re: What Are Your Java Pain Points, Really? Posted: Feb 12, 2007 1:21 PM
Reply to this message Reply
First we need Design by Contract

1. Extend the Java Language to support DbC
New keywords:
pre [predonditions (only apply to public features) they are inherited in or-conditions]
post [postconditions they are inherited in and-conditions]
invariants [invariants they are inherited in and-conditions]
old [they are used only in postconditions]
public class TimeOfDay {
 
    private int hour;
 
    private int minutes;
 
    private int seconds;
 
    public TimeOfDay(int hour, int minutes, int seconds) {                
        // Code Block : Precondition declaration
        // by default All method has a precondition, 
        // postoncistions with value equals true,
        pre { //lables are optionals
              valid_hour: hour >=0 && hour <=23;
              valid_minutes: minutes >=0 && minutes <=59;
              valid_seconds: seconds >=0 && seconds <=59; 
             }  
 
        this.hour = hour;
        this.minutes = minutes;
        this.seconds = seconds;
  
       // Code Block : Postcondition declaration
        post {
               hour == this.hour;
               minutes == this.minutes;
               seconds == this.seconds;
             }              
    }
 
    public TimeOfDay() {
    }
 
    public int getHour() {
        return hour;
    }
 
    public int getMinutes() {
        return minutes;
    }
 
    public int getSeconds() {
        return seconds;
    }
 
    public void setHour(int hour) {
        pre { hour >= 0 && hour <= 23 }
                            
          this.hour = hour;
          
       post { getMinutes() == old getMinutes()
             getSeconds() == oldgetSeconds() 
            } 
 
    }
    //Others Methods
    
    // Code Block: Invariant declarations
    invariant {getHour() >= 0 && getHour() <= 23;    
               getMinutes() >= 0 &&  getMinutes() <= 59;  
               getSeconds() >= 0 &&  getSeconds() <= 59;
              } 
}
 
   



2. Combine Exceptions with Design by Contract. [a la Spec#]
3. Combine DbC with Clousures

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: What Are Your Java Pain Points, Really? Posted: Feb 12, 2007 1:36 PM
Reply to this message Reply
> 1) Garbage collection. Most important, the semantic
> issue. It is not possible to write object-oriented code
> without synchronous object destruction.

How do you figure?

> 2) Garbage collection. Next in line, the argument from
> craftsmanship. It is *absolutely*necessary* for
> programmers to master their craft so as to be able to
> manage memory.

Based on what? Do you think Java programmers don't have to manage memory?

> 3) Garbage collection. Last and least, the unpredictable
> runtime impact.

Yawn. I don't believe this is a real problem. Do you actually use Java?

Morgan Conrad

Posts: 307
Nickname: miata71
Registered: Mar, 2006

Re: What Are Your Java Pain Points, Really? Posted: Feb 12, 2007 1:52 PM
Reply to this message Reply
Reviewing the complaints, there's one language request I agree with. I wish that static methods or constructors could be declared in an interface. For example, I'd like an interface Stringable for objects that can write themselves as a String and read themselves back in. (And, by extension, XMLable, ResultSetable, etc...) A lot already do this, via toString() and valueOf(). But valueOf() is static, so it can't be in an interface. I'd like to be able to declare something like


interface Stringable<T> {

public String toString();
static public T valueOf(String s);

(or, even cooler, declare a constructor)
public T(String s);
}




One poster wrote:

"The number of Java programs that I have been through wondering - where is the program, seeing instead declarations and design patterns but very little code that *does* something as opposed to telling *me* what I ought or ought not to be doing."

I've seen this too. But is this a Java issue, or a programmer issue? Sometimes I think that all the Pattern Books should be burned, cause too many programmers read a few pattern books and then apply all of those patterns to every problem, whether it makes sense or not. Then thay add an interface for every object. Then they use every 3rd party tool, such as Spring, AOP, JAXB whether it makes sense or not. The result becomes nearly incomprehensible.

Ivan Lazarte

Posts: 91
Nickname: ilazarte
Registered: Mar, 2006

Re: What Are Your Java Pain Points, Really? Posted: Feb 12, 2007 2:33 PM
Reply to this message Reply
I have to reiterate a gripe here- people are naming feature requests, NOT gripes, without anything to back them up!

It doesn't seem like people are really getting into the heart of working with Java or the JVM - instead most of this thread is playing armchair language designer.

Flat View: This topic has 264 replies on 18 pages [ « | 1  2  3  4  5  6  7  8 | » ]
Topic: What Are Your Java Pain Points, Really? Previous Topic   Next Topic Topic: The Future of Online Dialog


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us