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 7: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 ... 6 7 8 9 10 11 12 13 14 ... 18  | » ]
James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: What Are Your Java Pain Points, Really? Posted: Feb 15, 2007 3:03 PM
Reply to this message Reply
Advertisement
> The #1 pain point though: too much choice. Too many
> frameworks and even low level toolkits. Sort of like PHP,
> in fact Java is its own ecosystem. Java is much better
> designed than PHP, but PHP is much easier to get into, so
> people spec'ing projects are preferring it, from what I've
> noticed. If there were fewer choices then there wouldn't
> be so much to explain, it wouldn't take people months to
> get up to speed, they wouldn't give up even though the
> answer is in the stack trace in front of them.

The real problem here is thinking that PHP and Java address the same problem domain(s). Java is a actually much better at a lower level than I think most people realize. PHP can be written in Java. In fact there's already such an implementation.

http://www.caucho.com/resin-3.0/quercus/index.xtp

Really PHP is more comparable to JSP than it is to the Java language.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: What Are Your Java Pain Points, Really? Posted: Feb 15, 2007 3:04 PM
Reply to this message Reply
> PHP can be written in Java. In fact there's
> already such an implementation.

I mean a PHP interpreter can be written in Java. The above doesn't make sense.

david m

Posts: 4
Nickname: davidm
Registered: May, 2006

Re: What Are Your Java Pain Points, Really? Posted: Feb 15, 2007 3:27 PM
Reply to this message Reply
> Really PHP is more comparable to JSP than it is to the
> Java language.

Yes, that is true, but JSP is backhandedly promoted in the Java world, everyone tries to corral you into their solution which is so much better. So people walk away from Java as a whole.

Just because you could write PHP in Java doesn't mean people won't just use PHP in the first place. Then you lose all the advantages of using the (essentially) same language end to end, and critical mass builds up elsewhere.

I can see the polyglot approach working in the long run, with other languages running in/alongside the JVM, but only if the Java runtime is pleasanter to work with.

Jonathan Lehr

Posts: 18
Nickname: jlehr
Registered: Jan, 2004

Re: What Are Your Java Pain Points, Really? Posted: Feb 15, 2007 4:10 PM
Reply to this message Reply
> I'd guess that, in general, my programs would run slower
> with dynamic binding because there would be more time
> spent deciding what method to call. With overloaded
> methods, it's necessary to check all the types of all the
> arguments and that includes classloader comparisons and
> several other steps which go beyond a simple "method by
> name is implemented" check.

I think method overloading is an incredibly bad idea, exactly because it introduces this sort of complexity while providing almost nothing in return. Even in the current language, reflection/introspection has all this expensive, added baggage, which exacts a significant performance penalty and greatly complicates the API.

On the other hand, there are optimizations that can be done to reduce some of the overhead, but I agree that classloaders do complicate the picture.

> I'm a fan of interfaces. The only thing that they add is
> more keystrokes to type in the definition of a class.
> After that, they provide type safe declarations that
> t allow you to not have to worry about whether something
> will resolve and actually work in the environment it is
> run in.
>
> Maybe you can share why interfaces don't work for you?

That's neat if you're the only one writing the code. Most of the projects I've worked on are more complicated than that, often involving integrating code from other project teams and third parties that may not have access to my interface.

> I hear a lot of people talk about how many keystrokes or
> how much text. If keystrokes and text bulk were not the
> issue, what would the real issues be that would make
> dynamic typing really work better?

OO Design, or the lack thereof. Most of the Java projects I've personally witnessed -- including massive ones with budgets of hundreds of millions of dollars -- have suffered from astonishingly poor design. Many of them have failed utterly. That's real pain for you!

> I'm not having any problems using Java to solve a large
> number of problems.

The question in my mind is not whether or not individual developers feel they're able to use the language; it's whether Java is helping or hurting when it comes to software development in general.

Jonathan Lehr

Posts: 18
Nickname: jlehr
Registered: Jan, 2004

Re: What Are Your Java Pain Points, Really? Posted: Feb 15, 2007 4:21 PM
Reply to this message Reply
> I suspect that you are in the SmallTalk camp from your
> comment here. If you are trying to use SmallTalk style
> approaches in Java, you are going to be very disappointed.
> JavaBeans are a perfect example of this.

I'm from the Objective C camp, but I've been doing Java exclusively for the past six years.

> If you are trying to use SmallTalk style
> approaches in Java, you are going to be very disappointed.

I can't agree with you there. In fact, I attribute most of whatever success I've been able to achieve in Java to approaches I've learned from NextStep and WebObjects. These ideas transcend mere language differences. (Note that WebObjects is a pure Java framework).

