pseudohumor
if (isBloggingInPseudocode()&& intendedEffect() == Effect.HUMOR) { try { beFunny(); // this line unreachable } catch (NotFunnyException e) { feign(Reaction.SURPRISE); }}
View ArticleMinor API fixes for JDK 7
Josh, Doug and I are proposing a handful of minor API additions to the Java Class Libraries (lang, util, math and reflect) for JDK 7.The very quick overview of our recommendations:Static compare()...
View ArticleWhat Google Java engineers do while... waiting... for IntelliJ to unhose...
This discussion happened on our internal Java mailing list.Dan: "What libraries do people use for generating PDFs from java?"Tim: "I used iText. It works pretty well."Fernando: "+1 for iText."Steve:...
View ArticleOccam's Coder
When deciding between two or more choices for a style rule in your team's programming style guide, and all of these lead to code that is equally maintainable, prefer the rule you can explain in the...
View ArticleWhy does Set.contains() take an Object, not an E?
Virtually everyone learning Java generics is initially puzzled by this. Why should code like the following compile? Set<Long> set = new HashSet<Long>(); set.add(10L); if (set.contains(10))...
View ArticleArticle 19
Can you watch this without smiling?If so... I don't know. You might be a replicant or something.
View ArticleNow with "customizable sodomy!"
Holy shit, I want the version of Mass Effect that this guy played!Mine is apparently defective. A damn good game though... but I think the sex-with-blue-chicks was about as hot as Kirk's typical...
View ArticleThe smallwig theory of optimization
There are three kinds of optimization. Optimization by using a more sensible overall approach.Optimization by making the code less weird.Optimization by making the code more weird.You've probably...
View ArticleThe real difference between List and List, illuminated at last
Suppose you're a store clerk, and a customer asks you, "what kinds of credit cards do you accept?"The difference between List<Object> and List is basically the difference between answering this...
View Article" "
Who among my readers believes that he/she has a firm grasp on the meaning of the term "whitespace" as it applies to modern Java development?Anyone?Whitespace! How much simpler could anything be than...
View Articlefun with IdentityHashMap
What does this program print? (Eliding the generics so you can read it.)public static void main(String[] args) { Map m = new IdentityHashMap(); m.put("a", 1); m.put("a", 2); m.put("a", 3);...
View ArticlePure functions
To its detriment and yours, the Java language makes no distinction between a pure function, and any plain old subroutine. Even in the core libraries, the two are freely intermingled, with no obvious...
View ArticleI get to break awesome news
I asked Josh if I could have the pleasure of breaking this news on my li'l blog here, and unbelievably, he actually said "sure."Lucky me! Here's the news:Effective Java, Second Edition by Joshua Bloch...
View ArticleInteresting Stuff I Read
I've added a link to my Google Reader shared items in my sidebar. You can view that, or subscribe to its feed, or whatever! (You don't have to be using Google Reader... though you should). :-)
View ArticleJavaOne approacheth
Just got my sessions all scheduled. As usual, I chose them more for the speakers than for the topics; there are certain individuals who I just know can speak well and tend to talk about topics I like...
View ArticleCommon Java unchecked exception types
I've noticed a lot of confusion about what type of unchecked exception is the right one to throw under various circumstances. Here's a very simple explanation of the most common...
View Articlesmall favor
Hey, everyone? Like, the next time you're making some clever analogy about something you don't like, involving the concept of "riding the short bus?" You know what I mean -- like "maan, with all these...
View ArticleArticle 6
I'm curious: what do you use to parse command-line options in your Java programs?You know, -r, -w, -rwl, --use-flibbert, --foobar=12 and all that kinda stuff.
View ArticleGoogle Collections presentation
If you'd like to know more about the Google Collections Library, here's a video you can watch:It continues here. Or if you're in a rush you can just skim the slides, not that I recommend it. :-)Hope...
View ArticleArticle 4
So good I had to come out of blogging hiatus just to share it with you:"Governor Palin, are you ready at this moment to perform surgery on this child's brain?""Of course, Charlie. I have several boys...
View ArticleAnyone still out there?
Wow, I can't believe it's already been almost a year since I posted anything meaningful on this blog. Blogging is a total ON/OFF switch with me.However, now I must post, in order to tell you that you...
View ArticleThe little optimization that couldn't
Let's say you represent two groups of people. If I collect one penny from each member of Group A, then, from the unbounded kindness of my heart, give one dollar to each member of Group B, has the total...
View ArticleGuava release 05!
Guava release 05!Hello guavateers,I'm happy to (finally) inform you that Guava release 05 was quietly posted two weeks ago! It is also in the central maven repository as com.google.guava:guava:r05 (as...
View ArticleArticle 0
Oh dear. I just discovered that some places still link my name to this site. Eep! A better link would probably be my Google Profile, now.
View Article
More Pages to Explore .....