Tuesday September 26, 2006
Joseph D. Darcy's Sun WeblogJoseph D. Darcy's Sun Weblog When I misspelled "syntactic sugar" the other day, the helpful spell checker suggested "synaptic sugar" as a replacement, a replacement that fits surprisingly well! The goal of the best syntactic sugar, like the enhanced for loop in JDK 5, is to be sweeter for your brain by removing the need to see repetitive details, like the standard induction variable patterns. Syntactic sugar makes tradeoffs between two general effects:
Bug Tracking Blues Last week, I attended a talk by Matt Doar about Common Problems with Bug Trackers or, phrased more directly, Bug Trackers: Do They Really All Suck?. The talk was hosted by the Silicon Valley ACCU; I'm scheduled to give their October talk about common floating-point issues and misperceptions. Matt had a number of interesting observations about the often mundane process of working with a bug tracker. First, a poll of the audience revealed that while nearly everyone uses a bug tracker regularly, no one loves their bug tracker. In contrast, many people will passionately defend tools for other infrastructural tasks like source code management (CVS, Subversion, etc.). A likely cause for this lack of affection is the multiple parties who use a bug tracker, engineers, quality organization, program management, and the disparate ways those groups use the tool and the resulting compromises in the tool's design. Matt identified four broad problem areas with bug trackers:
JSR 269 in proposed final draft I'm happy to announce that JSR 269 has progressed to the proposed final draft stage of the JCP process. This draft corresponds to the version of JSR 269 implemented in build 98 of JDK 6. Please send comments to jsr-269-comments@jcp.org. Changes from the public review draft include:
Iterating over the codepoints of a String Recently I wanted to iterate over the code points of a Therefore, a sequence of Previously, one way to iterate through the character values of a String was to look at each
String s = ...
for(int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
// Process c...
}
Now, the chars need to be considered as possible members of a surrogate pair representing a single code point. Currently the canonical loop for this operation is:
String s = ...
for(int cp, i = 0; i < s.length(); i += Character.charCount(cp)) {
cp = s.codePointAt(i);
// Process cp...
}
At present, there is no direct API support for getting an iterator of the code point values from a String or CharSequence; perhaps one will be added in the future.
Glossary of Unicode terms (2006-09-18 16:21:22.0) Permalink Comments [2]
JDK 6 Build 97 and 98 JSR 269 API Changes Compared to build 96, build 97 only contained an assortment of minor corrections and clarifications to the API, such as fixing typos and adding additional cross references to sections of the JLS. The most systematic change was updating the javadoc of the methods in the utility visitor classes to follow the recommended pattern for methods intended to be overridden: state the general method contract (in this case with Build 98
Recommended reading for compiler writers Some thoughts on this topic raised by Peter, while the Dragon book is certainly a classic and solidly covers the basics, it is now long in the tooth and doesn't cover important compilation and code generation concepts and techniques useful for more recent language environments, like the Java programming language and virtual machine. Requests for compilation references are a common question on the comp.compilers newsgroup and a number of recommendations (including the Dragon book) are listed in the group's FAQ. For numerics related topics, Goldberg's What Every Computer Scientist Should Know About Floating Point Arithmetic discusses why not all floating-point "optimizations" that can be applied should be applied and Henry S. Warren's Hacker's Delight is a rich resource for low-level arithmetic tricks. (2006-09-06 19:04:29.0) Permalink |
Calendar
RSS Feeds
All /Annotation Processing /General /Java /JavaOne /Numerics /OpenJDK SearchLinks
NavigationReferersToday's Page Hits: 831 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||