Java2 SDK v. 1.4 Released
pangloss writes: "Yay: XML, built-in Perl-ish regex, jdbc 3.0, asserts, IPv6, lots of other goodies. Release notes and incompatibilities. And I think this means I can use my wheel-mouse in NetBeans without that extra module ;) Download it here." WilsonSD adds: "There are many cool new features including a New I/O package, an Assert Facility and enhanced performance." Some other random Java notes: O'Reilly has an essay about why you won't see any open source J2EE implementations, and Kodak has filed a patent-infringement claim against Sun regarding Java.
I've been working on a server that takes a lot of connections in Java, and you can finally do it with the support of "select" in Java 1.4. But no support for SSL. I undertand why it happens, but this "we'll get around to doing the security later" is why we don't have a lot of security.
Java will always present a dilemma. With the push for portability, you often have to wait for the platform itself to support things like this (select) or kludge it in very non portable ways. But that portability leaves the system behind which hurts it in competition with other systems more tolerant of innovation and the fracturing it brings.
A good philosophy would be to rule that every time a system library or feature needs to do something that an ordinary user can't do, they don't just build it in, they make a way that an ordinary user could write it. That paves the way for more innovation.
Has it been over a year since you last donated to the Electronic Frontier Foundation
I hope that Swing is faster now under linux. I played with netbeans and jedit and although there are really good they are not very fast on linux. on a slower windows PC jedit stated much faster than on my linux box.
a few days ago I played a little with Ruby (the coolest language available IMHO) and Gtk+. although the bindings are not yet finished they work very well under Linux and this is much faster than Java/Swing.
Maybe Ruby is the future. At least I hope so. If Ruby gets more stable modules Ruby can be the Number One OOP language. It is cleaner than Perl or Java, the Programms are shorter, the Language is more intuitive and.... and.... and. This is only my humble opinion. See for yourself if you like ruby. check out http://www.ruby-lang.org
Of course it will be stable. Everything is stable under L---
7 155027]
0 4] [serial:__insmod_serial_S.bss_L3392+245999/3714801 7] [serial:__insmod_serial_S.bss_L3392+238646/3715537 0] [kernel_thread+40/56]
kernel: VFS: Disk change detected on device fd(2,0)
kernel: end_request: I/O error, dev 02:00 (floppy), sector 0
kernel: VFS: Disk change detected on device fd(2,0)
kernel: end_request: I/O error, dev 02:00 (floppy), sector 0
kernel: Incorrect segment count at 0xc01781d6nr_segments is 15
kernel: counted segments is 17
kernel: Flags 0 0
kernel: Segment 0xc37ace40, blocks 4, addr 0x4bd1fff
kernel: Segment 0xc37acea0, blocks 4, addr 0x4bd27ff
kernel: Segment 0xc37ac780, blocks 4, addr 0x38abfff
kernel: Segment 0xc37acde0, blocks 4, addr 0x38ac7ff
kernel: Segment 0xc3809120, blocks 4, addr 0x1e77fff
kernel: Segment 0xc0e0fda0, blocks 4, addr 0x199c7ff
kernel: Segment 0xc3871ec0, blocks 4, addr 0x6fe2fff
kernel: Segment 0xc3871f20, blocks 4, addr 0x6fe37ff
kernel: Segment 0xc3871e00, blocks 4, addr 0x498afff
kernel: Segment 0xc0e0fec0, blocks 4, addr 0x18aefff
kernel: Segment 0xc3871c80, blocks 4, addr 0x41b6fff
kernel: Segment 0xc3871ce0, blocks 4, addr 0x41b77ff
kernel: Segment 0xc3871b60, blocks 4, addr 0x1d06fff
kernel: Segment 0xc0e0fe60, blocks 4, addr 0x18af7ff
kernel: Segment 0xc38719e0, blocks 4, addr 0x4c3ffff
kernel: Segment 0xc3871aa0, blocks 4, addr 0x4c407ff
kernel: Segment 0xc0e0ff20, blocks 4, addr 0x18ae7ff
kernel: Segment 0xc3871800, blocks 4, addr 0x4cb0fff
kernel: Segment 0xc3871860, blocks 4, addr 0x4cb17ff
kernel: Segment 0xc3871140, blocks 4, addr 0x4b8ffff
kernel: Segment 0xc38717a0, blocks 4, addr 0x4b907ff
kernel: Segment 0xc0e150c0, blocks 4, addr 0x196d7ff
kernel: Kernel panic: Ththththaats all folks. Too dangerous to continue.
kernel:
kernel: rq->cmd=1, rq->sector=73208, rq->nr_sectors=8
kernel: kernel BUG at pktcdvd.c:1046!
kernel: invalid operand: 0000
kernel: CPU: 0
kernel: EIP: 0010:[serial:__insmod_serial_S.bss_L3392+238989/3
kernel: EFLAGS: 00010086
kernel: eax: 0000001e ebx: c1273840 ecx: c4676000 edx: c020f384
kernel: esi: c208f09c edi: c208f074 ebp: c7f9d760 esp: c6fc3f88
kernel: ds: 0018 es: 0018 ss: 0018
kernel: Process pktcdvd0 (pid: 1303, stackpage=c6fc3000)
kernel: Stack: c8861c10 c8861d2f 00000416 c6fc2000 c208f09c c208f074 c208f000 c7f9d86c
kernel: c8860076 c208f074 00000f00 c762df1c c208f000 00000b00 c6fc3fe0 c208f008
kernel: c208f10c c7f9d778 00000000 c6fc2000 00000000 00000000 00000000 c6fc2000
kernel: Call Trace: [serial:__insmod_serial_S.bss_L3392+245712/371483
kernel:
kernel: Code: 0f 0b 83 c4 0c b8 06 00 00 00 0f ab 45 48 19 c0 85 c0 75 24
A summary of all the new features is available here:e s.html
http://java.sun.com/j2se/1.4/docs/relnotes/featur
Articles about the news APIs and how to use them available here:
http://java.sun.com/j2se/1.4/articles.html
Being bitter is drinking poison and hoping someone else will die
This makes me so happy. Coming from C++, I really really missed assertions. They give me much more confidence in my code. Some people seem to have trouble using them, but after a while they can become second nature. In fact, one can come to rely very heavily on them.
Well that kind of gives an answer to every javahead that says "Why bother with Mono, when you have J2EE? What a waste of time."
Mono is at least opensource... can you say the same for J2EE? Will you ever be able to say the same?
And still no generic data structures (a.k.a. templates in the C++ world)... all those explicit downcasts from Object hurt and need to be optimized away by the JIT...
-Hein
The 4 GB address space limit has become a severe limit on Java bloat. It's good to see that Sun finally addresses this problem.
I have a dual boot machine at home, one partition Windows 98, the other Slackware 8.0. Today I downloaded and installed the new Java SDK 1.4.0-rc on both systems. And while I think that some iscolated windows difficulties causes my oppinion to be rather biased, I found the install much easier going on Linux.
However I will note that, while the Java Web Start was installed on Windows, I didn't find any version of it for linux. And the downside to the Web Start I found is that it constantly wanted to download and install a new version of Java Runtime Environment 1.3.x everytime I lauched an application. And then after the download, and installed, I'm prompted to reboot the computer. After rebooting and trying to launch again, it again starts to download JRE 1.3.x and through the whole cycle all over again.
As well, with my windows install I found I was constantly having difficulties getting it to use the default classpath (ie, no environment variable set for CLASSPATH). I ended up having to resort to specifying the classpath at the command line. And no matter how much I tried, I could no manage to get Swing to work properly.
However on the other hand, the Linux install was rather straight forward, with a few simple steps: Change download to executable; Run it; move the extracted directory to a shared path (as su); add the java/bin directory to the search path; and finally add the java/man directory to the search paths for man.
The windows installer was straight forward, though the above problems still hampered me.
-- Never monkey with another Monkey's monkey
Hmm, if SDK v1.2 became "Java2", shouldn't v1.4 be called "Java4"? Oh I see, "Java2" was a "marketing trick" used in the tough year 1997 and the name has stuck.
Perhaps,but remember that the change from 1.1 to 1.2 contained some major rehaul of APIs.
In this 1.4 release Sun kept a carefully budgeted set of new features and emphasized quality and performance, like they said they would. You can expect more changes in 1.5 (codename Tiger) which is planned to come some time around the middle of 2003. If that will be Java3, who knows, they have just started working on it.
Being bitter is drinking poison and hoping someone else will die
Autopr0n.com actualy runs using the first beta of JDK1.4. I needed the new ImageIO libraries for the, um, 'site previewer :P' (and the regexs made some of the parsing I'm doing a lot easier :). I tried 1.4b3 but it was far more unstable, and my regexs broke.
:P
Definetly cool that the stable version is out, I'll have to upgrade at some point, when I have time.
Hopefully they'll implement this at Topcoder.com too, so I don't have to keep using the old docs in the compos
autopr0n is like, down and stuff.
Jesus, Sun's PR corps must have flipped their collective shit when they read Karen Tegan's remark. While in general I find that kind of bluntness refreshing, a director of Platform Compatibility spouting off and essentially saying, "Well, that sucks for you, but we make money off of compatibility testing. We give everything else away for free, so cut us a break." is really a testament to the Sun Micro (brutally) plain-talking attitude.
.NET takes off, they will loosen up to benefit from a little more old-fashioned agrarian innovation and buzz.
Deeper, though, I think, is the need to rein in Java a bit....It has achieved ubiquitousness, and I think Sun knows it. Watch. If
I guess it would be nice to have SSL built into java, but you could write it yourself, it's not like it's a fundementl language flaw. The specs are out there, and the java Crypto API would probably help you out quite a bit.
autopr0n is like, down and stuff.
see subject
autopr0n is like, down and stuff.
Throw the classpath in your AUTOEXEC.BAT file on the C: drive on your win98 machine. Should work.
autopr0n is like, down and stuff.
OK.. I am a Java fan... (recently this has been changing though.)
.Java. I am really impressed with the CLR/CLI stuff. Right now, as it stands, Java is a proprietary language. Unless we see SUN Open Source Java (or push it through a standards committee), we *may* see a JDK 1.5... but no one will use it.
:)
I have mixed feelings with JDK 1.4.
The JPDA (debugging) support in 1.4 is vastly improved. You can now redefine classes in a running virtual machine. This is really cool and I have written an Ant 'Redefine task to take advantage of this.
The assert facility is OK.... i don't like the fact that they added an Assert keyword but I don't get to make the decisions.
There is also some controversy.
The JSPA agreement that one has to sign to participate in the JCP is WAY too restrictive for Open Source developers. The Apache Software Foundation has a good document where they drawn the line in the sand on their participation.
The Log4J people are upset because there is now a 'stanard' Java package for logging. IMO the 'standard' package is inferior to Log4J in many situations.
The regexp package is not all it is cracked up to be either. I would recommend Jakarta ORO or Jakarta Regexp.
As far as that... it runs GREAT on Linux. Probably the most SOLID VM I have ever run.
They did break some stuff with legacy code. If you ever named a class 'URI' your code will now fail to compile because they put this class in the java.net package which everyone imports anyway.
As far as C# vs
Also.. check out my Reptile project. It is Java based, only requires JDK 1.2 and incorporates some really cool Java/XML stuff.
Are there some good articles out there (besides the sun ones) on how to use the new features?
thx
matt
I just took a look at the three patents Kodak is suing Sun over, and, huh?
Sure looks like Kodak claims it invented OLE.
Which, hey, they may have, and Microsoft either licensed or stole it.
What's the real story?
--Blair
This is in regard to the kodak suit.
What I find especially bothersome is the the fact that Koday (supposedly) had these patents. They did nothing with them. Sun produced a product, hyped it, sold it, improved it and put in millions of dollars and man hours into it.
Kodak then comes in and demands money after the fact when they made no attempt to actually do anything.
I think that's crazy. Why punish the people who got off their asses and did something especially if the punisher was too lazy or stupid to actually make use of their idea.
This isn't just about sun and kodak either. Who was suing palm recently? Same thing.
Sit on your ass doing nothing, wait for somebody else to do all the work. Then sue them and retire in the bahamas. It's the american way I guess. Sure beats working.
War is necrophilia.
If I had mod points, I would give them all to you.
Yes java is the most overrated language next to esperanto only.
no sig error.
Due to import control restrictions, the JCE jurisdiction policy files shipped with the Java 2 SDK, v 1.4 allow "strong" but limited cryptography to be used. An "unlimited" version of these files indicating no restrictions on cryptographic strengths is available.
The JSSE implementation provided in this release includes strong cipher suites. However, due to U.S. export control restrictions, this release does not allow alternate "pluggable" SSL/TLS implementations to be used
What seems even stranger now is that you cannot used "pluggable" implementations (in JSSE). Maybe the "nasty" europeans/asians/africans/martians would provide some unlimited strong cryptography pluggin otherwise???
The platform is not the language.
Java is good partly because of its pragmatic syntax (C++ish with some sugar added, some sugar taken away), but mostly it's good because of its excellent class library.
Though I haven't written anything serious for a year or so due to a job switch, I used to write large-scale multithreaded network servers, where somthing like three to four hundred threads could be running at any given moment inside the server. Java's class library made this really quite easy, and it's syntax is pleasant enough to work with.
Cheers,
Ian
The article says nothing about the nature of
the supposedly infringed patents. Here's their
titles:
US05206951
Integration of data between typed objects by mutual, direct invocation between object managers corresponding to object types
US05421012
Multitasking computer system for integrating the operation of different application programs which manipulate data objects of different types
US05226161
Integration of data between typed data structures by mutual direct invocation between data managers corresponding to data types
Okay, okay, although it may have crashed, it's still secure. Probably more so now!
I really hate Dan Patrick.
???
No shit... 1.3.1's memory management and garbage collector are whacked.
"Mind, as manifested by the capacity to make choices, is to some extent present in every electron." -Freeman Dyson
My favorite thing about using 1.4 is code like this:
public void methodA throws MyException {
try { Driver d = Class.forName(driverClass).newInstance(); }
catch (Exception ex) { throw new RuntimeException("problem loading driver"); }
}
can now be this:
public void methodA throws MyException {
try { Driver d = Class.forName(driverClass).newInstance(); }
catch (Exception ex) { throw new RuntimeException("problem loading driver", ex); }
}
Notice the RuntimeException constructor now has the original exception passed to it. It can be retreived higher up the stack, and I believe is printed during a ex.printStackTrace(...). It lets you pass the root cause exception up the stack trace, while preserving the entire state, without having to declare it everywhere.
Look at the bottom of the classpath page for a list of open source VMs that work with classpath (a free core (i.e., java.* and a few others) class library). All works in progress. I expect that mono and/or portable.net will quickly outpace free java projects. The JDK is a case where the availability of good enough gratis software has seriously hampered the momentum of libre competition. Netscape 4.x is another such case.
But I can't forsee Ruby supplanting Java for large projects. The typing is too dynamic, and this ends up being a big headache and source of problems in larger code bases. More concertely, the lack of compile-time type checking makes it hard for Ruby to scale to big projects. You don't find out until runtime if something is type correct, and even then maybe not until some rare execution sequence occurs. Or, worse, it might be type correct in the Ruby sense (i.e., an object can receive a certain message), but not be at all type correct from the programmer's point of view, which might manifest itself in difficult-to-find bugs.
This is a problem with dynamic casting in Java/C++, too, but in those languages the dynamic type checking is the exception rather than the rule (this will get a lot better when Java introduces parametric types in 1.5). More fundamentally, though, at least those languages offer compile-time type checking support, whereas Ruby does not and cannot (since code can be dynamically injected into objects).
5. Notice of Automatic Software Updates from Sun. You acknowledge that the Software may automatically download, install, and execute applets, applications, software extensions, and updated versions of the Software from Sun ("Software Updates"), which may require you to accept updated terms and conditions for installation. If additional terms and conditions are not presented on installation, the Software Updates will be considered part of the Software and subject to the terms and conditions of the Agreement.
6. Notice of Automatic Downloads. You acknowledge that, by your use of the Software and/or by requesting services that require use of the Software, the Software may automatically download, install, and execute software applications from sources other than Sun ("Other Software"). Sun makes no representations of a relationship of any kind to licensors of Other Software. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR INABILITY TO USE OTHER SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Antti S. Brax - Old school - http://www.iki.fi/asb/
I have read the articles. There have also been a lot of these articles when jsdk 1.3 came out and Swing was not much faster. Swing is a cool idea. If it could match the performance of VB on windows or Qt in Linux there would be much more cross platform apps and this would also help linux onto the desktop.
A wild guess here, but maybe because it is under the Java section?
sic transit gloria mundi
Okay, I can't take this any more - Java is not slow or buggy and can produce applications that are indistinguishable from C/C++ applications. The proof of this is simple - rewind the clock back a year to MacWorld where WorldBook Encyclopedia was demoed as part of the keynote with everyone watching and they were all impressed. Months later I was informed by the "head Java dude" at Apple on his Australian tour that WorldBook is completely written in Java - but noone knew.
Most people think that Java is slow, buggy and doesn't look platform native because they assume that anything that is fast, stable and looks and feels platform native wasn't written in Java. It's even cooler though, because the "write once, run everywhere" of Java actually works if you write good code). Sure there are some things that Java can't do that you need native code modules to handle but that facility is available.
The worst thing is that young programmers are led to think that Sun's code is actually *good* which spreads their poor, inefficient form to the next generations.
Java's not perfect, but I seriously don't think that it's Java that corrupts young programmers. You can write good code in almost any language - I see an awful lot of really bad Java code written by C programmers but I'm not about to claim that C is corrupting old programmers.
It's a shame that Kodak/Wise never enforced the patents to stop MS from developing OLE. That would've saved many people's sanity.
This sig made only from recycled ASCII
This means that they are claiming that if you agree to this licence, you are also agreeing to the licence of any application which installs itself (and you have agreed to let it install itself).
I'm sure that that is not legal, and could invalidate the whole agreement. On the other hand, I don't see how a licence agreement that you haven't signed is worth the pixels its printed on.
To say that Sun's online license agreements are binding would be to say that you are not allowed to click on a button with two words on it which is displayed on the web without agreeing to this contract.
As someone pointed out in response to another article, not agreeing to the licence agreement preserves your right to click on the "I Agree" button without agreeing to the licence agreement. It is in the agreement that it says that you agree that clicking the button means that you agree.
Is that convoluted enough?
Why is Grand Theft Auto a much more serious crime than Reckless Driving?
Oh yes, and I nearly forgot a trivial-but-annoying one:
perl -e 'fork||print for split//,"hahahaha"'
I've never used assertions, but they seem a great complement to unit testing. Unit testing allows you to write code to test your functions and easily see if something breaks, the major problem is that they lack an easy way to look inside objects to keep an eye on internal consistency. Assertions can be great to catch those silly little boundary mistakes.
A good unit testing framework for Java is JUnit, they are available for other languages as well.
BTW, you can create your own assertions with Log4J, so even JDK 1.1/1.2/1.3 users can use them:
if(logger.isDebugEnabled())
if (bla>10)
logger.warn("bla>10, bla=" + bla);
This uses almost no CPU-time if debugging is disabled. Log4J is a very good logging package, it surely beats System.out.println, check it out!
The Drowned and the Saved - Primo Levi
Go and look at WorldBook on OS X and you will also be impressed. More importantly though, noone realised it was a Java application. It looked and acted just like a C/C++ application.
Remember, this is Sun the people who released Solaris 2.0 which:
- was the first version of Solaris
- declared itself to be SunOS 5.0
- was an implementation of System V Release 4.0
Obviously being able to count is not a prerequisite for getting a job in Sun's marketing department.
Most people think that Java is slow, buggy and doesn't look platform native because they assume that anything that is fast, stable and looks and feels platform native wasn't written in Java
I find the example set by WorldBook 2002/MacOSX to be a stunning demonstration of Java's potential if Sun would just wake up and smell the coffee (pun intended).
I like Java a lot - both as a language, and as a bytecode platform. I use it daily at work, and at home for my own projects (after many years of flipping between C, C++, and a dozen other niche languages)
My only major bugbear with the JDK is not with Java itself, but with Swing: It's godawful slow (The Hello world app should not take 30 seconds to display on a P400), it's API is occasionally appalling (JTree anyone?), and it has a habit of being occasionally buggy.
Above all, it reinvents the wheel with widgets. The Look and Feel implementation very occasionally looks and feels like a platform native application (Win2k LnF anyone?). However, it usually looks and feels like someone has tried to reimplement a system native toolkit using only a blunt light blue crayon.
For many a year I have whined to all that would listen "Why the *@*)(!&*@ doesn't the Java widgeting toolkit defer to system native widgets for window display? Surely this would look better and run faster than pixel blitting a widget look-a-like!"
MacOSX provides just such an API. Although Objective-C is the `preferred' language of Cocoa, there are Java bindings. Note - this API is NOT Swing - it is a MacOSX extension API. Consequently, a MacOSX application built in Java should be almost indistinguishable from a native compiled app in terms of look and feel. And according to your comments, performance is also indistinguishable.
I have played with Java bindings for Gnome; they provide blindingly fast gui performance, using the same java runtime as is used by Swing. However, there are several java binding projects for Gnome (all partially complete), and none of them really address the general problem of widgeting across platforms.
I have also played with Eclipse, the IBM Java . Their widget toolkit is cross platform in API but system native in widget; however, I have found the performance of the Eclipse widget set to be almost as bad as Swing. However, it is beta code - we may have to wait and see if anything improves with age.
Java/Gnome demonstrates that it can be done under X. Eclipse demonstrates that it can be done cross platform. MacOSX demonstrates that it can be done well enough as to be indistinguishable from system native widgets.
So can anyone tell me: WHY hasn't it been done? (And don't say its because they don't want to break backward compatibility - Look at 1.4's NIO framework and VolatileImage).
Russ Magee %-)
... and never, ever play leapfrog with a unicorn.
My favourite new feature is that lightweight components can now be run in headless mode - see
C ha nges.html#headless
http://java.sun.com/j2se/1.4/docs/guide/awt/AWT
You have to set a property to true:
-Djava.awt.headless=true
as a switch when running the VM for example. Then you can generate server-side graphics on Unix without having to run XVfb. This has been an annoyance for some time, as you had to have different deployment rules depending on your target OS, as NT always has a graphical environment taking up resources whether you want it or not, so it wasn't an issue there.
The upshot is that you can now use java.awt.Image.BufferedImage as an image source in servlets that generate dynamic images, instead of java.awt.Frame, which always seemed wrong. It uses less resources too, as it doesn't have to do a context-switch to your X server to create images!
Hey, there are lots of great new features in this new release, but that is the first one that made life easier for me.
Yes and no. The Cocoa APIs are an extension that is not cross-platform, however if you use the Swing libraries on OS X, by default they use native widgets. So you can write a 100% pure Java application that uses native widgets on OS X. I would expect that this kind of thing will flow back into Sun's JVM around 1.5 or so.
You can use templates to make C++ put on a pink tutu and dance a little dance for you. Alexandrescu uses them, for instance, to make C++ forcibly multiply inherit a chain of classes into a single child class. He also has a single inheritance template setup and a lot of other sick and twisted stuff that every C++ programmer should at least know about.
I'm trying to teach myself to set people on fire with my mind... Is it hot in here?
Yes and no. The Cocoa APIs are an extension that is not cross-platform, however if you use the Swing libraries on OS X, by default they use native widgets.
Ok - this was not my understanding. I thought the OS X Swing libraries were an Aqua-esque LnF, but not Aqua widgets themselves. However, I'm not a Mac junkie, so I don't speak from experience on this point. If they are native widgets, it certainly bodes well IMHO.
I would expect that this kind of thing will flow back into Sun's JVM around 1.5 or so.
I certainly hope so...
Russ Magee %-)
... and never, ever play leapfrog with a unicorn.
It shouldn't be any harder. You don't need an IDE to write in the Java language for the J2SE platform, but Sun still provides a free(beer) IDE that includes a form designer. Likewise, you don't need an IDE to write in the C# language for the .NET platform, but M$ still provides an expensive IDE that includes a form designer. Besides, the languages are so similar that it may even be possible to take simple business logic (not I/O) written in one language and simply recompile it in the other language.
Will I retire or break 10K?
I use Java at work and I had to beat 5 fucking team leads with a crow-bar to convince them to move to Java 1.2. Now they all run the other way when they see me coming -- it's a lot harder to get near them with a crow-bar. By the time my company gets done with its final focus meeting to decide that moving to 1.4's a good idea, Sun will be releasing Java 2.4 (With telepathic user interface code.) If I get all used to how great Java 1.4 is, work will suck more, and it already sucks so much that light can't escape.
I'm trying to teach myself to set people on fire with my mind... Is it hot in here?
Depends on the situation, of course. Exceptions are (relatively) expensive.
Last post!
Ok, so 1.4 may be faster. 1.4 may be more stable on Linux. 1.4 may be more robust. But, they still didn't fix the thing that annoys me the most about Java. Why is it so freaking complicated to do a simple read from the keyboard???
I would again have to contest this. WorldBook makes very heavy use of graphics (as does the stuff I work on) and it still managed to perform well and didn't seem to have any problems with bugs. There are bugs in almost every library and I have not found there to be any more in the Java APIs despite constantly working with the latest betas and early access releases.
I took some of my company's Java apps that ran well under Windows and tried them under OS X and they were dog slow. At one point I managed to get ProcessViewer to report CPU usage over 100%! Highlight some text in your browser - that's what it does. Two simple math coordinate checks, a couple calls to drawRect and drawChars, written about as efficiently as Java allows but with every set of mouse movements I saw the CPU usage shoot through the roof.
I would be very suspicious that when you wrote your custom class you optimised it based on your knowledge of Windows and not of Mac OS - the two graphics subsystems work very differently so your optimised code is likely to have actually been the worst possible code for OS X. If you want to benefit from Java's cross-platform abilities you actually have to use them. The API is the key to getting cross-platform compatibility because it is reviewed and optimised for each OS it is ported to. Your code doesn't have a hope of knowing as much about the system or being better optimised. I spend all day running the exact same Java application on Mac and Windows (95 and XP) and it runs the same on both at about the same speed because I take advantage of the APIs.
I know JBuilder runs fine on my machine (I suspect some Mac-specific code or vm settings) but Java isn't at all guaranteed to run well across platforms.
JBuilder is not heavily tweaked for OS X, it's just well written Java code. Poke around JBuilder's files and you'll find it doesn't do much more than a simple 'java -classpath blah com.borland.JBuilder' For the record I find Java runs perfectly fine on everything from a P100 right up to the 1.2Ghz Athlon and from a Rev B iMac (300Mhz) up to the 400Mhz G4 laptop I currently use. Perfectly fine in this case means comparable to programs written in C. Yes there's a longer launch time in most cases (again, OS X makes huge inroads into this and 1.5 will likely adopt this technology to reduce loading times and memory requirements significantly).
On Mac, it looks sweet except for text rendering.
I don't know about you, but I quite like the smooth, easy to read look that Java's text gets on OS X with it's antialiasing.
The bugs are actually probably more annoying because they are the let-downs "Oh, look it has this great gui widget" and then ten days later "Oh crap that widget has a horrible bug and I'm completely reliant on Sun to fix it
I really haven't seen that many bugs in the Java APIs that you would consider it worse than other libraries. If you are consistently having trouble with JTree then it may be worth extending the class to fix the bugs where possible (and you'd be amazed at how much you can achieve this way) or develop your own solution (as a last resort). Consider that with C/C++ you don't get *any* graphical abilities for free (all provided by 3rd party libraries which are completely platform specific etc, etc), you really aren't that badly done by if you have to implement a couple of custom widgets in Java.
When it comes down to it, the solution is to write good code. I can be pretty certain (but not 100% sure obviously) that you are not writing good *Java* code because you are so anti Java. You simply have not accepted the languages strong and weak points and so can't take advantage of the strengths. You also seem to come from a background in another language (C/C++ would be likely) and you don't seem to be willing to adapt to the "Java way" because you are hooked on the "C/C++ way" (or whatever previous language you prefer).
I apologise for any offence in the above statements, I can see from your posts that you are neither stupid nor irrational and in fact are quite intelligent with a fairly open mind. However, changing programming languages is really difficult particularly when they seem as similar as Java and C++. You have to realise that Java is only asthetically similar to C++ but is in fact based on a very different grounding principle. C++ looks for speed and efficiency at the cost of safety (buffer overflow anyone?) and platform independance, whereas Java focuses on safety and cross-platform consistency at the expense of speed (yes there is a speed penalty to be taken but in most cases it is an acceptable trade off and great gains are being made). Further to this, C++ is a procedural language which has had object oriented "stuff" added on top whereas Java was designed from the start to be object oriented (with some procedural elements).
Basically, there is nothing stopping you from developing your own API for Java but I'm pretty certain that you can't do a better job than Sun has - if it was so easy and/or the Java API is so bad, why hasn't anyone created an alternative?
My class and I was at Sun Microsystems in Ireland in 2001. They talked a lot about how good Java was. But when I asked one of the top people this simple question "Why isn't staroffice programmed in Java?", they said "We don't know, actually".
I know why. It's because Java just can't compete with faster languages when it comes to larger programs that require real window handlement. (personal opinion ofcourse).
Now on to the "so-called" platform independability. I personally have been asked several times to convert java programs so they can be run on UNIX platforms (like HP-UX) because they just didnt perform well on those platforms. Instead we chose TCL or similar. Which seem to do the job.
Best luck to Java in the future. Hope you programmers can fix these "small" problems :-).
These people have looked deep within my soul and assigned me a number based on the order in which I joined.
The story should have read "no LICENSED open source J2EE implementations". There are OS J2EE app servers (JBoss), and in fact they are quite good... the problem (as stated in the article) is that it's hella expensive to get the official seal of J2EE. That doesn't mean it doesn't work!
.NET is better, you have to ask how good an open .NET server you're going to be able to build without ASP.NET or Windows Forms. Neither of those are part of the current ECMA submissions, though as stated in the .NET article yesterday they are expected to be submitted at some point...
.NET (at least under windows). It will be interesting to see if .NET app development is nearly as annoying as MFC was (I doubt it will be).
Now if you think
At the moment J2EE has gone through a lot of refinement, and I think makes a pretty good platform for server side development. I think desktop code is still up for grabs by either Jvaa or
"There is more worth loving than we have strength to love." - Brian Jay Stanley
"Actually they are not expensive at all as long as they don't get thrown. If they are not, it just takes a little extra stack management when calling functions/entering try blocks. "
Actually, there is a cost to exceptions, EVEN if they don't get thrown. This is why MSFT allow the extended syntax keyword nothrow. It's not just "a little extra stack management" as you put it.
...what MS employees who get paid to make fake posts on Linux geek discussion groups as anonymous cowards try to erect to cover their tracks.
Eternal vigilance only works if you look in every direction.
Others have corrected some other points pretty well, but I thought I'd throw in two other points I didn't see well covered:
1) Warnings/errors. After many years of real world programming, I'm going to say right now that that is an error. If you find a variable that is not initialized, it is going to be a bug - even if not now, nine times out of ten it will be at some point in the future.
I personally am happy to have that not compile instead of relying on someone else to run lint (or the equivilent) frequently over the code... things like this are one of the reasons Java programmers don't need to run Lint style checks much. The langauge and general programming conventions help elimiate "dumb as a hammer" errors that we ALL make from time to time.
2) Java has some nice internationalization support if you really care to do it correctly for all cases - you can use a BreakIterator to properly navigate through a string for any language.
Java has always had (I think) well thought out tradeoffs between performance and ease of programming that led to things like this, but generally always supported some way to do things "more correctly" if you really needed to - wrapper objects are an example of this is so is String not handling characters wandering past 16 bits in size. You have the primitive type wrappers if you need them (as you noted), and also the heavy-duty internationalized support classes like BreakIterator and Collator.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Dude, read up. There is an excellent discussion of the reasoning behind their design decisions. They give a very good justification for adding a keyword; in fact, it's one of the FAQ questions:
Unlike a lot of other languages (C++ and C# spring to mind), the Java designers have been very tight about letting multitudes of constructs into the language. Java's minimality and internal consistency is one of the reasons it's been so successful, and its designers know this. They are very intelligent people who are making decisions very carefully -- and they're not going to add something to the language unless they have a very good reason.
In this case, they have a very good reason.
For example, if you have code like this:
import java.sql.*;
// start up a class, do some stuff, and then...
import java.util.*;
Date date = new Date()
The compiler will come back with a message like: "Can't figure out if you mean java.sql.Date or java.util.Date". So its not ever a namespace clash, because the compiler catches those problems before they get started.
As far as poor documentation of dependencies, that isn't really a factor either. You can't look at the import section to determine class dependencies anyway, because you don't have to import a class to use it. You might want to make that a convention, but its one of those things that is hard to maintain over a lot of code. If you want to call that 'source-code-level documentation' you can, but that's not what it is. Its not 'source-code-level' any more than the javadoc comments are.
-Mike
You should only complain about linux kernel being unstable when you run a vanilla 2.4 kernel. pktcdvd.c is not part of the standard kernel, it's part of Jens Axboe's packetised cdr writing patch - which is alpha quality. That patch is not even in 2.5.5-pre1 so you can't really blame linux - only the buggy patched version you have running!
I don't think that's what he meant.
From the console, it would be extremely nice if there was a way that one could read a SINGLE character, without the user having to press Enter/Return.
I've run across this issue ever since Java 1.0, and so far there doesn't seem to be a way to do this. Perhaps there never will.
You can accomplish anything you set your mind to. The impossible just takes a little longer.
I said it is a work in progress. It partially implements APIs introduced in every major Java release (including 1.4) but doesn't fully implement all APIs for any release (perhaps not even 1.0). Check the status of package implementations on the status page or cvs. It's a free software project, people work on what they want to work on. Actually it has picked up some momentum recently with contributions from Red Hat, which is merging gcj library work with classpath.
So... to counter that, an NT BSOD is almost _always_ due to a shotty 3rd party driver or strange hardware issue. So we can't really blame windows... only the buggy drivers we have running! So you should only complain about Windows being unstable when it is running a vanilla install.
I'm a big fan of JBOSS, and (though I haven't tried it) would've liked to see Enhydra succeed as open source. But I don't see why Sun should grant a J2EE trademark to them. Sure, the price might have been outrageous, but companies like IBM and and BEA seem willing to pay it. Sun allowed them to see the source from the reference implementation and allows them to use the parts of it that haven't been implemented independently yet.
The spirit of open source isn't about marketing. And the J2EE mark is just that. JBOSS is very successful on its own right, and whether Sun blesses it shouldn't matter. Apache has succeeded without Netscape or Microsoft's compatibility certification, though there are still companies who feel more comfortable with a web server branded by a large corporation. Though this draws comparison with Versign refusing to recognize certificates from Apache, its not quite as bad, and eventually, they were forced to accept. Anyway, verisign isn't exactly to be held up as a model corporate citizen
It might be desirable for Sun to open up java to public standardization, but I don't think anyone build on java expecting that to happen. Its like WINE expecting Microsoft to certify it as 100% Windows compatible (even if it really were.)
It may be one day that people will want their J2EE implementations to be JBoss compatible.
Those Aiee!!! messages are what first got me interested in Linux. My dad had an ISP and when I'd go out to the server room (a shed in our back yard) and reset modems, I remember seeing that and just laughing. That was a computer crash that had some flair. Calling the sysadmin and explaining that was fun.
Two thumb up on JDK1.4. The new io (nio) alone is worth the switch. I've been playing with it since beta one, and except for a strange bug (now fixed) in UDP where all incoming packets on all channels each falsely reported their origination address as having come from the same address as was reprorted on the first packet... except for that!:)... this stuff rocks. Packet transmission speeds are up something like 40-50% or more if I recall correctly. It's quick.
The Channel abstraction for talking to sockets also happens to be a nice one. The whole nio library has the taste of having been well-thought out by someone who really new what he was doing.
C//
Actually it depends how the exceptions are implemented.
I remember an article from Borland where they said that one of the difficulties of the porting of Kilyx from Windows to Linux is the exceptions.
On Windows, they are "easy to use" for the compiler's developer because they are a part of the OS but they have a cost even if they are not thowed on Linux they're difficult to use but they have no cost when they are not thrown.
You've missed the point of assertions.
The point isn't to catch runtime errors, it's to catch improper usage or coding errors. If your function should never be passed a NULL pointer, you don't want to raise an exception that the caller may catch, you want to bring the program to an immediate halt so you can figure out why the caller passed a NULL pointer. Didn't it check for that? Did it somehow get bad data?
(This use is why many of us define our own assert macros in C/C++. The standard assert() calls exit(), but that doesn't give you any information about the state of the calling procedure from within a debugger. An attempt to divide by zero, on the other hand....)
Another standard use of assertions is to check for coding errors. This is especially useful with loops - if you can identify a loop invariant, you can specify it in an assertion and catch most coding errors immediately.
A related use is to identify class invariants, and to always check the class invariants before you leave any class method. You can quickly identify any code that creates broken objects.
If you're also doing unit tests, you shouldn't need your loop and class invariant checks in production code. However you'll always need to do runtime sanity checks on your parameters, with well defined behavior for what the procedure will do when passed null pointers, negative values, etc.
For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
I mention autopr0n in my sig, but the majority of my posts here do not talk about it. If you want to see for your self, just go here and read the last 25 commenst I've made.
autopr0n is like, down and stuff.