Archive for the 'Java' Category
Unboxing as a Java Interview Question
7 Comments Published May 14th, 2008 in Exception, Interview, Java, QuestionSometimes I ask an unboxing question during Java interviews. “What can happen with unboxing? See this code:”
Integer i1;
…
// do some things with i1;
…
int i2 = i1;
The thing that can happen is that i1 is NULL which will result in a NullPointerException being thrown.
“What is the problem with the NPE here?” There are several […]
Bending Java: More readable code with methods that do nothing?
12 Comments Published May 9th, 2008 in Beautiful Java, Bending Java near the Breaking Point, JavaFrom the category “Bending Java near it’s Breaking Point” or “What a stupid but interesting idea”. I like to explore ideas in Java that are inside the language spec but outside of common usage or style guides. I think Java has a lot more to give than what people did the last ten years. Before […]
After my 200 reader milestone in January, we’ve reached the 300 (317) reader milestone. Thanks to all the regular readers of this blog for listening. I know 300 is still not as many readers as others have, and it might drop below 300 the next day, but I’m still thankful for everyone of you (including […]
Never, never, never use String in Java (or at least less often :-)
74 Comments Published May 2nd, 2008 in JavaNever, never, never use (unwrapped) String or long or int. Why? Those primitive types have no semantic meaning. They are hard to understand, hard to maintain, and hard to extend. I’ve been evangelizing this concept for some time, the essay “Object calisthenics” finally prompted be to write this post. Suppose we have an example of […]
The unholy legacy of databases
5 Comments Published April 30th, 2008 in Amazon S3, Databases, Java, RDBMSWhen reading about the status of Qi4j on Rickards blog, I stumbled about
Entities are really cool. We have decided to split the storage from the indexing/querying, sort of like how the internet works with websites vs Google, which makes it possible to implement really simple storages. Not having to deal with queries makes things […]
Immutable objects help with avoiding bugs. Suppose I have two interfaces implementing the Immutable Interface pattern. One interface for Point and one with MutablePoint. The pattern suggests a cast to ImmutablePoint p; ((Point)p).setX( 1.0 ); get the mutable interface. This isn’t safe and can be replaced with a Generics solution.
First we have the mutable […]
John Resig on ExtJS, the GPL fiasco and open source community style
2 Comments Published April 28th, 2008 in GPL, Java, Open SourceIt seems as it does not end.
Reading a comment from John Resig, the (or one of the geniuses, sorry if there are more :-) genius behind jQuery, a library which was for some time a basis for ExtJs (beside YUI), irritated me a lot.
We (the jQuery project) worked hard with them to try and fix […]
Book Review of “The ThoughtWorks Anthology: Essays on Software Technology and Innovation”
8 Comments Published April 25th, 2008 in Book, Java, ReviewMy very short review of The ThoughtWorks Anthology. The ThoughtWorks Anthology contains 13 essays on software development from different people. The quality of the essays varies widely but in the end: Recommended.
Solving the Business “Last Mile”
Excellent. Worth the book alone. This essay will lead the community to accept that there is a growing last […]
More cluelessness from ExtJS lead developer Jack on the GPL issue
12 Comments Published April 24th, 2008 in Copyright, ExtJS, GPL, Java, LGPLReading the excellent analysis on A little Madness about the GPL and ExtJS issue, there is more cluelessness in a comment by Jack Slocum the ExtJS lead. He claims that others
“[…] wrap it up and sell it as their own. […] With no mention of us at all.”
Nope, that would be illegal in most countries. […]
I haven’t been using the final keyword in Java for 10 years, but more and more I think it’s an excellent keyword in Java. All local variables should be declared final. Today one of the developers of my team made every local variable in a method final and I was wondering how strange that looked. […]