File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Agile and Other Processes and the fly likes Code Craft: Grand designs etc. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Agile and Other Processes
Bookmark "Code Craft: Grand designs etc." Watch "Code Craft: Grand designs etc." New topic

Code Craft: Grand designs etc.

George Stoianov
Ranch Hand

Joined: Jan 15, 2006
Posts: 94
Now this is a chapter that sounds intriguing actually they all strike a note (TOC).

I have read many books on different programing language, frameworks etc. etc. but never one on writing code. What is in this book that other books concentrating on grammar and design do not show to the reader? Is it going to teach me how to make good trade offs? In situations when "The best laid plans" are impossible in the face of reality (read requirements/wishes) and the "The need for speed" is ever so present on your shoulder will I get a "Recipe for a program" that will aid with those "Grand designs" "Testing times". Sorry for the poetic excursion, I guess what I am asking is what does the book "preach" about coding and are there good stories in it to keep me reading??

I have always tried to stuff my head with different practices, ideas and directions people a lot more experienced, but I am finding that I have my own way of writing code and that I come up with solutions distinctive in their own right. Will the book expose any situations with real world example and provide the authors best advice? Can you share an example?

Thank you in advance.
George Stoianov
Ranch Hand

Joined: Jan 15, 2006
Posts: 94
I just read the sample chapter To err is human and I like it very much. It made me think and I am going to go back to some things I wrote and have a second look at my approach.

With regards to error handling how far should exceptions propagate it seems natural to me that some libraries doing basic grunt work should raise exceptions and they should go up all the way to the user interaction level and the decision of what to do with them will be made there. Is that correct??

Pete Goodliffe

Joined: Feb 02, 2007
Posts: 24
Hi George,

I'm glad you enjoyed the chapter.

Your question is actually a very deep one, and a thread that could run and run! Perhaps the best advice I can give you is to take a look at a great discussion by Hubert matthews on this that was published in the most recent Overload magazine.

It's available at and would be a good starting point to gain an understanding of the most appropriate way to raise and handle exceptions.

I hope this helps!

George Stoianov
Ranch Hand

Joined: Jan 15, 2006
Posts: 94
Thank you for that link, that was very a very good read as well. There was a mention by the author about some anti-patterns that exist in the Java language as well when dealing with exceptions namely putting more try's in a finally block when dealing with closing sql connections.

In your mind and expereince with different languages how does Java fair in its exception handling compared to other languages?
Thank you.
I agree. Here's the link:
subject: Code Craft: Grand designs etc.
It's not a secret anymore!