23 Dec 2011, 01:48
Picture_2_pragsmall

Mike Miller (9 posts)

Venkat,

Heard you talk at the Dallas JavaMUG meeting and then ordered your book as soon as I got home from the meeting that night. Really enjoying the book so far.

Comment: Minor observation on the code packaging - if you are going to include the sample code in packages, then you might want to reflect that package structure in the zip file. To run the examples in their current directory, I am going thru and deleting the package statements.

Question/Observation: I’ve read quite a few Java books and your code seems to contain a lot more usage of ‘final’ than I have seen before. Is that on purpose for this book or is that normal for most of your code?

23 Dec 2011, 14:51
Venkatsubramaniam_pragsmall

Venkat Subramaniam (84 posts)

Mike, thanks for your comments.

The package structure is a struggle, it adds levels to the directory in source without adding any value. I understand some IDEs insist on the structure, the lightweight editors I use don’t. So, there is a mismatch between what I did not see and the problem you are experiencing. Your comment is timely, I was writing something yesterday and created the directory structure, but your comment confirms that’s a good idea.

In Java I try to make variables final unless I really intend for them to be mutable. If done right, we would see a lot more final in Java code. This is one of the features I like in Scala, all parameters are final and so no special keyword is needed to indicate that. Since the “good” practice is a deviation from the default in Java, we have to place the extra modifier if we intend to keep that practice.

  You must be logged in to comment