The next release of Java (Mustang) has some significant enhancements for desktop usage, including improved OS L&F, text anti-aliasing modes, more and improved graphics hardware usage, threading improvements, etc. Also, some long term bugs are fixed (like gray rectangle issue). See a full list and details.
Sun is really loosening up, I’m glad to see it. They added access to nightly builds now of the JDK right as soon as they started on 6.0. Now with a java.net account you can submit bug fixes directly against the JDK and have them incorporated… I’d say if this situation becomes successful that most people constantly complaining about OS’ing Java would be happy, since the majority of developers that hate the closed nature of Java simply want their damn bugs fixed (or I am atleast speaking for myself).
These new desktop improvements, especially the true double buffering really give a fantastic impression of desktop apps. I was playing around with NetBeans 4.1 trying to get it to repaint and gray out… really nice overall percieved improvement in speed, you’d swear it was faster (maybe it is?).
java is realy starting to move in the right direction and it moving there fast
Sounds like they’ve learned from SWT and finally decided to let the native toolkit render widgets.
From Excelsior Jet web site
“…We plan to provide JRE-independence in the next versions using Sun Community Source License…”
This will be the killer. Imagine any java application compiled natively to Win/Linux working without jre!
The point here is not the speed (hotspot is ok), but easy deployment. I have recently been asked to do a simple utility and it took me several hours to do in java (nothing special several buttons, text area, progress bar, socket communication and one resource file to send over the net)…
So the story:
Q: I don’t like to put “java -jar utility.jar”
A: I made the jar executable – just click over it…
Q: But user wont undestand it – It must be an exe…
A: Well I made a launcher – it’s utility.exe
Q: Yes, but I still need a jre installed…
A: I can embedd jre inside…
Q: Are u crazy??? I don’t want jre!!!
A: I changed it to swt and compiled to exe – it’s small now…
Q: Yes, but I have no idea in java, I just do not understand your code. I wish it in c++ with winsock and MFC!!!
A: OK. you’ll get it (but from the moment I’m starting to look for a new job…)
Good luck java!!!
looking good with the java features, its starting go the right direction, and actually putting features that ppl have requested.
it won’t be long before even SWING looks native on KDE and GNOME as longhorn is already being implemented!
it won’t be long before even SWING looks native on KDE and GNOME as longhorn is already being implemented!
I wouldn’t hold my breath. Swing has had “improved OS L&F” in its releasnotes since around 1.4.0. And it still looks like crap.
apart from horrible responsiveness (giving the ignorant masses the idea that java is “slow”), its far too overengineered. if you were building a massive app, it may make sense, but even for trivial things it requires an insane amount of work to get a gui up and running. and adapters with anonymous classes are a total hack.
heres a question, why is AWT stuff on the sun project plan? i thought sun liked to pretend awt didnt exist.
@rsk: amen to that.
@anonymous: swing already has support for looking like windows, mac, or gnome via its internal themeing engine (pluggable look and feels, or PLAF). what they are talking about is making it actually use more of the underlying technology (the way swt does) for more consistancy.
did you read the article?
java -jar all.jar is old. I deploy my *local* desktop apps with java web start. Just code the jnlp file (it is easy) and do javaws file.jnlp or associate jnlp extension with javaws. Easier than writting a bat file.
And your user seems like a pain in the ass, why do they care if it is java/swing or c++/MFC, just use the tool or code it yourself.
Take a look at JGoodies:
http://www.jgoodies.com/
Looks fine to me.
JGoodies is a good attempt, but given the godawful font rendering in all jdks to date there’s really only so much you can do.
The real crappy looks are reserved for the attempts at “native” L&Fs in Swing, though. On GTK+ I can’t even tell for sure which GTK theme they are trying to emulate.
In particular, font rendering really hurts if you’re trying “look native”. Java uses some home-grown font rendering mechanism, rather than Microsoft’s/freetype’s. And text is a really big part of the look.
it won’t be long before even SWING looks native on KDE and GNOME as longhorn is already being implemented!
I wouldn’t hold my breath. Swing has had “improved OS L&F” in its releasnotes since around 1.4.0. And it still looks like crap.
Actually, I would be happy if it just worked on the Linux desktop, the looks is a distant second.
Java swing is only cross platform as long as you run it on windows. On Linux you can’t make full use of your keyboard unless you use an US keyboard and US locale settings. In most European languages one or more keys are untypable.
For more info, see:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4799499
What’s the point of using java if you only can use it on windows?
Well, seems they are working on that one.
“Feature: Input in non-English locales
Bug IDs: 4360364, 4490692, 5033605, 5064016, 4725203, 5057184, 4957565, 4960727, 5014911, 4799499
Delivered: In-development
Description: This is basically a big bug-fix. We are well aware that the input in non-English locales on Linux/Solaris is sometimes just impossible, and we are working on resolving the various issues. We have refactored our code and fixed important internal design flaws that were causing those problems. Once we have integrated these fixes, we invite you to test the changes in your favorite locale and file a bug if it still does not work for you; if we find out about the problems early enough, we may be able to fix them in Mustang as well.”
mattb
This is a Hello World GUI in Java:
import javax.swing.JFrame;
import javax.swing.JLabel;
public class HelloWorld {
public static void main(String[] args) {
JFrame frame = new JFrame(“Hello, World!”);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.add(new JLabel(“Hello, World!”));
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
}
(Excuse the lack of indenting.)
It’s pretty trivial, and it only takes 15 lines of code. Very readable and clear code. I have a hard time seeing how this is an insane amout of work.
Anonymous class a total hack? How so? C++ has inner classes. I’m guessing C# does too. Anonymous classes are just inner classes with no names. A class declaration as an expression. Don’t like it? Then use regular inner classes. Or just implement ActionListener and pass this to your addActionListener call. Then actionPerformed is just another method in your class.
I find that Java is an incredibly elegant language and development platform. It gets such a bad rap that I really don’t think it deserves. I love programming in Java. And I’ve done my large share of C and C++ programming too. But I always find myself running back to good old Java.
Fonts are a big problem, but, have you read the article? Finally, after years of assuring us that Java fonts are “good enough”, Sun guys started to address all of the annoying little ugly things, starting with “adding kerning to text layout process” which is available in b33 for you to download. It seems that ClearType (aka subpixel) AA is high on the list too, with some other important tunings. If all goes well, we will finally have nice looking fonts across all platforms in Java.
“I find that Java is an incredibly elegant language”
*cries* pleeeeease, go and learn something that is truly elegant, like python, ruby, smalltalk, lisp etc. you will really change your opinion about “incredible java elegance”
I find that Java is an incredibly elegant language and development platform. It gets such a bad rap that I really don’t think it deserves. I love programming in Java. And I’ve done my large share of C and C++ programming too. But I always find myself running back to good old Java.
If all you’ve ever done is C and C++, you’ll think Java is elegant. But there are languages that are much better than Java in every respect. As for inner classes, they ARE a hack. They’re just a poor substitute for closures that the Java implementors decided to add to the language because they didn’t understand how to do closures properly…
ondrej
Well, I already have three languages under my belt. That suits me fine for the work I do. I don’t have time to learn every language under the sun. And I’m quite happy doing what I do in Java. I don’t feel encumbered or tied down in the LEAST. I certainly do when I play with C or C++. But yeah, I’ve heard lots of wonderful things about Python. Maybe I will give that a whirl sometime. If Lisp programming is anything like editing .emacs files, which is the extent of my experience with Lisp, then ah, no thanks.
Woah there, Slava. Sun has very intelligent people working for them. I don’t think it’s a matter of them not understanding closures, but them deciding that Java didn’t need them. I use tons and tons of anonymous classes, and I don’t feel dirty at all.
Anyways, I’m proud to wave my Java flag and it just hurts a bit to see it get pounded into the ground all the time. And I’m very open. Maybe Python is radder. I just don’t have time to learn it, and in the meanwhile, I’ll keep hacking away quite happily in Java. Later, y’all.
May I add that Java’s sole claim to fame, the HotSpot JIT, was not implemented by Sun but acquired from a Smalltalk company (Anamorphic).
“As long as our hypothetical Blub programmer is looking down the power continuum, he knows he’s looking down. Languages less powerful than Blub are obviously less powerful, because they’re missing some feature he’s used to. But when our hypothetical Blub programmer looks in the other direction, up the power continuum, he doesn’t realize he’s looking up. What he sees are merely weird languages. He probably considers them about equivalent in power to Blub, but with all this other hairy stuff thrown in as well. Blub is good enough for him, because he thinks in Blub.”
It was just hurting my eyes reading that sentence about Java elegance, I had to react I’m no java hater btw, I’m just going to push it in my company.
“I don’t have time to learn every language under the sun.”
Me neither. Just be aware that there is a big world outside of C and its descendants.
“I don’t feel encumbered or tied down in the LEAST.”
I believe that you feel that way, but maybe you don’t feel encumbered just because you are not aware that it can be much better ? Here is one essay that touches this topic http://www.paulgraham.com/avg.html, in the “The Blub Paradox” paragraph.
Regarding lisp, it’s _the_ most powerful and flexible language in the world Lisp is a programmable programming language, you can add nearly any feature to it. Nothing else comes even close to its expressive power.
Java6 will not use native widgets directly. It will only use the theme APIs of windows (Uxtheme), gnome etc. to draw the proper borders and backgrounds.
> *cries* pleeeeease, go and learn something that is truly elegant, like python, ruby, smalltalk, lisp etc. you will really change your opinion about “incredible java elegance”
Oh please give me a break. I’ve tried lots of different languages including python, ruby, smalltalk and lisp and I still keep coming back to Java. Java is still a very elegant language just as C that is not cluttered with shorthand metaphores to supporsedly reduce typing but in reality just a real nuisance. I will take Java over Ruby for instance any time of the day — Ruby tried to repeat the success of Python, but in reality came out to be a real pain in the ass.
wtf? A graphical hello world, did you learn VB first?
Here’s my hello world:
public class HelloWorld {
public static void main(String[] args) {
System.out.println(“Hello World! “)
}
}
Java is an awesome language IMO. I have used Python and I loved it as well…very sleek and light. Java is a Desert Eagle .50 AE whereas the Python language is the Walther PPK used by Bond…Java is overkill for many situations…and Python is a viable substitute in those situations. Btw using Netbeans 4.1 RC and it rocks!
As for inner classes, they ARE a hack. They’re just a poor substitute for closures that the Java implementors decided to add to the language because they didn’t understand how to do closures properly…
According to this email, proper closures were in the original implementation, but java users complained about too much fancy stuff going on ‘under the hood’.
http://article.gmane.org/gmane.comp.lang.lightweight/2274
lots of anti java comments, java isn’t that bad at least give it a try before bashing it!
and its definitely a solution to the upcomming OS wars, (longhorn, tiger, linux, solaris, al, et, etc)
but so is Java. Java has gone a long way, and even IBM, the greatest proponent of smalltalk, has embraced Java.
Said all that, and while I admit to being a big Java fan, I will still wait and see how it fares for DT apps.
*cries* pleeeeease, go and learn something that is truly elegant, like python, ruby, smalltalk, lisp etc. you will
really change your opinion about “incredible java elegance”
haha !
you really think lisp is elegant ?
(if (equals 1 2) (car (3.1416 ((peach) oranges) apricot)) 3)
We are speaking from this programming language, do we ?
AHHAHAHAH HAHA HAHA HA
hemm, sorry
try Haskell or OCaml, you will also have a higher order language, but they are well typed, and and have a much more beautifull syntax
p.s. : Ok, I agree, I was hard here, but I don’t see why lisp should be better as Java. The language is too old, even John McCarthy would do it now in an other way, if he had to design the language again…
car : common address register. <—- hd : head in ocaml
I know a bit haskell or ocaml, they look good. I have little experience with functional programming but I want to change that because it looks like a way how to write more correct (better provable) and elegant (HOFs) programs. But lisp has one major thing – macros. I once wrote a macro to add haskell-style pattern matching to lisp, it looks something like that:
(haskfun list-length
(nil 0)
((x ! y) (1+ (list-length y))))
Lisp can be similar to haskell/ocaml, except it has dynamic typing and all the parentheses
Another cool think about lisp is that it can be used to express about anything, code or data. You can create a new special embedded language that will express certain problems better than lisp, e.g. language for generating HTML, or GUI definition language, or prolog-like inference etc.
I don’t get the complains about car, that is something soo unessential … If you don’t like it, use “first” or something instead. Saying that “lisp is old” is meaningless, say what it is good or bad. For me, the fact that it is old is just another reason to admire it.
To be honest, I am not accustomed to the Lisp syntax yet too but I love closures and macros.
i was reading cell processor specs. and it seems going to be really painfull to program at low level (no virtual memory…), does anyone knows if some HLL will be prepared to that arch. or it will end being programmed in C like any other processor? This can be a good oportunity to languages like lisp,python,haskell,java,perl… even kernelless language-based OSes could take advantage.
P.S.: i’ve read too much complains about lisp having too many parentheses, but it have only parentheses, no one complains about C having too many ();:,[]*=&&|| etc.
It’s not execution speed that’s the problem, it’s the startup time.
Also, from what I recall (not having used Java in a couple of years), aside from the startup time, Java tends to be a memory hog too.
But if you’ve got plenty of memory, and can wait a minute for your app to come up, Java seems fast enough for use on the desktop.
GC v/s OS memory management conflict?
P.S.: i’ve read too much complains about lisp having too many parentheses, but it have only parentheses, no one complains about C having too many ();:,[]*=&&|| etc.
That’s because these people have never used Lisp, they’ve just read about it in their Java magazines.
> They’re just a poor substitute for closures that the Java
> implementors decided to add to the language because they
> didn’t understand how to do closures properly…
I’m sorry, but if you think that James Gosling and Guy Steele don’t understand how to implement closures then you are an ignoramous.
Guy Steele did not implement Java, he merely helped write the spec, so I’m not sure why you felt it relevant to bring him up. As for James Gosling, he holds the view that languages should be as limited and painful to code in as possible, in order to prevent inexperienced programmers from doing too much damage. So for all we know, he might not understand closures at all.
> P.S.: i’ve read too much complains about lisp having too
> many parentheses, but it have only parentheses, no one
> complains about C having too many ();:,[]*=&&|| etc.
Common Lisp has `’,#@.;&=:|~%! in various places.
Guy Steele was a member of the original Java team and has contributed to more than writing its specification. James Gosling certainly understand closure implementation quite well.
I’m sorry that you let your disdain for Java design choices allow you to disparage the capabilities of people involved in its creation. Especially when they typically have much more interesting demonstrations of their capabilities than you.
Guy Steele was a member of the original Java team and has contributed to more than writing its specification.
Guy Steele also helped write the Common Lisp specification, which was a great achievement. However, he was not as involved in Java development as you might think. If you claim otherwise, provide references.
James Gosling certainly understand closure implementation quite well.
You can read the recent interview with Gosling where he equates dynamic languages with shell scripting. This shows a complete lack of understanding of what is being discussed. I’m sure Gosling is a smart guy, but he clearly came from a C++ background, and with Java, set out to implement a better C++, rather than take a step back and consider the big picture. Otherwise, why did he choose to have primitive types that do not obey object semantics, poor reflection, broken arrays, no closures…?
> Guy Steele also helped write the Common Lisp specification,
> which was a great achievement. However, he was not as
> involved in Java development as you might think. If you
> claim otherwise, provide references.
I mentioned Guy Steele precisely because of his involvement in the Common Lisp standardization process and his co-creation of Scheme. His involvement in the Java project went beyond simply writing the specification, and you can read hist posts in various mailing list archives and Usenet to read about his involvement and the various things his pushed for in its early development and his efforts regarding its evolution; I’m not going to play Googlebot.
> This shows a complete lack of understanding of what is
> being discussed. I’m sure Gosling is a smart guy, but he
> clearly came from a C++ background
Dr. Gosling developed Mocklisp for Emacs and NeWS with its PS-derived language, on top of various other things. The majority of his development work is from a C background, not a C++ background, and to be perfectly honest Java and its libraries are more intellectual heirs to Objective-C than to C++. Like many Sun employees, he is also a propagandist but that doesn’t make him ignorant of simple topics in computer science.
Well, seems they are working on that one.
“Feature: Input in non-English locales
Bug IDs: 4360364, 4490692, 5033605, 5064016, 4725203, 5057184, 4957565, 4960727, 5014911, 4799499
Delivered: In-development
Description: This is basically a big bug-fix. We are well aware that the input in non-English locales on Linux/Solaris is sometimes just impossible, and we are working on resolving the various issues. We have refactored our code and fixed important internal design flaws that were causing those problems. Once we have integrated these fixes, we invite you to test the changes in your favorite locale and file a bug if it still does not work for you; if we find out about the problems early enough, we may be able to fix them in Mustang as well.”
I’m glas to see that its still on the todo list, but words like “…may be able to fix them in Mustang…” doesn’t seam all that reasuring. Especially considering these problems have been around since swing was born, they have refactored and closed these bugs many times before with the problem still remaining, there are two internationalization bugs on the top 25 bug list, and they have been there for years.
The only conlclusion you can make from Sun internationalization work so far, is that they are either incompetent or doesn’t care about customers outside of the US. It is not only java on Linux that suffers from internationalizaton problem even Solaris have and have had problems. During my 10 years as a java programmer I have not been able to get full use of my Swedish keyboards for at most three years. So, I’ll wait for real changes before I start jumping up and down with joy.
In the mean time there are QT and mono to do cross platform stuff.
“You can read the recent interview with Gosling where he equates dynamic languages with shell scripting. This shows a complete lack of understanding”
I think that it is not misunderstanding. When I read interviews with Mr. Gosling (e.g. about .NET), I often think that he does not believe his own words, that he just lies to help Java.
and to be perfectly honest Java and its libraries are more intellectual heirs to Objective-C than to C++.
If only. Why aren’t Objective-C features such as metaclasses and categories included in Java? Why is the Java reflection api so clunky compared with the Objective-C equivalent? Why aren’t classes first class objects?
I’ve read that Objective-C protocols were an influence on Java interfaces, but other than that there isn’t a lot in common between the two languages.
Categories are not part of Objective-C, they’re a NeXT extension. They’re also fundamentally broken, but that’s an entirely different discussion.
Java is merely the continuation of making Smalltalk into a language that programmers accustomed to manifest typing would actually use. Single-inheritance, inherent late-binding, VM runtime, garbage collection, MVC pattern in class library, reflection, remoting, interfaces, dynamically loaded classes, and so forth. Java syntax is vaguely similar to C++ while the semantics have rather nothing in common with it.
Patrick Naughton, who you’ll remember probably for his foray into pedophilia, talked a bit about it somewhere.
Java probably has more in common with Objective-C than Objective-C does with Smalltalk.
[quote]P.S.: i’ve read too much complains about lisp having too many parentheses, but it have only parentheses, no one complains about C having too many ();:,[]*=&&|| etc.[/quote]
Exactly: I like different things to look different. That’s why i don’t like those ()’s.
[quote]
Common Lisp has `’,#@.;&=:|~%! in various places.
[/quote]
And Common Lisp uses #’ in a totally unelegant way. Returning multiple values is inelegant too (Python and Lua are way better).
Data structures are inconsistent. How do you access a hash? A vector? A (linked-)list? Why linked lists seem to be the preferred data structure in Lisp (or Scheme) books, when vectors (arrays) are a lot more efficient?
But i really hope that language designers take Lisp as an inspiration, but without those parenthesis!
“And Common Lisp uses #’ in a totally unelegant way”
#’ <- is it not an alias for FUNCTION?
“Why linked lists seem to be the preferred data structure in Lisp (or Scheme) books, when vectors (arrays) are a lot more efficient?”
lisp prefers lists, not necessaryly linked lists. Vectors can be fast but are rigids (force relocations <- that’s not efficient). I think some lisp COMPILERS drop list when translating to machine code…(and you lost the (= data code) thing)
P.S: i think that current processors are not the best for running lisp, since my question about cell processor…
> Exactly: I like different things to look different. That’s
> why i don’t like those ()’s.
Those parentheses don’t demark difference but rather denote sameness.
> And Common Lisp uses #’ in a totally unelegant way.
I presume that you’re saying that having different namespaces for functions and variables is inelegant, and not simply stating that you think that #’ is especially offensive.
Otherwise nothing stops someone from telling you that && is just horribly visually offensive.
> Returning multiple values is inelegant too (Python and
> Lua are way better).
Python doesn’t even support returning multiple values in the sense that Common Lisp does. It supports returning a tuple and has a fairly primitive (when compared to ML pattern-matching) way of binding individual elements of a tuple. I’m not familiar-enough with Lua to comment on its behavior.
> Data structures are inconsistent. How do you access a
> hash? A vector? A (linked-)list?
I’ve really no patience to enumerate collection access functions. Your real complaint is that accessing elements of various collecitons isn’t polymorphic. You can define generic functions for providing polymorphic random access to collections.
> when vectors (arrays) are a lot more efficient?
I think you should consider brushing up on your DS&AL, since I think you’ll find that what is “more efficient” depends entirely upon the problem being solved.
> But i really hope that language designers take Lisp as an
> inspiration, but without those parenthesis!
They did and the result was Dylan. Apple canned their support for it ages ago, and Harlequin/Fun-O have seen much better days. Lisp without its parentheses, though, thoroughly makes macro system more complicated.