• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Code Craft: Grand designs etc.

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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??

Thanks
 
author
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 http://www.accu.org/index.php/journals/1303 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!

Pete
 
George Stoianov
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic