System News
   
News about Solaris and Sun Microsystems

Free 2 Week Trial!


March 10, 2008
Article #19518
Volume 121, Issue 2
Section: Java Technology

 

The open sourcing of the Java platform will enable it to be viable for years to come.

-- Cay Horstmann
 


 

Java Champion Cay Horstmann on Aspects of Java
Training Developers; Open Source; the Future of Java

Java Champion Cay Horstmann shared his views on the Java programming language in an interview with Janice J. Heiss.

Heiss wanted to know Horstmann's view of the "dumb code" argument advanced by Brian Goetz of Sun. The Java Champ replied that he thought Goetz might be right, that it truly doesn't pay to optimize code until profiling is complete. The gain in performance is offset by the debugging headaches, he said, then added that using patterns is not the answer either, since using them well requires considerable experience.

Turning to developers working in JavaServer Faces (JSF), Heiss asked about typical mistakes. Horstmann was forgiving in that he blamed lost productivity more on the JSF stack trace rather than on developer error. Digging out the error from a huge stack trace is a task well beyond the capabilities of the junior developer, he opined. The JSF implementers deserve the blame in this instance, he said, a blame they share with the app server implementers. It is important to separate presentation and code, he suggested, when working in JSF.

A similar issue concerns Java developer mistakes in working with threads. The problem here is a broken programming model, Horstmann said. Developers should not use primitive features nor share data. Instead, they should be using safe data structures to communicate information between threads.

How do you advise beginners, Heiss asked, and Horstmann responded that, as a first order of business, students should stay within a safe subset of the Java language and the API so that they can use it as a tool to learn some good computer science. Then, focus on code.

Too much of the teaching of Java programming is given over to lecture, Horstmann maintained, with too little time devoted to practicing what they've been taught. In his classroom, his students intersperse practice on a laptop with listening to his lectures. He said is is important, too, for teachers to spend more time on computer science early on and less time on "trivia and minutiae."

Horstmann told Heiss that he found BlueJ and the Alice programming environment useful tools in the classroom. The difficulty of making an error with Alice lessens the frustration level that often drives students out of the program, he said.

As far as Java SE 7 goes, Horstmann said he hoped for closures, which "...will give library writers the ability to write code that is easier for application programmers." He illustrated his point with a brief code sample.

The one Java class he could not do without, Horstmann told Heiss, is java.lang.Object, and he provided a list of changes to the platform that have made things easier for him, again with code samples.

Scripting languages are a sore point with Horstmann, of which there are simply too many, he said. If he had to pick a favorite, it would be Groovy, which has a Java language-like syntax and a metaobject protocol that makes Grails possible, he said.

Horstmann confessed to keeping a "...buggy program running" rather than bailing as his biggest programming error, one that he committed in the day of C programming, which he used for a word processing solution for scientific papers.

He also confessed to a growing enthusiasm for open-source development. He said too many people devalue the quality of open-source software, not appreciating that it is no longer the province of the hobbyist. "I will work around the limitations of an open-source program or contribute a fix rather than work with a closed-source program because I know from experience that I can count on the open-source program to be around for a while," he said.

The Java Champion's final pronouncement was that members of the Java community "...have both the will and the means to improve things and do not passively accept what is handed to us. We don't wait for Sun or someone else to fix what doesn't work. We tinker in a thousand projects and build improved libraries, frameworks, and even new languages. The open sourcing of the Java platform will enable it to be viable for years to come." [...read more...]

Keywords:
Other articles in the Java Technology section of Volume 121, Issue 2:

See all archived articles in the Java Technology section.


From the latest issue:



 


Customized news reports about Sun Microsystems. Just the news you need, none of what you don't.
50,000+ Members. 20,000+ Articles Published since 1998.