> My personal feeling is that instead of trying to retrofit
> Java to be a dynamic language, using dynamic languages in
> that can interact with Java is more likely to be
> successful.

On the other hand, the more languages you add to the mix, the more complicated things get. I guess a lot depends on the scale of the project though; I get the sense that most of the folks who are happy with Java are working on tiny projects.

Jonathan Lehr

Posts: 18
Nickname: jlehr
Registered: Jan, 2004

Re: What Are Your Java Pain Points, Really? Posted: Feb 15, 2007 4:34 PM
Reply to this message Reply
> Maybe it's possible to allow statically typed programs to
> run within a dynamically typed Java VM.

It is.

> But I just feel
> this kind of change would be such a dramatic shift from
> the fundamentals of Java, it being a strongly-typed OO
> language. Once you switch to dynamic typing, you have
> moved yourself into another language, imo.

Nope, just the same language with an additional feature. How is this fundamentally different from adding generics or closures to the language, for example? Having a mix of strong and weak typing lets me choose whatever's appropriate to the problem at hand. Enforcing strong typing simply takes a tool out of my tool chest. I don't see the advantage in that.

> Unless it's possible to "simulate" dynamic typing with a
> strongly typed compiler...

But then why would you want to? Reminds me (at the risk of dating myself) of an oldie that was a huge hit once upon a time: "There Ain't Nothing Like the Real Thing, Baby." Dynamic binding is powerful because it allows the method implementation to be resolved at runtime. It has nothing to do with guessing an object's type -- the whole point is to make the object's type irrelevant in a given context.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: What Are Your Java Pain Points, Really? Posted: Feb 15, 2007 5:10 PM
Reply to this message Reply
> That's neat if you're the only one writing the code. Most
> of the projects I've worked on are more complicated than
> that, often involving integrating code from other project
> teams and third parties that may not have access to my
> interface.

If they are providing the code, they should be providing the interface. How does dynamic binding help with this? You still need to map their method names and structures to yours and vice versa with dynamic binding.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: What Are Your Java Pain Points, Really? Posted: Feb 15, 2007 5:23 PM
Reply to this message Reply
> Dynamic binding is powerful because it allows the method
> implementation to be resolved at runtime. It has nothing
> to do with guessing an object's type -- the whole point is
> to make the object's type irrelevant in a given context.

You still end up with the concept of an interface though. It's just not checked until runtime (when something fails because a required method isn't there.)

I often find this convenient but often I find it to be a big pain, like when I modify a design. With strong typing, it's straightforward to modify code to handle changes in other classes so much so that it can be automated. With weak-typing it's pretty much ad hoc.

I like dynamic typing in certain contexts but I can't ignore the cost of it.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: What Are Your Java Pain Points, Really? Posted: Feb 15, 2007 5:24 PM
Reply to this message Reply
> > If you are trying to use SmallTalk style
> > approaches in Java, you are going to be very
> disappointed.
>
> I can't agree with you there. In fact, I attribute most of
> whatever success I've been able to achieve in Java to
> approaches I've learned from NextStep and WebObjects.
> These ideas transcend mere language differences. (Note
> that WebObjects is a pure Java framework).

So you don't have a problem with Java's lack of dynamic binding but you want it added?

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: What Are Your Java Pain Points, Really? Posted: Feb 15, 2007 5:52 PM
Reply to this message Reply
> > My personal feeling is that instead of trying to
> retrofit
> > Java to be a dynamic language, using dynamic languages
> in
> > that can interact with Java is more likely to be
> > successful.
>
> On the other hand, the more languages you add to the mix,
> the more complicated things get. I guess a lot depends on
> the scale of the project though;

I completely disagree with this. I find it much more complex to work with languages that try to address too many problems than to use focused, well-integrated tools. I wouldn't want Java to be attempt to be a database querying language. I'd much rather use SQL in addition to Java. I also don't eat with a spork. I use a separate spoon and fork.

I also think you are kidding yourself if you think a framework like WebObjects isn't adding another language to the mix. I really don't see how using XML or something similar to coordinate Java Objects in an dynamic way is any different than using a dynamic language like Jython to coordinate Java Objects in a dynamic way. (Note that Jython is a pure Java application.)

> I get the sense that most
> of the folks who are happy with Java are working on tiny
> projects.

Most of the time I hear this kind of statement it's in the other direction. Can we dispense with the unsupported rhetoric?

I thought you weren't disappointed with Java anyway.

Mitchell Stewart

Posts: 7
Nickname: mstewart
Registered: Jan, 2006

