Langr's opinion on the "instanceof" operator is a good example. Generally, he says, "instanceof" is a bad tool to use (in a manner similar to that of a switch statement) for identifying an object's class. It's a resource pig, and multiple tests can be hard to follow in code. It's better, he says, to use polymorphism to endow each of several subclasses with identically named methods, each with a different effect. This is the kind of stuff Java programmers debate all the time, but Essential Java Style makes strong cases for many stock solutions. --David Wall
Topics covered: Patterns for solving programming problems in Java, including those relating to methods, messages, problems of state, data structures, formatting, and execution tweaking.
The definitive style guide for writing readable, maintainable Java code
With Essential Java Style, developers finally have a Java style guide that offers detailed patterns for real-world implementation. Using GGD1real code, not abstract discussion, Jeff Langr brings together scores of today's best implementation solutions for the problems every Java developer faces. By standardizing these solutions, developers can build Java programs more quickly, efficiently, and reliably-and above all, make them dramatically easier to maintain.
Langr brings together the most useful ideas from many sources, notably the excellent Smalltalk patterns identified in Kent Beck's Smalltalk Best Practice Patterns (Prentice Hall, ISBN: 0-13-476904-X). The patterns in Essential Java Style cover methods, messages, state, collections, classes, and formatting. Each pattern appears on its own page, with its own name and summary box designed to show exactly which problem is being solved.
Streamline the development processes by using these patterns to eliminate random coding and naming styles that complicate maintenance, overly procedural code that can be difficult to understand, and varying techniques for common operations that are often inefficient.
Essential Java Style will be an invaluable reference for Java developers, managers, and other technical professionals throughout the entire project lifecycle by providing:
Product Details
Would you like to update product info or give feedback on images?
|
|
Share your thoughts with other customers:
|
||||||||||||||||||||||
|
Most Helpful Customer Reviews
36 of 39 people found the following review helpful:
3.0 out of 5 stars
A SmallTalk book disguised as a Java book,
By Brian Slesinsky (San Francisco, CA) - See all my reviews
This review is from: Essential Java Style: Patterns for Implementation (Paperback)
This book was written by an ex-SmallTalk programmer and works best as an opinionated perspective on Java from the SmallTalk programmer's point of view. Langr does a fair amount of complaining about things he believes are not as well done in Java as in Smalltalk, and while I don't always agree, it's an interesting discussion.However, one gets the impression that he took a list of patterns that work well in SmallTalk and reimplemented them in Java, rather than coming up with a list of best practices specifically for Java. Some patterns are so awkward in Java that Langr admits to it and doesn't recommend them -- so why mention them at all? Far too much space is devoted to collections. Most of the recommendations about collections are not really patterns at all, but rather a recapitulation of the API - do we really need a recommendation to use the Stack class to implement a stack? Much tedium could have been avoided simply by recommending that Java developers review the Java collection classes occasionally to avoid inadvertently reinventing the wheel. In contrast, there's no discussion of multithreading. Java's assumption of threads everywhere is where it differs most from other languages. Many design patterns are changed in the presence of multithreading - the pattern of method calls determines how much work is done atomically and how objects get locked, so refactoring methods is not simply a matter of style. So, while the book is interesting and brings SmallTalk ideas to a larger audience, it doesn't really work as a definitive style guide for Java.
18 of 18 people found the following review helpful:
4.0 out of 5 stars
Good concise source of important Java and OO concepts.,
By
This review is from: Essential Java Style: Patterns for Implementation (Paperback)
I come from a similar background as Jeff; COBOL and Smalltalk and I'm just learning Java. The difference between structured/procedural code like COBOL, and true OO code like Smalltalk and Java is significant. I've seen many programmers (including myself) jump to an OO language but still code procedurally. It's a matter of thinking conceptually in objects, and that turns out to be surprisingly difficult for people who have coded procedurally for some time. (This includes Visual Basic, which is not a true OO language). They will think it's OO code, but in reality it isn't, or at least not good OO code. Jeff's book hightlights the essence of Java from the one-foot level: the actual code. Keeping methods short and sweet is a concept lost on many programmers making the jump to OO. Thinking in terms of patterns of objects interacting with each other is also a change in approach to the way many programmers "intuit" the design of their code. Learning Java is not as much about learning the syntax as it is about developing object models before you begin coding, and then once you have the model, it's about implementing the methods correctly. I believe Jeff does a nice job of showing us what well formed OO methods really should look and feel like, as well as creating a style framework on which to base an approach to create consistent, reusable code.
17 of 18 people found the following review helpful:
3.0 out of 5 stars
Great concepts, great examples, but poorly organized,
By A Customer
This review is from: Essential Java Style: Patterns for Implementation (Paperback)
Most programming books on the market today cover a particular language, programming technique, or field of computer science. Aside from university texts, which deal with theory, most popular titles deal with practical issues - the nitty-gritty details of day to day software development. They're quick, fast paced, and teach a particular topic, such as Java networking, or JDBC, or Swing/AWT programming. They focus on how to achieve a task, on short-term goals for programmers on the run. A rarer, but no less important, type of book is one that focuses improving the quality of software development. These type of books usually become industry classics, if written well, and are adopted by universities teaching software engineering classes. But they aren't always relevant to "real-life" software developers, who are often constrained by deadlines and just don't have the time to produce perfectly polished code. The rarest type of book of all is one that combines solid theory, with practical applications. That's the type of book that "Essential Java Style : Patterns for Implementation" attempts to be. The principle underlying this book is that there are certain ways of writing code that can improve the quality of software, and make it easier to create, modify and debug. The book introduces the reader to the principle of design patterns. Design patterns are reusable templates for software design, that represent tried and true solutions to common problems. Design pattern books have been available for C++ and Smalltalk developers for years - but there has been a shortage of good pattern books for Java. "Essential Java Style" provides real-life code examples in Java, as well as a good discussion of the reasons behind these patterns and how they can aid the software development process. The patterns are, for the most part, extremely useful and relevant to practical Java programming - though a certain amount of theoretical patterns that will cause an understanding amount of frustration in practical development are also included. My feeling is that some patterns would have been best left out, while others are such a revolutionary idea that every Java programmer should observe them. The challenge, for the reader, is to choose which patterns to adopt, and which to refrain from applying in practice. While "Essential Java Style : Patterns for Implementation" is an extremely good book for software developers, beginners to design patterns and Java will find the book challenging. In addition, the book suffers from very poor organization -- patterns are not in order, and the reader will have to jump from one to another to gain a thorough understanding. This not withstanding, almost every developer will gain from applying these design patterns to their applications -- not only in the short term, but in the years to come as the application is refined and maintained. The techniques described within "Essential Java Style" : Patterns for Implementation" will most benefit the professional software developer, who is involved in a team project and a medium-to-large-scale software project. -- David Reilly
Share your thoughts with other customers: Create your own review
|
|
Tags Customers Associate with This Product(What's this?)Click on a tag to find related items, discussions, and people.
|