Save Big On Open-Box & Pre-owned: Buy "Java Pitfalls: Time-Saving Solutions and Workaroun...” from Amazon Warehouse Deals and save 87% off the $39.99 list price. Product is eligible for Amazon's 30-day returns policy and Prime or FREE Shipping. See all Open-Box & Pre-owned offers from Amazon Warehouse Deals.
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
Java Pitfalls: Time-Saving Solutions and Workarounds to Improve Programs 1st Edition
Use the Amazon App to scan ISBNs and compare prices.
Special Offers and Product Promotions
"Any programmers office would benefit from having at lest one copy of this book hanging around." (Application Development Adviser, September 2000)
"I found the book useful..."(Cvu, February 2001)
From the Author
The introduction describes a pitfall as "code that compiles fine but when executed produces unintended and sometimes disastrous results." Saving developers frustration and time by pointing out these traps is the primary motivation for both this book and my JavaWorld column. This book is not a book on effective design or design patterns but instead offers hard-won, practical experience. It is those proven solutions both in the language and beyond the language (in util, io and swing) that our readers have benefited from. Best wishes, - Mike Daconta
Top Customer Reviews
After reading through even a few pages of tips within the book, you understand that the advice isn't dry theory, but practical advice gained from real-life problems that Java developers face. Michael Daconta, and his co-authors, offer warnings gained from the trenches of software development using Java.
The book is divided neatly into eight sections, covering different aspects of Java programming. A wide range of areas are covered, from the obligatory Java language syntax, to more fun topics like graphical user interfaces (using AWT and Swing), the utilities package and collections, input and output (I/O), and even improving Java performance. The one significant area lacking from the book, in my opinion, is a section on network programming pitfalls, and perhaps other advanced topics like databases. These areas are fraught with pitfalls for the unwary. However, for readers not involved with such areas, this is a moot point, and it leaves more room for other tips.
There are a total of 50 individual pieces of advice, and each is packed full of detailed code examples.Read more ›
Take, for example Item 17, where three pages are devoted to explaining what exceptions are. Then there is an example of catching an exception, printing some diagnostics, and re-throwing exactly the same exception. Suddenly, the topic veers to catching OutOfMemoryError. Where is the explanation of the pitfall of mistakenly catching exceptions when they should not be caught, or catching Exception instead of a subclass of Exception? In my experience, these are the pitfalls that Java programmers are more likely to run into. The authors simply didn't explain how 95% of exception handling code should be written.
Another example is Item 12, where synchronization is introduced in five pages. The pitfalls I see Java programmers falling into is believing that only one synchronized method in a class may be called at a time, not understanding how static methods are synchronized, and not understanding memory barriers. The authors skip right over those topics and start discussing how to avoid deadlocks.
In my first hour of looking through the book, I also found the authors confusing references with objects, passing a reference by value with passing an object by reference, setting references to null and calling System.gc() with rational memory management, exponential growth with quadratic growth, simple assertions with design by contract programming, the semantics of the C assert macro with the semantics of a Java assertion method, the Adapter pattern with a simple superclass, and the Java import statement with the #include directive of C.Read more ›
*)Covers a lot of java topics, from language syntax, API (JFC) to performance issues.
*)Concrete, real examples.
*)OO design issues, as MVC patterns, lazy evaluation, etc.
*)Some issues are java related, which have different behaviors in C++, as "Passing Primitive by Reference", "Boolean Logic and Short-Circuit Operators", well done.
*)Explanation can be deeper, and clearer.
*)No contributions to enterprise java: javabean, JDBC, RMI, Servlet, JSP, EJB.
*)Some explanations are not accurate: for example: Abstract methods must be overridden should be replaced by "Abstract methods must be overridden in CONCRETE classes".
*)No references at the end of the book, <Effective C++>>, <<Design Patterns>> can be listed.
Buy this book with <<Practical Java Programming Language Guide: The Addison-Wesley Professional Computing Series>> (ISBN: 0201616467) and/or <<The Elements of Java Style>> (ISBN: 0521777682).
The premise of Java Pitfalls is primarily to help those who are familiar with the langauge and have had some experience producing applications in Java. As with all programming languages, there are always better, more efficient ways to do things. Some are obvious and usually cross many languages, and some are not so obvious and are very language-specific.
Java Pitfalls points out a lot of common mistakes made in Java development as well as providing optimization and means of producing much cleaner code that runs faster and uses less memory.
The examples are very thorough and the book is very concise in its reasoning for why certain ways of implementing Java are faster than others, complete with benchmark results comparing the common ways of implementing solutions to their more optimal solutions. The book doesn't just show you how to write code more efficiently, it also explains to you why some methods are better than others.
Again, I can't say enough about this book. It's like having a group of experienced Java engineers sittings beside you as your program. A great book all around.
Most Recent Customer Reviews
Java Pitfalls is an average book that junior level Java developer may find useful. The book is divided into several sections, with each section containing one or more ideas, tips,... Read morePublished on August 9, 2002 by Jonathan J. Calvert
The first paragraph in the book uses the word `effective' six times an obvious attempt to be associated with Scott Meyer's successful "Effective C++" and the genre of "Effective"... Read morePublished on November 10, 2001 by Doug Bell
This appears on a number of lists of must have Java books, and it is definitely on mine.
The first time it saves you five hours otherwise spent on some little Java detail that... Read more
For anyone serious about learning and understanding the issues programmers think about! Daconta helps you plug those holes in the technology that other authors or instructors never... Read morePublished on October 18, 2001 by Farris S. Alamat
The issues raised in this book are few, and they are well-known and they are not interesting. E.g. the stuff about Strings in Java, well everyone knows it after 0. Read morePublished on August 7, 2001 by heikki doeleman
At first this looks like a really valuable book. It shows the common pitfalls of Java and elegant ways to get around them. Who wouldn't want to know this stuff? Read morePublished on June 9, 2001 by Richard Hassinger
Don't buy this book unseen. I did and I regret it. It was certainly not the eye-opener I hoped it to be. Read morePublished on May 17, 2001
As an intermediate Java programmer, I've hit several of the items in this book, and it's already saved me time in finding my mistakes. Read morePublished on May 8, 2001
This is the best book I have read on Java language. There was lot of stuff I never thought about. Lot of issues is addressed in Java Developer Connection but it is hard to search... Read morePublished on April 11, 2001 by A. Gupta