Re: What Are Your Java Pain Points, Really? Posted: Feb 15, 2007 5:56 PM
Reply to this message Reply
> Nope, just the same language with an additional feature.
> How is this fundamentally different from adding generics
> or closures to the language, for example? Having a mix of
> strong and weak typing lets me choose whatever's
> appropriate to the problem at hand. Enforcing strong
> typing simply takes a tool out of my tool chest. I don't
> see the advantage in that.

I think that it's different because generics were added within the context of a strongly typed language. I think they even enforce the idea even more, because now developers are expected to maintain the same type of object within a collection, for instance. As for closures, I can't really comment because I haven't been following it too much, but I would only assume that the idea of strong typing will play directly into the implementation of closures.

As for mixing...what would that look like? On one hand you could write a Java program that uses no types, but on the other you could write one that is strongly typed? I'm not sure if the ideas mix well, if you are interested in executing methods regardless of type, how could there ever be compiler errors for mis-matched method calls and/or method parameters? Would there ever be? Wouldn't that defeat the purpose of having a strongly-typed option?

Jonathan Lehr

Posts: 18
Nickname: jlehr
Registered: Jan, 2004

Re: What Are Your Java Pain Points, Really? Posted: Feb 15, 2007 6:19 PM
Reply to this message Reply
> If they are providing the code, they should be providing
> the interface. How does dynamic binding help with this?
> You still need to map their method names and structures
> s to yours and vice versa with dynamic binding.

Ah well, at the risk of being tedious:

The problem is that If an interface is defined in product A, and product B doesn't consume A, then B can't provide components that conform to the interface. However, B could provide components that support the same APi (though not formally). Compile-time checking the API against an interface makes things quite awkard in this and similar situations.

As you point out, there needs to be agreement (though this can be after the fact) on method names, though typically such methods would have arguments (if any) of common Java types (e.g., Object, String, Map, List, int, float, etc.), so structure would not enter into the picture.

Jonathan Lehr

Posts: 18
Nickname: jlehr
Registered: Jan, 2004

Re: What Are Your Java Pain Points, Really? Posted: Feb 15, 2007 6:35 PM
Reply to this message Reply
> You still end up with the concept of an interface though.
> It's just not checked until runtime (when something fails
> s because a required method isn't there.)

Exactly, and that's one of the reasons I think Java needs to streamline reflection. As I posted earlier, there ought to be a simple API to call on the Object class to ascertain whether it implements a given method, which would make it easier to check at runtime before attempting the call.

> I often find this convenient but often I find it to be a
> big pain, like when I modify a design. With strong
> typing, it's straightforward to modify code to handle
> changes in other classes so much so that it can be
> automated. With weak-typing it's pretty much ad hoc.

Yep. Pretty much everything in programming is a trade-off. The art is in making the right ones.

> I like dynamic typing in certain contexts but I can't
> ignore the cost of it.

I agree -- in general, we should try to be conscious of the ramifications of development decisions, and weigh costs and risks carefully. Dynamic binding is a powerful tool, but one that should be used judiciously.

Jonathan Lehr

Posts: 18
Nickname: jlehr
Registered: Jan, 2004

Re: What Are Your Java Pain Points, Really? Posted: Feb 15, 2007 6:43 PM
Reply to this message Reply
> So you don't have a problem with Java's lack of dynamic
> binding but you want it added?

I have paid a very hefty price for Java's lack of dynamism, which is why for me it's a pain point.

Jonathan Lehr

Posts: 18
Nickname: jlehr
Registered: Jan, 2004

Re: What Are Your Java Pain Points, Really? Posted: Feb 15, 2007 7:04 PM
Reply to this message Reply
> I wouldn't want Java to be attempt to be a database
> e querying language. I'd much rather use SQL in addition
> to Java. I also don't eat with a spork. I use a separate
> spoon and fork.

In my experience, most projects are better off using an ORM's Java API than hand-coding stuff in SQL. But my point is simply that generally speaking, adding more languages increases a project's complexity. It's one of those programming tradeoffs that ought to be weighed carefully.

And I'm glad you don't eat with a spork. Personally, I always found them sort of unwieldy. ;-)

> I also think you are kidding yourself if you think a
> framework like WebObjects isn't adding another language to
> the mix.

Not kidding myself. WebObjects is a framework, not a language.

> I really don't see how using XML or something
> similar to coordinate Java Objects in an dynamic way is
> any different than using a dynamic language like Jython to
> coordinate Java Objects in a dynamic way.

You totally lost me here. Does this have something to do with WebObjects?

Flat View: This topic has 264 replies on 18 pages [ « | 6  7  8  9  10  11  12  13  14 | » ]
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-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use