HomeDigital EditionSys-Con RadioSearch Java Cd
Advanced Java AWT Book Reviews/Excerpts Client Server Corba Editorials Embedded Java Enterprise Java IDE's Industry Watch Integration Interviews Java Applet Java & Databases Java & Web Services Java Fundamentals Java Native Interface Java Servlets Java Beans J2ME Libraries .NET Object Orientation Observations/IMHO Product Reviews Scalability & Performance Security Server Side Source Code Straight Talking Swing Threads Using Java with others Wireless XML

Guess what? It’s JavaOne month. That came around fast – and don’t panic if you’re sitting there wondering where the year went; it hasn’t, well not yet anyway. JavaOne is earlier this year, with only a nine-month gap from the previous one. It’s moved back to its old March time slot, which makes traveling and staying in San Francisco a little cheaper. Early reports indicate that attendance will be down this year, but I think that’s a good thing – it was getting too big. Never enough time for all the sessions you want to attend or to talk to the people you want to meet. We’ll report next month on the jewels we uncover and you can read about the goings on at www.sys-con.com/java.

Java 1.4
Last month Sun officially launched its latest JDK. It will be awhile before it enters mainstream usage, as it takes a significant amount of time before vendors and developers are confident enough to release products that are 1.4+ only. I have an interview scheduled with the senior project manager of 1.4, Sherman Dickman. I’ve been garnering questions from all around; you may have spotted me asking for them in various mailing lists. Now that I’m armed, I’ll be posing these questions to Sherman and you can read the answers in next month’s JDJ. One thing that I will comment on with respect to the new 1.4: a lot of people don’t seem too bothered about the extra features or API enhancements. A lot of the questions are centered on speed and memory usage. If you’ve downloaded the new 1.4 and have run some benchmark tests on it, I’d love to hear your views.

How Many Lines of Code?
I’ve been lurking around some of the Java mailing lists and am continually amused at some of the postings. In fact, let me scrub that, I’m scared to death of some of the posts. There are people out there who obviously believe they’re Java programmers and, more important, have probably managed to convince others of this too; it’s spiraling out of control, I tell you. We may laugh, but it’s these sort of people who have a major impact on our industry and the language. Java doesn’t need any more bad press since .NET is on the horizon, and if these people can’t get their projects working in Java, their managers will look to alternatives, citing Java as the reason for project failure, not the incompetency of the developer who claimed to have known Java.

Allow me to give you an example that may send you running for the hills. There was an innocent enough question posted on the list regarding JDBC and how to retrieve the number of results in a given ResultSet, preferably without resorting to rewriting your SQL, or performing an additional SQL query such as a COUNT(*). It was a good question and since the API doesn’t actually give you a single method for this, it’s a fair enough question for someone new to JDBC. The question wasn’t the issue; it was the array of answers that tickled me at first until I read the one that scared the life out of me. Before I give you the answer in question, remember the poor guy who posted the problem in the first place. He just wants an answer and is relying on the skillset and expertise of a mailing list to guide him. If I were him, I would be so confused; he’d be better off not asking the question in the first place.

The majority of the answers centered around the [while (Res.next()) noRows++;] answer, which works beautifully. It may not be the most efficient way, but it works. Somebody posted a reply and never twigged it was actually a VisualAge wrapper class (and don’t get me started on the evils of the IDE!). Using third-party tools is not a bad idea and is to be encouraged if it makes your life easier. But don’t make huge leaps of faith based on them.

The post that sent shock waves through me was the one that stated that because there was only one method call being made [getRowCount()], it was much faster than all the other methods presented in this thread. Wow...major leap of the faith there, but without disparaging the poster completely, you can see the logic – well, almost! There was, of course, the plethora of posts afterwards, trying to explain to him that the third-party wrapper had no more magic at its fingertips than the JDBC driver, and therefore was probably doing the underlying [while] method of determining the number of rows. But the issue here is that this guy posted the solution in all seriousness and good faith and, at the time, really believed in what he was saying (I wonder if he was certified!).

There was, of course, a major fundamental software engineering principal lacking; as I talk to more and more people, and listen on various mailing lists and newsgroups, I see this sort of example time and time again. These are people who think they know what they’re doing, and to that end have the tenacity to be advising others. Blind leading the blind.

Nothing would give me more satisfaction than having Java as the number-one programming language, but to do this we need to keep the quality up and help where we can. If you’re unsure, don’t post anything – you’ll only lead others astray. Which is why there’s always the standard question: Where can I go for good quality answers? To be honest, very few places and generally only those that are moderated. I would, however, recommend www.jguru.com , which I’ve found comes up trumps time and time again.

I think the moral of the tale is this: don’t believe everything you read on a computer screen!

On a somewhat related note, I see Mr. Gosling headed into some controversial water last month and was quoted as saying: “IDEs are generally targeted at low-end developers – people who are not experts at writing code.” It was interesting to hear him say that, particularly in this environment where the likes of ANT and Emacs are coming back into fashion. Apparently, James is working on a new kind of IDE, which I suspect he’ll want to give another name to to distance his creation from the mainstream IDEs.

So with that thought, I’m off! Catch ya next month!

Author Bio
Alan Williamson is editor-in-chief of Java Developer’s Journal. During the day he holds the post of chief technical officer at nary (consulting) Ltd, one of the first companies in the UK to specialize in Java at the server side. Rumor has it he welcomes all suggestions and comments.

[email protected]

All Rights Reserved
Copyright ©  2004 SYS-CON Media, Inc.
  E-mail: [email protected]

Java and Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. SYS-CON Publications, Inc. is independent of Sun Microsystems, Inc.