Slashdot Mirror


Effective Java

benjiboo writes "From the back page: 'Are you looking for a concise book packed with insight and wisdom not found elsewhere? Do you want to gain a deeper understanding of the Java programming language? Do you want to write code that is clear, correct and reusable?' I did, so I bought the book and decided to use it for my first review :)" Read on for bejiboo's review of Effective Java. Effective Java Programming Language Guide author Joshua Bloch pages 252 publisher Addison Wesley rating 8/10 reviewer Ben ISBN 0201310058 summary 57 pieces of Java wisdom.

Introduction

Effective Java is a book very much in the style of Scott Myers' earlier C++ "Effective" series. The book contains 57 individual snippets of Java wisdom, broadly categorised into 10 sections including Classes and Interfaces, Exceptions, Threads and Serialisation. Scott Myers' books are classics; I was interested to see how this would compare.

The author, Joshua Bloch, has been involved in writing many industrial-strength Java libraries. His background is very much evident, in this, his first text. He consistently demonstrates the virtues of favouring libraries, clean APIs and advance design. I found the author very readable, and able to make a convincing argument, even in his more 'controversial' pieces. As with Scott Myers' books, there is a real-world, rather than purist approach taken to the language, with most of the code examples having a real-world feel to them. This is a breath of fresh air when lots of programming books tend to use more contrived examples.

The items

The author has endeavoured to keep the book accessible to less-experienced programmers throughout, while providing food for thought for the more advanced reader. For the most part this is succesful, but a small percentage of articles tend toward the simple side. Examples include 'Minimise the accessibility of classes and embers,' 'Write doc comments for all exposed API elements,' and 'Know and use the libraries.' We've all heard this advice many times and I don't feel that these add value. The vast majority however, are pitched at the right difficulty level. The selection of items is well balanced and broad, although unfortunately there are none pertinent to GUI programming.

Many of the articles are fundamentally based on known design patterns and idioms. Although a useful index to these patterns is included, I would have liked to see the virtues of design patterns summarised and demonstrated to a greater extent, perhaps in the introduction.

I was highly impressed with all code examples. Where used, they are consistently short, relevant and concise, with more verbose examples included on the website. The chosen code examples only ever assist in explaining complex concepts clearly.

The strongest area of the book for me was the section on threading. The author clearly demonstrates, for instance, how overuse of synchronised methods can lead to deadlock. He also provides food for thought on how the thread scheduler might trip us up. A section on moving from C constructs, which initially struck me as an odd category, proved very interesting and thorough. 'Replace enum constructs with classes' is a particularly interesting item, demonstrating the fragility of C enums, and indicating why the often-used replacement in Java (a bunch of public static constants) suffers from the same failings.

In conclusion

Ideally I would have liked to see some of the thinner items removed, and perhaps replaced with a section on the GUI libraries. I also liked the short prose sections, and thought the author could have spent more time setting out his stall before launching in to the items. Having said this, this is one of those rare books which could help a good programmer become an excellent one. Many of the books currently out there are aimed at either the beginner or the guru, and this book fills a gap.

I find this style of book very useful, in that I could foresee meeting the vast majority of the described situations at some point or another. So long as you aren't looking for tips to help you with your GUIs, this title is more than worth the investment.

For anyone interested, those sections in full:

  • creating and destroying objects
  • methods common to all objects
  • classes and interfaces
  • substitutes for C constructs
  • methods
  • general programming
  • exceptions
  • threads
  • serialisation

You can purchase Effective Java from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

157 comments

  1. Practical Applications by First_In_Hell · · Score: 0, Offtopic
    I am mainly a Visual Basic (VB6, not the abortion that is .NET) programmer that writes client applications to talk to SQL databases (reporting, data entry . . . etc). I was always interested in learning a new programming language, but I was not sure if JAVA was the right one for this implementation.

    In a Windows dominated enviorment, is there any other better alternative to what I am already using? Does Java make sense?

    1. Re:Practical Applications by aosgood · · Score: 0, Flamebait

      The only good JAVA is the one in my coffee cup.

    2. Re:Practical Applications by dissonant7 · · Score: 3, Insightful

      In a Windows dominated enviorment, is there any other better alternative to what I am already using?

      The abortion that is .NET seems to work alot better than the hideous quivering zygote that is VB6, IMHO. In particular C#.

      Really, I would say that it depends on the environment. If the back end is Oracle or DB2, I'd probably go with Java; if it's SQL Server I'd be more inclined to go with .NET. I'd also go with Java if your IT department had any plans to change platforms in the future. .NET and company allow MS to keep a string tied to your IT decisions unless you're willing to abandon your code.

    3. Re:Practical Applications by Anonymous Coward · · Score: 0

      The primary strength of Java, IMAO, is the cross-platform operability. Of course, nothing is perfect...but all things considered, JAVA does a decent job.

      However, if you dont't need your programs to run on multiple platforms, then the cost (memory-intensive slow runtime environment) is probably not worth the gain.

      C++ is my preference, provided you can hold yourself to strict coding-conventions.

      $0.02

    4. Re:Practical Applications by Poilobo · · Score: 1

      Java probably isn't the best choice if you're coming from VB. Mainly because of how spoiled most people get after using a Microsoft IDE, and VB's is damn nice. ;)
      Besides, if your skill set is based around MS products why not look into C#. I can tell you from experience that C# is a hell of a lot easier (or maybe more intuitive???) than Java. I like Java a lot, but damn is it painful to do GUI based apps. If you do decide to go the Java route take a look a the Eclipse IDE, it's not quite like using an MS IDE but it's clean and stays out of the way (cough**Borland**cough).

      --
      Sig (appended to the end of comments you post, 120 chars)
    5. Re:Practical Applications by stratjakt · · Score: 2, Informative

      I've found ODBC-style data access in Java to be only slightly less painful than doing it in Visual C++.

      I'm in a similar situation, developing and maintaining a data access application in VB6 that has reached 'critical mass', has gotten too big for it's britches, and needs to be rewritten from the ground up.

      I've been doing a lot of thinking about what it will be rewritten in, and so far C# and VB.net are leading the pack. All Java has to offer me is some platform independence, which is pretty much irrelevant in my particular case, and I doubt it would be worth headaches like throwing out all the code that's written.

      Anyways, this is all contingent on the dorks in marketing not selling imaginary software that I have to write 2 weeks before shipping, that I may have time to make the actual software work.

      --
      I don't need no instructions to know how to rock!!!!
    6. Re:Practical Applications by magnum3065 · · Score: 1

      Well, I believe C# is a good alternative for VB programmers. You still have the GUI design tool that you'd be accustomed to, though with all the benefits of a good object-oriented language. C# is also makes it easier to integrate pieces of a program written in multiple languages, or link to DLLs. JNI is alright, but is not as straight-forward as in C#.

      I like Java a lot, though primarily for use in building web applications, not stand-alone client applications.

    7. Re:Practical Applications by Gramie2 · · Score: 2, Informative

      You could go with Delphi. Anecdotal evidence suggests that many VB programmers are switching to Delphi rather than to VB.Net.

      Visually, there are lots of similarities with VB, but with more power. You can go under the hood and get as low-level as you want, short of device drivers (where at least a small part must be written in C/C++).

      As a bonus, data-aware controls actually work! (even MS recommends not using them in production VB code.)

      There is a version (C++ Builder) that uses C++ instead of Pascal as the basic language, and another package, Kylix, that can compile Delphi/C++B source code to run on Linux.

      Borland also hosts a fantastic developer community (especially newsgroups), and most components, even commercial ones, have source available. Look at Torry's for thousands of components/tools/apps.

    8. Re:Practical Applications by mbbac · · Score: 1

      You might be interested in reading this information at the VB developer center.

      --

      mbbac

    9. Re:Practical Applications by ninejaguar · · Score: 1, Informative

      Don't learn Java. Learn OOP, and implement what you learn, as you learn, in Java. That is the best advice no one ever gave me. When you learn OOP, it doesn't matter what Java-like language you learn, as the real skill will be portable to other languages, like C#, SmallTalk, Python and Ruby. Let me explain.

      I recently decided to go into the field of programming, and probably don't have 1/10th your development experience. However, my research skills are equal to anyone that I know, and they've certainly helped me in getting a grasp on the fundamentals of software engineering (or problem solving as I've learned to call it).

      I chose Java because of its touted strengths, and because I wasn't sure of my target platform yet. I soon understood that as an introductory language, it has some conceptual hurdles that may get in the way when first learning to program. After a while, I began to understand the basics of programming by supplementing my self-study with older languages like BASIC. Essentially, diving straight into Java without first learning the standard structures of programming (sequence, selection, and repetition) was a handicap. However, for someone who already knows Visual Basic, such as yourself, the biggest hurdle will be the concepts of Object Oriented Programming.

      If you think you "know" Object Oriented Programming but have only implemented it in VB, then I would suggest that you may not know everything that you need to program in OOP properly. There are plenty of Java programmers out there, but looking at some of their code, I see a definite lack of understanding in how to implement OOP. I see procedural programming techniques being applied to a language that will allow for it, but the developers lose the real advantages of using OOP.

      I would recommend that you get a "beginners" book on Java (John Smiley is an excellent resource with his Learn To Program Java) to become familiar with the mechanics. If you prefer, you can try a Java in 21 Days/24 Hours type book. It doesn't matter, because if you follow my advice, you will actually learn to program OOP which is by far the largest hurdle, not syntax/grammar/classes. The most beneficial book I've found on the subject is from a master on the subject:

      Sams Teach Yourself Object Oriented Programming in 21 Days
      by Anthony Sintes
      ISBN: 0672321092

      This book will not only teach you how to program OOP, it will teach you to do it the right way. This is done by showing you how not to program OOP, and immediately showing you an alternative.

      The author has some serious credentials: "Tony Sintes has worked with Object-Oriented Technologies since 1995. In that time, Tony has been part of many object-oriented development efforts. Currently, he works for BroadVision where his main responsibility as team mentor, building the skills of less-experienced developers. He brings his years of experience and ability to teach to different projects in order to guarantee their success.

      Tony Sintes has written for JavaWorld, Dr. Dobb's Journal, LinuxWorld, JavaOne Today, and Silicon Prairie, where he produced a highly-regarded monthly column on Object-Oriented Programming. Tony currently writes JavaWorld's monthly Q&A column."

      About the book: "Sams Teach Yourself Object Oriented Programming in 21 Days differs from other OOP books in two main ways. Many classic OOP books are designed for software engineers and teach at an academic level. Sams Teach Yourself Object Oriented Programming in 21 Days presents accessible, user-friendly lessons designed with the beginning programmer in mind. Other OOP books work to present both OOP and to teach a programming language (for example: Object-Oriented Programming in C++). Although Sams Teach Yourself Object Oriented Programming in 21 Days uses Java to present the examples, the book is designed to present concepts that apply to any OOP environment."

      Days 1-7 cover the core OOP concepts with every other chapter covering the implementation of the concepts in the previous chapter and a boatload of do's and don'ts. For instance, in Chapter 2 you learn about Encapsulation theory (more importantly, what NOT to do). Chapter 3 you write code implementing Encapsulation...and so on.

      Days 8-14 covers how to apply the OOP you've learned using design patterns like MVC.

      Days 15-21 take the things you learned in the past 14 days, and make a GUI-based application. You apply the MVC pattern in making the app. Very cool.

    10. Re:Practical Applications by Anonymous Coward · · Score: 0

      I totally agree. After using Delphi, I have no idea why people use VB other than to be Microsoft certified developers/solution providers. Delphi is probably the most under-rated language in the Windows world.

      It has the best user interface. Making Windows apps are a breeze. For database apps, it is great. The data-aware controls are designed how they should be. It comes with an amazing set of controls. With Delphi you almost have the power of C++ but with great ease of use (quite contrary to MFC on the ease of use side).

      Ofcourse no language is perfect but for Windows based programming, Delphi is probably the best choice for general apps.

      (Why are we talking about this in a Java book review thread?)

    11. Re:Practical Applications by pmorrison · · Score: 0, Offtopic

      My rule of thumb for Windows database applications is that if it can be done in Visual Basic, it's faster to do it in VB than most anything else. This held through VB6. So if it's productive work you're after, why switch?

      I would say that if you're sticking with Windows and want to learn a Java-like language, C# or -even- VB.NET would be your best choices. C# has a lot in common with Java, and VB.NET has a lot in common with C#. And they'll both work better than any Java alternative, you can bet Microsoft will see to that.

      But then I'd say 'why not learn Python?'

    12. Re:Practical Applications by Anonymous Coward · · Score: 0

      Java has much more to offer than just cross platform capability. I design and test on NT and field immediately on UNIX. Java has built in collection classes closer to the Smalltalk model (Common Object class) as well as very easy networking (socket programming), RMI, built in Internet code, encryption, database access, components, threads ... and thats only in the Standard edition and well integrated. Add a consistant exception model, a more purely OOPs envirionment.

      And you have a tool that can do most of what you need in a complex multi node, multi threaded multi-national environment that is well integrated. And can be self documenting. The Run Time API book was just a Javadoc of the code.

      With the latest JIT compilers the speed is very good.

      So ok they over did it with Swing and AWT is too simple and clumsey, but you should be fielding thin client Web based applications anyway for a lot of reasons. .Net's one platform any language vs Java's one language any platform.. well If you have ever inherited a multi language application where the people have left.. buy a big bottle of asprin.. or look for another job. That is not a feature!

      I'll post this anonomously to avoid MS retribution..

    13. Re:Practical Applications by Anonymous Coward · · Score: 0

      Perhaps, but versions of VB tend to be different (not just file formats; code and syntax), and incompatible. Even though VB can import old code to an extent, there is no built-in translation in VB to take care of the real bug-a-boos (like system call syntax that changed for no reason and with no additional functionality, and defaults changing back and forth.)
      The best example I can think of is the whole ByVal/ByRef problem in VB. In .NET, functions' arguments default to ByVal and in VB6 they default to ByRef.
      Will they do the same thing with later versions C#? You can bet on it. MS loves to throw away backward compatibility, and there is no hope of ever finding forward compatibility (Don't mention DirectX. It doesn't really deliver either promise.) Besides, how much does C# really offer that C++ doesn't? Yes, a few nice features, but if you want those and are unconcerned with platform dependance or the natural risks of using a new/young language, go try D. At least the D specification admits that it could change drastically at any moment.
      I will admit that VB is useful for drawing a simple interface, though.

    14. Re:Practical Applications by Anonymous Coward · · Score: 0

      I am mainly a Visual Basic...programmer

      I'm sorry.

    15. Re:Practical Applications by MrResistor · · Score: 1

      If I were in your shoes I would go with VB.NET. With .NET VB finally became a real language. I still don't like using it, but I have to give it some grudging respect.

      --
      Under capitalism man exploits man. Under communism it's the other way around.
  2. From the people who brought you: by stratjakt · · Score: 0, Funny

    The Little Giant
    Military Intelligence
    Advanced BASIC
    Resident Alien
    Found Missing

    now comes Effective Java, another great title in the series by noted author Ox E. Moron

    --
    I don't need no instructions to know how to rock!!!!
    1. Re:From the people who brought you: by blinder · · Score: 5, Insightful

      having developed many effective applications for a few years using java, i can, with confidence respond that "Effective Java" is not a contradiction. i've found that most "java haters" are those whose experience goes no further than the applet. too bad sun ever conceived of that little painful abomination.

      java is like any other language, its a tool to get your job done, and contrary to popular belief, it gets it done rather nicely.

      of course i don't mean to wax religious here... there's enough of that here.

    2. Re:From the people who brought you: by Anonymous Coward · · Score: 0

      Along the line of thinnest books:
      Jewish Athletes
      Bright Black
      Blonde Brunettes
      Fun mispellings

    3. Re:From the people who brought you: by Anonymous Coward · · Score: 0

      Cmon, everyone knows that
      effective java == perl

    4. Re:From the people who brought you: by Shamashmuddamiq · · Score: 2, Informative
      ...uh, quite the contrary.

      I've been required to use Java non-stop from late 1995 until quite recently for school, internships, and then for my career. I've used every version of Java, and every API and just about every class available in the SDK. I've written applets, mathematical programs, games, medical database apps for the department of defense, class projects, enterprise-level call center applications, and just about anything else you could possibly conceive.

      I've found in my experience that Java is good when it's highly specialized and kept very small and simple (yes, Java is good for APPLETS!). For enterprise applications, it _sucks_.

      It's not that the language itself is bad (although it certainly has some gaping holes). It has more to do with the poor (buggy) implementation of the APIs and the real-time interpretation. Java isn't nearly as portable as they would have you believe (writing a 100-line applet and then running it on two different web browsers will tell you that.) Additionally, in my opinion, Java would have been much more useful if had been designed as a compiled (not interpreted) language.

      In my current job, I use a lot more C++. I like it. It does what I tell it to do, and I don't have to second-guess the tools every time there's a problem.

      --
      ...just my 2 gil.
    5. Re:From the people who brought you: by DavidNWelton · · Score: 1

      "It's a tool to get your job done"

      Which is a very sensible sentiment. The problem is that, because Sun has spent millions of dollars marketing it, management now thinks that it is the only tool to get the job done, when there are many other fine tools, such as C, Tcl, Python, etc... that each have good features.

      That's what I find frustrating about Java. That and the fact that I like free software, and the Java comunity doesn't seem to have the strongest of relationships with those ideals.

    6. Re:From the people who brought you: by cyranoVR · · Score: 3

      I've found in my experience that Java is good when it's highly specialized and kept very small and simple (yes, Java is good for APPLETS!). For enterprise applications, it _sucks_.

      Interesting observation...

      Why don't you give us some specific examples to back up that sweeping statement?

    7. Re:From the people who brought you: by Glock27 · · Score: 2
      It's not that the language itself is bad (although it certainly has some gaping holes). It has more to do with the poor (buggy) implementation of the APIs and the real-time interpretation.

      Which APIs? Which bugs? Nothing is bug free. Also, your comment about "real time interpretation" is off base, see below.

      Java isn't nearly as portable as they would have you believe (writing a 100-line applet and then running it on two different web browsers will tell you that.)

      Applets apply to Java portability how again? Are you under the impression that some significant amount of Java development today relates to applets? Answer: not really. Further, if you use a decent JRE in both browsers you'll find you have no applet portability problems either.

      Additionally, in my opinion, Java would have been much more useful if had been designed as a compiled (not interpreted) language.

      Now you are exhibiting true ignorance for the world to see. There are many traditional, ahead of time, Java compilers. gcj, TowerJ and Jet come to mind. Look back at the recent article on x86 Linux numerics. Check out the linked article from that post - note gcj is only 9% slower than g++. Supposedly gcj 3.3 and 3.4 both improve gcj speed substantially over the 3.2 compiler used in that article...one guesses the more mature g++ will see less speedup.

      In short, your reasons for liking C++ over Java don't hold water except for verbosity. ;-)

      (BTW, I'll give you a strong reason for disliking C++ - you can't turn on bounds checking in STL arrays using operator[] without hacking STL. Ugly.)

      --
      Galileo: "The Earth revolves around the Sun!"
      Score: -1 100% Flamebait
    8. Re:From the people who brought you: by Shamashmuddamiq · · Score: 1
      Which APIs? Which bugs? Nothing is bug free. Also, your comment about "real time interpretation" is off base, see below.

      I remember the AWT and then, especially, Swing being extremely buggy. Trying to get a combobox to display correctly when you put it at the bottom of a window is one of the many problems I can remember right now. I understand that the APIs are still "new" (relative to the STL?) and constantly under development, but that makes using Java a poor management decision.

      Applets apply to Java portability how again?

      The Java platform is ported both to operating systems and to browsers. Using applets as an example of the poor portability of Java bytecode across different Java platform implementations is a perfectly good example of the over-hyped "portability" of Java. "A lot of people don't use Java applets" is not a good rebuttal.

      Now you are exhibiting true ignorance for the world to see.

      You should know that when you attack the person on the other side of the discussion, you're making it easier for the more intelligent readers to dismiss your arguments. As I said (and as you quoted), Java was designed to be an interpreted language. Yes, there are "real" Java compilers out there, and they're getting pretty good. I'm excited for what the future has in store for the maturity of free Java platform implementations. But the Java compilers available have never been good enough for management to say "let's use gcj instead of Sun's JVM".

      Notice I never said that "Java is slow", although you spend an entire paragraph trying to convince me otherwise. The dynamic recompilation (JIT) that is available in most Java compilers is certainly a good thing, and compiled java is even better. But memory consumption, API compatibility (!), and yes, even speed, are things that need to be considered in a language that's going to be the foundation of a substantially large application.

      I'll give you a strong reason for disliking C++ - you can't turn on bounds checking in STL arrays using operator[] without hacking STL.

      Are you saying that C++ is a bad language because the STL doesn't do bounds checking on arrays?? I can personally think of several reasons for disliking C++, but that's never been one of them.

      --
      ...just my 2 gil.
  3. thanks benjiboo by nuffle · · Score: 1, Interesting

    thanks for submitting a rare thing: a good slashdot book review. timothy, if you want us to pay any attention to these reviews, you need to keep the quality more like this one.

  4. Effective Java? What is this Java? by burgburgburg · · Score: 3, Funny
    How can it possibly be effective if it isn't .Net? I mean, if it exists outside of Microsoft then how can it do anything? Listen. They're calling us to Carousel. Perhaps our code will be renewed.

    Do not talk of this Java Sanctuary. There is no such thing.

    1. Re:Effective Java? What is this Java? by Anonymous Coward · · Score: 0

      Can I get one of those hand doo-dads?

    2. Re:Effective Java? What is this Java? by alienmole · · Score: 1
      Haven't you heard? Our revered leaders, the beloved Bill and Ted^H^H^HSteve, have been instructed by the Leaders of the High Command, George and Dick, to include this "Java" in every shiny new copy of the .NET mother ship, which we fondly know as Windows. So bow down to the great and mighty Java, we must worship it now, for it has been ordained...

      [Sorry I couldn't keep your Logan's thing going...]

  5. Effective Java by Anonymous Coward · · Score: 0, Funny

    equals three scoops of coffee per cup.

    Hey when you are done slashdotting, check out the hot babes on Pajonet's hot or not contest!

  6. Where's the TOC??? by Cruciform · · Score: 1

    It's just not a review without the Table of Contents! :)

    1. Re:Where's the TOC??? by ggruschow · · Score: 1
      Ask and ye shall receive.

      I tried to post it. I really did. The slashdot filters just wouldn't let me. Seems like 37 characters per line should be plenty. Whatever.

    2. Re:Where's the TOC??? by Anonymous Coward · · Score: 1, Informative

      Foreward - Preface - Acknolwedgements
      1 Introduction
      2 Creating and Destroying Objects
      1: Consider providing static factory methods instead of constructors
      2: Enforce the singleton property with a private constructor
      3: Enforce noninstantiability with a private constructor
      4: Avoid creating duplicate objects
      5: Eliminate obsolete object references
      6: Avoid finalizers

      3 Methods Common to All Objects
      7: Obey the general contract when overriding equals
      8: Always override hashCode when you override equals
      9: Always override toString
      10: Override clone judiciously
      11: Consider implementing Comparable

      4 Classes and Interfaces
      12: Minimize the accessibility of classes and members
      13: Favor immutability
      14: Favor composition over inheritance
      15: Design and document for inheritance or else prohibit it
      16: Prefer interfaces to abstract classes
      17: Use interfaces only to define types
      18: Favor static member classes over nonstatic

      5 Substitutest for C Constructs
      19: Replace structures with classes
      20: Replace unions with chass hierarchies
      21: Replace enum constructs with classes
      22: Replace function pointers with classes and interfaces

      6 Methods
      23: Check parameters for validity
      24: Make defensive copies when needed
      25: Design method signatures carefully
      26: Use overloading judiciously
      27: Return zero-length arrays, not nulls
      28: Write doc comments for all exposed API elements

      7 General Programming
      29: Minimize the scope of local variables
      30: Know and use libraries
      31: Avoid float and double if exact answers are required
      32: Avoid strings where other types are more appropriate
      33: Beware the performance of string concatenation
      34: Refer to objects by their interfaces
      35: Prefer interfaces to reflection
      36: Use native methods judiciously
      37: Optimize judiciously
      38: Adhere to generally accepted naming conventions

      8 Exceptions
      39: Use exceptions only for exceptional conditions
      40: Use checked exceptions for recoverable conditions and run-time exceptions for programming errors
      41: Avoid unnecessary use of checked exceptions
      42: Favor the use of standard exceptions
      43: Throw exceptions appropriate to the abstraction
      44: Document all exceptions thrown by each method
      45: Include failure-capture information in detail messages
      46: Strive for failure atomicity
      47: Don't ignore exceptions

      9 Threads
      48: Synchronize access to shared mutable data
      49: Avoid excessive synchronization
      50: Never invoke wait outside a loop
      51: Don't depend on the thread scheduler
      52: Document thread safety
      53: Avoid thread groups

      10 Serialization
      54: Implement Serializable judiciously
      55: Consider using a custom serialized form
      56: Write readObject methods defensively
      57: Provide a readResolve method when necessary

      References - Indexes of Patterns and Idioms - Index

  7. The author by dubbayu_d_40 · · Score: 5, Informative

    J. Bloch wrote the collections framework. His code is clean... I mean, really clean. Given the author's credentials, I suspect this'll stand out in the vast ocean of Java lit...

    1. Re:The author by Anonymous Coward · · Score: 0

      What do you mean "this'll"? Effective Java has been a great and popular book since it came out two years ago...

  8. Java Rules by HealYourChurchWebSit · · Score: 3, Funny



    Man, I'm barely done with Douglas Dunn's
    Java Rules and now I gotta read this?

    Actually, I'm glad to see more book son coding effectively as opposed to the dummy approach which is a sure way to Shoot yourself in the foot when the maintenance phase rolls around.

    That said, one thing copiously missing from the review is whether or not the book covers J2EE at all -- which by and far requires some guidance in the developing the most effective Java applications.

    --
    --- have you healed your church website?
    1. Re:Java Rules by oops · · Score: 2
    2. Re:Java Rules by sdcharle · · Score: 1
      I have the book, it doesn't cover J2EE at all.

      To be fair, that would be outside the scope of the book. It covers Java itself, the core language as an O'Reilly book might call it. I find it to be quite handy and well-written and agree with the reviewer for the most part.

      I may check out Java Rules now. To easy to make fun of that name: Hey dude, Java Rules!

  9. Re:Short Book by jpsst34 · · Score: 4, Informative

    Have you actually used it lately? Speed has been the biggest improvement. Sure, it used to be slow as hell, I concur, but with Java 2 (1.4) it is wicked quick. And for windows apps, it's far better than VB in at least one aspect - grids. Java has a grid object that works the way you'd want it to, resizeable, sortable, column-rearrangeable... And for data drive apps, this is a major thorn out of my side.

    --
    How are you going to keep them down on the farm once they've seen Karl Hungus?
  10. but by Anonymous Coward · · Score: 0

    Never in 1,000 words or less.

    The main things I hate about Java are its verbosity and its enforced and contrived structures. It deserves all the unwarranted complaints people made about Pascal and then some, because it's the ultimate B&D programming language.

    But if that's how you get your kicks, gagged and bound with Sun sticking it to you, then so be it...

    1. Re:but by MojoMonkey · · Score: 2, Informative

      The main things I hate about Java are its verbosity and its enforced and contrived structures.

      Except that verbosity and (contrived?) structures goes a long way towards keeping source maintainable. By requiring this verbosity and not to mention strongly recommending the Sun Java coding standards + Javadoc, code becomes magnitudes easier to read. Sure, it adds work and a bit of pain to the original coder/programmer, but adds substantially more ease of use for those down the line. Don't get me wrong it's still very easy to write hard-to-read-and-or-maintain code, but it's a bit easier to go the correct route.

      But if that's how you get your kicks, gagged and bound with Sun sticking it to you, then so be it...

      That depends on what you are referring to. You are right that Sun tends to stick it to the end user now and then and ultimately Sun can be said to be Java's worst enemy. For example, Mac OS X trying to do some amazing things with Java showing how it can be used viably, getting very little support from Sun.

      After all that's said, I too still prefer C++ (even C#) over Java, but just not for the reasons mentioned.

      --

      ----- "Blame the guy who doesn't speak English." -- Homer J. Simpson
    2. Re:but by Anonymous Coward · · Score: 0

      So would you rather some one write Perl that is all in one line? Or better yet, try to fix several thousand lines of C code which no one understands with the directive, "the bug must be fixed by the end of the day!". I've had to fix a lot of garbage code in my work and I have to say that with Java code, I encounter bizzare and poorly documented code less frequently. Bad programmers are every where and in every language, so it's not unique to any language. If you consider thorough documentation, then please stay away from java thank you.

  11. I Stand Corrected! by pb · · Score: 1, Offtopic

    Intelligent Slashdot Moderations!

    --
    pb Reply or e-mail; don't vaguely moderate.
  12. Re:Advice: Stick with a real OO language by Anonymous Coward · · Score: 0

    gotta love the astroturfers

    java sucks, use language of the week.
    linux sucks, use bsd of the week
    everything sucks, use an apple product.

  13. Re:Short Book by Blakis · · Score: 1

    What grid object? JTable comes close to what you're talking about, but it isn't sortable by default. At any rate, you're right about the speed issue. The claim that Java is dog-slow is simply a myth.

  14. Re:Short Book by Anonymous Coward · · Score: 0

    Java is like running around the thornbush. It's less painful than rushing through it, but it goddamned slow!

    er... Okay, so that was true for the old Java. However, there has been many years of constant improvement, refinement, etc on Java. It's getting better and better all the time, in performance, in reliability, and features.

    Calling it goddamned slow is no longer correct at all. Nowadays if it's slow that usually means someone implemented their app in a slow fashion.

    - David

  15. Used it for what? by Anonymous Coward · · Score: 0

    Of course speed has been its biggest improvement; it couldn't get any slower! And for all the Java people bitch about standards-this and standards-that, every time they release a new version of Java, they break stuff. And then whenever I want a Java program installed, I have to figure out *which* JVM it wants! No more; fuck that shit. Get a STANDARD standard, like a goddamn ANSI standard, and don't try to feed me your Sun "standards-compliant" bullshit.

    But the word we're objecting to here is "effective". Of course, slowness and incompatibility have to do with this, but the biggest problem with Java is bloat. Have you ever seen the source code to a small to medium-sized Java app? It could be a frickin' text editor, it doesn't matter, it has a source tree wider and deeper than the fucking Linux kernel. Compare this to 10-20 C files in the same directory for your average (fast, portable) text editor.

    Of course, if you're building a GUI to connect to a database over a network, then feel free to use Java. Or Visual Basic. Or anything else that lets you clicky-clicky-drag components together. Because for that, speed doesn't matter, and you'll benefit from the extra layers of abstraction.

    Just don't try to convince us that Java should be used for programming; Java is to programming what Mr. Potato Head is to plastic surgery.

    1. Re:Used it for what? by Anonymous Coward · · Score: 0

      Apparently, you don't do OOP. Just because you aren't open minded about different technologies, doen't mean you have to bash them.

    2. Re:Used it for what? by jpsst34 · · Score: 1

      Of course there is the right tool for every job, and Java, while being correct for some tasks, is not the best tool for others. You, on the other hand, can rest assured that no matter what job you are doing, you will always be a tool.

      "Clicky-clicky-drag" does not mean that you're not developing apps the proper way. A key idea (ideal?) in software engineering is code reuse and rapid development. If you have to write 34 methods to accomplish a text box for every app you write, then you're just wasting time. Sure C is great for mathematically intense stuff like DSP, and it's great fun for memory mis-management, but I wouldn't use it for a frontend. Use a good platform independent front-ending language, like java, to provide an interface to your powerful computational engine written in C or Lisp or Perl.

      --
      How are you going to keep them down on the farm once they've seen Karl Hungus?
    3. Re:Used it for what? by Anonymous Coward · · Score: 0

      Well its obvious that this is a troll. Its also obvious that you are very inexperienced in programming.

      The belief that a language isn't a 'real' language if it doens't let you shoot yourself in the foot, is common amongst 'hackers' and wannabe hackers. The idea that a language that will let you accidentally blow your own head off at any time is inherintly better, is a flawed one. Every language has strengths and weaknesses. Your weakness is in believing that Java should not be used for advanced puposes.

      I'm currently working on a complex system which uses Java as the intermediate machine control layer. I can't disclose the nature of the machine due to NDAs with the NSA and DARPA through which we receive substantial funding. (FYI those agencies won't fund you unless your design is solid.) But I can say that stability and reliability are top priorities. We are around 800,000 lines of Java code, and around 150,000 lines of C. In the last 3 years of developement I have seen the Java code crash the machine exactly 2 times. In contrast to other projects here of comparable complexity written in C that can easily crash 2 times in 5 minutes. I'm talking about pre-alpha code under developement that changes on a daily basis in both cases.

      If you think Java is just a toy language, well then enjoy living in your box, and please don't look outside; the big wide world can be an intimdating place for those with limited minds.

    4. Re:Used it for what? by Angry+White+Guy · · Score: 2

      You, on the other hand, can rest assured that no matter what job you are doing, you will always be a tool.

      Mind if I borrow that?

      I didn't realize that there were so many Java fan(atics) out there. I do realize it's importance to the computer industry, and especially the acedemic industry, but there is a lot of bloat to the language. Java has become a wishlist of functions. Great for learning and teaching OOP, but as it's been abstracted too far (in my opinion) it has lost a little bit of flexibility (and a lot of its speed). Personally, I don't care about overloading methods, total abstratcion, or write once debug everywhere capabilities. Garbage collection is nice though, as well as the additional security Java has to offer, but as far as it being the last word everywhere, just ask Corel.
      Your suggestion to Use a good platform independent front-ending language, like java, to provide an interface to your powerful computational engine written in C or Lisp or Perl does make sense though, and you didn't have to come across as a zealot.

      I'm burning Karma to reduce my heating bills...

      --
      You think that I'm crazy, you should see this guy!
    5. Re:Used it for what? by Anonymous Coward · · Score: 0

      Sadly, that's the same message the parent was trying to get across, before he got tackled by (another) Java zealot...

    6. Re:Used it for what? by Anonymous Coward · · Score: 0

      Obviously every language has its place. And yes, C lets you shoot yourself in the foot rather easily; I don't advocate this.

      However, Java doesn't let you touch your toes without getting a friend to kneel down, cut them off for you, and hand them to you.

      Actually, I don't even have to continue this argument. Just look at the line numbers you cited! That's more than 5x as much Java code... running 5x slower...

      Suddenly, I'm not worried about the NSA cracking our encryption schemes; thank you!

  16. Another good choice along these lines... by JLyle · · Score: 2, Informative

    ... is the Java 2 Performance and Idiom Guide (ISBN:0130142603), by Craig Larman and Rhett Guthrie.

  17. Re:Advice: Stick with a real OO language by Anonymous Coward · · Score: 1, Insightful

    Yes, yes, well said. Unfortunately not many people will PAY ME to code in Smalltalk these days! Times are tough, man, and you still have to eat. Even if I did make an effort to learn a subpop language for career purposes, I'd ultimately have to spend lots of time justifying it and marketing it to employers and customers. Ok, granted, there would probably be fewer people competing for these jobs, but that's a risk that few are willing to take.

    Java and C++ are popular because they're popular. Managers are often idiots, but most are smart enough to know that when you leave they'll have to find a replacement with your skills. There are lots of Java/C++ people out there, lots of books, lots of classes. Smalltalk, not so much...

    And yes, I agree, BeOS and Betamax were better, but don't forget...there's a REAL WORLD out there!

  18. Absolutely the best Java book I've read by dknj · · Score: 5, Informative

    This book is the best resource I've encountered for someone who knows the Java language, but wants to master its use. I can virtually guarantee that the rules and techniques covered in "Effective Java" will form the new foundation on which you will build the rest of your best practices for writing excellent Java code.

    Written by the Joshua Bloch, the acknowledged expert on the subject, it is as authoritative as they come and extremely well-written. After six and a half years as a senior developer architecting and implementing algorithms and class libraries in Java, this book shocked me by summarizing much of what I knew about how to use the language effectively, while teaching me much that I did not know. It continues to top my recommended reading list for all new software developers at my company.

    -dk

    1. Re:Absolutely the best Java book I've read by goul · · Score: 5, Interesting

      Indeed. It might be worth noting that James Gosling (one of the parents of Java) describes this as a book he needs.
      This book will show you any bad habits that you have picked up, and teach you why they are bad. I've not found a single developer of any level of experience who has not found this book useful.

    2. Re:Absolutely the best Java book I've read by Arrgh · · Score: 2
      Here's the Gosling quote from the back cover, which I get a big kick out of every time:

      I sure wish I had had this book ten years ago. Some might think that I don't need any Java books, but I need this one." -James Gosling, Fellow and Vice President, Sun Microsystems, Inc.

      Easily one of the top five Java books ever, along with Thinking in Java (2nd. ed., Eckel) and Concurrent Programming in Java (2nd. ed., Lea)

    3. Re:Absolutely the best Java book I've read by vbweenie · · Score: 1

      Agreed; I found it useful as a Java newbie, because it gave me a view of the language "from the other side", a sense of where its complexities lay. It is a fine example of how to think about design issues in the context of a set of linguistic constraints, and for this reason has something of value even for non-Java coders (as the Scott Meyers series has much of value for non-C++ coders).

      --
      Experience is a hard school, but fools will learn no other.
  19. um, no... by Anonymous Coward · · Score: 0

    That's an optical illusion. You see, computers have been getting faster all the time. It was only a matter of time before people started mistaking this for an improvement in Java.

    And for all the hand-holding the Java people do, you'd think they could spend some time explaining the godawful mess that the standard libraries are instead of spending their time crippling the language to have its own "special" notions of variable and function scope, reachability, and encapsulation that's much like other popular languages except far less useful, efficient, or straightforward.

    But at least they're getting generics. Who knows, maybe one day they'll have closures. And then, in the far distant future, Sun can claim to have invented Lisp! No... wait... Lisp must be a Java rip-off! Yeah, that's it... And C, too, also a Java rip-off! JAVA, the first and best programming language!!

  20. Re:Short Book by Gallo+Nero · · Score: 1

    Man, this site is slow! Anybody would think it was made with Java .... just kidding .... I use Java all the time and I love it! It's great to see it improving all the time and being used for a whole host of different applications.

  21. Re: Re:Short Book by Anonymous Coward · · Score: 0
    I've been running benchmarks comparing data structure, synchronization, memory usage and garbage collection lately and I would have to say without a doubt, jdk1.4 beats C# .NET 1.0. Even when C# code is compiled with optimize, it most cases it 30-80% slower. I haven't tested file IO stuff, so C# may be faster in File related operations.


    In most cases, it should be comparable to jdk1.2.

  22. Re:Advice: Stick with a real OO language by FiskeBoller · · Score: 5, Insightful
    Java is slow, as annoying to program as Microsoft's C# language, and just plain impractical.

    Java is slow? Maybe that's just your coding. These guys (among others) don't agree with you...

    http://www.sosnoski.com/Java/Compare.html
    http://www.javagrande.org/jgsc98/index.html

    IBM has achieved 90% the speed of C in Java. I personally use the CERN numerical libraries ... very cool, very fast. Java certainly can be fast. I've seen distributed Java beat C++ implementations hands down (that was hard to everyone to believe ... problem was C++ CORBA marshalling and the RTTI overhead in C++).

    I've used Squeak, and have a background in coding Smalltalk (Digitalk, ParcPlace, IBM VA). Squeak is a great up-and-coming environment, but FAR from commercial. Can you name one commercial implementation in Squeak?

    I think that lack of commercial viability makes Squeak impractical. Java, on the other hand, has scads of drop-in commercial libraries and components. This makes economic sense in business. Java also has a proven track record on the server side, and there are many, many successful commercial implementations in mission critical environments.

    And NO, I don't think Java is the perfect enviroment; far from it. I've yet to see my ideal language, and I keep looking on the horizon for a dynamic functional/object/aspect language that performs and holds up in a commercial setting. In the meantime, I've got real work to do.

  23. An intelligent reply? What gives?? by Anonymous Coward · · Score: 0

    My main problem with reading Java code (besides the fact that there's so much of it, and it's scattered everywhere...) is that it doesn't indent properly. No large Java program will indent and fit comfortably in an 80x24 terminal, or for that matter, sometimes not even in 120x50. That's because Java programmers have no concept of line breaks, or how much should be put on a line.

    whenYouCan(keepReferencingYourObjects)->LikeThis An d(you->use)->VerboseVariableNames(then, line(breaks,can->be))->Few(andFarBetween);

    Of course this is a stylistic issue, but because the long names I mentioned are policy in Sun's own framework, it's impossible to totally get away from them. A preprocessor or macro system would help a lot here, but Sun doesn't have that either! That's too powerful and dangerous and useful to let the USER to have!

    What are your reasons for preferring C++ (or even C#) over Java? Speed, standards-compliance, readability, lower memory usage, saner language constructs, not controlled by Sun?

  24. This book is invaluable. by Hirofyre · · Score: 5, Interesting

    There are a lot of Java books out there, but this is one that will help an intermediate-to-advanced Java developer. The code examples in here are concise, clean, and hard-hitting. The layout of the book allows you to pick it up and learn something if you have 10 minutes or 2 hours.
    When I was first learning Java, I often had that nagging feeling that I was making things harder on myself than need be. This book cleared up a lot of those feelings, and helped get me on the right track for some of the great tools hidden away in the Java API. The API documentation is great for showing you what members and functions are available to an engineer, but this book shows you how to use the API. The review cites the author's avocation of knowing the libraries, I would contend that this book would help you get the most out of those libraries, and increase your understanding of them.
    This book has become a must-have around my office, and if you are looking to get over-the-hump and move from an intermediate to advanced java software engineer, pick up this book. It is dense with information, and will save you a ton of time and energy. What more could you ask for from a book?

    1. Re:This book is invaluable. by Anonymous Coward · · Score: 0
      When I was first learning Java, I often had that nagging feeling that I was making things harder on myself than need be. This book cleared up a lot of those feelings...

      I'm at that same stage of first learning Java. So did it turn out that you were making things harder than they had to be, or is Java really just programmer hostile, excrutiatingly verbose, pain in the ass?

  25. Scott Myers by kzinti · · Score: 5, Informative

    Effective Java is a book very much in the style of Scott Myers' earlier C++ "Effective" series

    This is about the highest praise you can give a language-specific programming guide. In his books Scott not only listed many of the ways you could get in trouble in C++, but also gave clear explanations of why they were trouble and why his recommendations were good practices. His books are top of the list I recommend to people who know the language and want to write solid fast code. If Effective Java is as good, I'll soon be adding a copy to my bookshelf.

    --Jim

    1. Re:Scott Myers by MSBob · · Score: 5, Informative
      It's not as good. I own this book and own both C++ books by Scott Meyers and this one is not nearly the level of Meyers' titles.

      The topics it discusses are much more obvious than the traps that Meyers covered. Java's a simpler language, that's fair enough but there are areas of Java, especially around concurrent programming and network and io apis that may surprise even experienced developers. Those areas are precisely where 'Effective Java' is thin on content and I found it disappointing overall.

      Just because it's sectioned the same way as Scott Meyers' books doesn't mean it's just as good!

      --
      Your pizza just the way you ought to have it.
    2. Re:Scott Myers by LarsWestergren · · Score: 2

      Ah, it actually feels good to read someone who disagrees after the overwhelming praise of the book here on Slashdot (and I was one of the hallelulia choir), especially as its from someone who sounds like he is not just a Java hater.

      there are areas of Java, especially around concurrent programming and network and io apis that may surprise even experienced developers.

      Do you have any suggestion for a book or online resource where I could learn more about these things?

      I mean, yes, I know a little about those areas, and I know where to find books that teach them, but since you seem to have a lot of experience (I mean it, no sarcasm), do you have any tips for a source that cover these important areas you say Boch neglects, just as well as he does the rest?

      --

      Being bitter is drinking poison and hoping someone else will die

    3. Re:Scott Myers by pamar · · Score: 2, Informative

      Do you have any suggestion for a book or online resource where I could learn more about these things?


      Regarding concurrent programming, I would go for "Taming Java Threads" by Allen Holub.

      A lot people would also cite "Concurrent Programming in Java: Design Principles and Pattern" by Doug Lea.

      Personally I prefer the first. The second one is far more complete in its exhaustive analysis of concurrent programming, but the first is more "hands-on".

  26. Confused by expression by sdcharle · · Score: 3, Funny
    I also liked the short prose sections, and thought the author could have spent more time setting out his stall before launching in to the items.

    What does 'setting out his stall' mean? I picture somebody settling on to the toilet and opening the newspaper, but in the context I don't think that's what you meant.

    1. Re:Confused by expression by Anonymous Coward · · Score: 0

      Seriously? Picture someone trying to sell you something at a travelling fair. They set up a stall with pictures and products and then launch into a pitch or presentation telling you why you should buy their stuff. Or in this case, their opinion.

      Actually you're right, it's a stupid metaphor.

    2. Re:Confused by expression by sdcharle · · Score: 1

      OK, I follow you now. Maybe if the author had said 'set up his booth more before launching into his pitch', or something, it would have been clearer. Overall a good review, that just confused me a bit.

  27. Good review by LarsWestergren · · Score: 4, Informative

    Thank you, a good review of an excellent book. I have maybe 10 java books, most of them from O'Reilly and none have been as beneficial to my development in Java as this one.

    The code and the text are both very clear and concise, and you can read the book cover to cover, coming back later to study each advice more in depth.

    I think you can get it from reading between the lines in the review, but just to make it clear to any curious beginner, this is not the first book you should buy if you are just starting to learn java. Use
    The Java Tutorial instead, and maybe
    Learning Java.

    --

    Being bitter is drinking poison and hoping someone else will die

  28. Flamebait? Oh, come on by burgburgburg · · Score: 2

    What? Did I forget to include emoticons or tags? Did I not make the references to "Logan's Run" explicit enough? Sheesh. Flamebait.

    1. Re:Flamebait? Oh, come on by revscat · · Score: 1

      Well, *I* thought it was funny. I just bought Logan's Run a couple of weeks ago. Loved it when I was a kid.

  29. A few more good words by melquiades · · Score: 5, Informative

    This is a fantastic book, and anybody's who's serious about writing good Java code should study it carefully. It's one of the best-written books -- may the best -- on the practical details of programming that I've ever encountered, and the advice is gold. The section on correctly implementing equals() and hashCode() alone is almost worth the price of the book.

    The reviewer complains about some of the thinner or more "obvious" items, but I disagree. Heaven only knows how many times I've wished that really good and experienced programmers follow what seems the obvious maxim: "Minimise the accessibility of classes and members."

    It's true that "Know and use the libraries" seems rather obvious and vague advice, but Bloch's exposition drives home the fact that you may not follow this advice as well as you think. As always, his examples are excellent: he shows how an innocuous-seeming abuse of java.util.Random creates serious problems, and how proper use of the libraries fixes the problem. How often do you write a loop to print the contents of an array? I never realized until Bloch pointed it out that System.out.println(Arrays.asList(array)) accomplishes the same thing much more simply.

    If you're a Java programmer, get this book. If you're a technical author, aspire to it.

    1. Re:A few more good words by nograz · · Score: 0, Flamebait

      How often do you write a loop to print the contents of an array? I never realized until Bloch pointed it out that System.out.println(Arrays.asList(array)) accomplishes the same thing much more simply.

      You aren't very long into Java, are you?

    2. Re:A few more good words by melquiades · · Score: 1

      You aren't very long into Java, are you?

      Only six years, so no, I suppose not, in the grand scheme of things.

      The point is that sometimes very obvious things escape even the most experienced programmers.

  30. Or 'Maintainable Perl'. by ProtonMotiveForce · · Score: 1

    Let me guess - you don't program much, do you?

    Java is one of the most productive languages in the world. End of story.

  31. A "Must Have" by Atom+Tan · · Score: 3, Informative
    In my opinion, this book is a "must have" for anyone that wants to develop Java code at anything more than a casual level.

    Many important Java techniques and idioms are described so well in this book that I have been known to insert comments to the effect of:


    // Hash code implementation per "Effective Java" Item 9


    (or some such) into my code. Most of the author's items should be as engrained in the mind of a Java developer as terms like 'singleton' and 'event listener'.
  32. Re:An intelligent reply? What gives?? by MojoMonkey · · Score: 2, Insightful


    whenYouCan(keepReferencingYourObjects)->LikeThis An d(you->use)->VerboseVariableNames(then, line(breaks,can->be))->Few(andFarBetween);


    Actually, it should be:

    whenYouCan(keepReferencingYourObjects).LikeThisA n d(you.use).VerboseVariableNames(then, line(breaks,can.be)).Few(andFarBetween);

    remember, no pointers... *wink, wink*

    Anyways, I have yet to see anything that bad (I know you were making a point), nor have I seen anything similar that can't be fitted within 80 columns on 2 lines. You can't seriously tell me you have never seen a C/C++ line that long. You can always write horrible code no matter the language, blaming it on the language itself is just an excuse.

    What are your reasons for preferring C++ (or even C#) over Java? Speed, standards-compliance, readability, lower memory usage, saner language constructs, not controlled by Sun?

    Speed - used to be, IBM is doing some amazing things with their JIT compilers. I think someone else mentioned they were getting 90% of native code. So this is no longer an issue for me. I've even writing some fairly advanced 3D apps using GL4Java.

    Standards-compliance - well... not sure what to say here. There's not ASCI Java if that's what you mean. Never been much of an issue for me.

    Readability - as I have been arguing above, I prefer Java's... just me I guess?

    Lower Memory Usage - For sure! Java's memory footprint is horrible. Price you pay for a virtual machine. I do hate this.

    Saner Language Constructs - see Readability.

    Not Controlled By Sun - someone has to control it, I'd say they are doing a decent job of maintaining the API. They also seem to do a fine job of listening to the needs of the users. I think sun does a fine job with the API itself, they need to improve their application of it (Sun's JVM pretty bad, etc).

    My main reasons for preferring C++...
    - lower level, like the control I think.
    - Sun's Swing and AWT API's suck IMHO.
    - Java is very large API, I get a bit overwhealmed at times.

    --

    ----- "Blame the guy who doesn't speak English." -- Homer J. Simpson
  33. I have read a little bit... by SecretAsianMan · · Score: 5, Informative
    ...of this book, and I will most definitely finish it when I have the time. Unless you are a balls-to-the-wall guru already (99.999% chance you aren't), you will become a better Java developer by reading this book. It pays to read even some of the simpler and more obvious tips, as your viewpoint on those issues might not be as omniscient as you think.

    Best of all, it's not 3 feet think like Effective Java Unleashed or The Effective Java Bible would be. You get lots of info with minimal fluff.

    --

    Washington, DC: It's like Hollywood for ugly people.

  34. Re:An intelligent reply? What gives?? by arthurs_sidekick · · Score: 1

    Shouldn't that be :

    whenYouCan(keepReferencingYourObjects)
    .LikeThisAnd(you.use)
    .VerboseVariableNames(then, line(breaks, can.be))
    .Few(andFarBetween);
    ?

    Smart guys, those parser builders. Not to mention that if *that* is your problem, you can pay a little performance penalty and give names to all those intermediate objects.

    --
    "Oh, I hope he doesn't give us halyatchkies," said Heinrich.
  35. Try this one for J2EE by wrfink · · Score: 1
    Try "Java Enterprise Best Practices", (c)2003 - O'Reilly.
    Chapters
    • 1 - Introduction to Java Enterprise Best Practices (b.p)
    • 2 - EJB b.p
    • 3 - Servlet b.p.
    • 4 - JDBC b.p
    • 5 - XML b.p
    • 6 - RMI b.p
    • 7 - Java Management Extensions
    • 8 - Enterprise Internationalization
    • 9 - JSP b.p
    • 10 - JavaMail b.p.
    • 11 - Enterprise Performance Tuning

    The authors include Hans Bergsten, William Crawford, Dave Czarnecki, Andy Deitsch, Robert Eckstein, William Grosso, Jason Hunter, Brett McLaughlin, Sasha, Nikolic, J. Steven Perry, George Reese, and Jack Shirazi.

    This not a bad book. For $34(USD), there are some good learnings. This is one to have on the shelf.
  36. Java security papers by Anonymous Coward · · Score: 0
  37. Re:um, no...Re:um, no... by Anonymous Coward · · Score: 0

    Humm... I have seen benchmarks where Java (JIT'ed) is darn-near as fast as native code. Yes, benchmarks are like opinions...and you know what they say about thoes and people like yourself.

  38. This book is great by deanj · · Score: 4, Informative

    When this came out in 2001, James Gosling showed a copy of it at his keynote at JavaOne. They sold out every copy they had at the show, and the Effective Java talk later that day/week, was so packed you couldn't even get it. Great book.

    1. Re:This book is great by petee+moobaa · · Score: 1

      I got into that session. Not only did Bloch write a great book, the session was *awesome*. Sure, the cynical could see it purely as advertising for the book (he covered 4 or 5 of the items), but he was an extremely compelling speaker.

    2. Re:This book is great by msouth · · Score: 1

      When this came out in 2001, James Gosling showed a copy of it at his keynote at JavaOne. They sold out every copy they had at the show, and the Effective Java talk later that day/week, was so packed you couldn't even get it. Great book.

      While I appreciate your comment, I want to humbly submit that, this being slashdot, you might have used a subject line more in line with the way the editors pick headlines. For example, instead of the mundane-but-descriptive subject "This book is great", you should have used something like:

      "Dangerous book leads to shortages and overcrowding" :)

      --
      Liberty uber alles.
  39. Read this book a lot by mobiGeek · · Score: 3, Interesting
    This is not a read-once-keep-on-bookshelf book. This book should be read through a few times at least.

    I rarely find a tech book that offers more than a few examples I ear-mark. This book however has me re-reading it from time to time. The lessons picked up take time to sink in, and IMO no one can truly pick up all of the lessons on one read through.

    --

    ...Beware the IDEs of Microsoft...

  40. The only book I recommend. by David+Kennedy · · Score: 2

    Decent review of an excellent book.

    I read books like other people eat hot dinners, and when I recommend Java books in work I only recommend this one. (I tend to find that a surprisingly number of coders only read one or two tech books a year anyway). "Effective java" is very well written; it's nice and short without sacrificing any exposition of the hairer parts of the language.

    And as another poster has said, at work it's often sufficient to say in a review, "HashCode as per Bloch please"

  41. hrm? by Anonymous Coward · · Score: 0

    If you read your own links, you would notice that even with the most contrived tests, Java still has frighteningly bad I/O performance that isn't "90% the speed of C in Java", but more like 25% the speed of C++ on a bad day... ...so expect to get many more positive moderations by your illiterate Java-loving friends...

    1. Re:hrm? by FiskeBoller · · Score: 2, Informative

      Ok, maybe you should view what I posted, and re-read the links.

      IBM makes claims to Java at 90% speed of C++ in their numerical benchmarks. JavaGrande includes a number of well-respected organizations doing intensive computation, including GRID work. The tests quoted show a wide variety of performance, and you picked on file I/O; yes, one of the worst aspects in those tests. However, note that these are OLD JVM tests, not the significantly improved I/O found in JDK 1.4. (I don't have stats handy but have seen and experienced the claims of improved performance).

      Java as an interpreted, cross-platform language will always be at a disadvantage to C++ in terms of raw speed. The again, many equate C++ as "Object Assembly" in the OOP world. That has it's own disadvantages.

      Everything depends on how the language gets used. I have written many distributed C++ infrastructures and applications, and find Java a much welcome alternative. In many distributed scenarios it has proven faster, to the surprise of many seasoned collegues. I couldn't even imagine the jirations required to do an equivalent of JINI in C++.

      So, why is it that most financial institutions have dropped C++ in favor of Java for server applications? It must suck something fierce, eh?

  42. Yep, it's a good one by kryzx · · Score: 2
    I have this book and have read it. As an experienced java developer I found that this book had a few really good insights, and a whole load of good reminders. I'd say that it's a good review for the real pros and an indispensible piece of training for beginners and intermediate level programmers. That's much more than can be said for most books. I agree with the reviewer regarding the examples and the readability.

    It's nice to see a book review that actually reviews the book, rather than just regurgitating the table of contents.

    --
    "I don't know half of you half as well as I should like, and I like less than half of you half as well as you deserve."
  43. Sample Chapters by darkpurpleblob · · Score: 5, Informative

    Four sample chapters from the ten in the book are available in PDF format at the books website.

  44. Re:An intelligent reply? What gives?? by Disco+Stu · · Score: 2


    whenYouCan(keepReferencingYourObjects)->LikeThis An d(you->use)->VerboseVariableNames(then, line(breaks,can->be))->Few(andFarBetween);


    This code is a horrible violation of the
    Law of Demeter. If you're doing this, formatting is not your biggest concern.

  45. Hahah by Drakonian · · Score: 2

    There is something about the idea of code examples being "hard-hitting" that made me laugh out loud.

    --
    Random is the New Order.
    1. Re:Hahah by Anonymous Coward · · Score: 0

      Well, how "hard-hitting" a code example is would depend mostly on the page-count of the listing and the release altitude, right?

  46. Best Second Book on Java by cbare · · Score: 0, Flamebait

    Effective Java is the best second book for learning to program well in Java. The best first book is Thinking in Java by Bruce Eckel, which is just out in its third edition.

    p.s. To the many Java-haters on Slashdot: If you think Java sucks, fine. Don't read a Java book review. Don't post dumb comments like, "Hey d00dz, Java sucks!" If you have nothing better to do, try and post something usefull, like a review of the best PERL book you know. (Or C, Python, or BrainFuck, if that's your language of choice.)

    --
    -cbare
  47. My favourite quote from the review... by cheezfreek · · Score: 1
    'Minimise the accessibility of classes and embers,'

    ...Because otherwise you might get burned.

    So sorry. My weird sense of humour strikes again.

  48. Re:An intelligent reply? What gives?? by Zagadka · · Score: 2

    It's awfully funny that your example, which was supposed to illustrate something bad about Java, is actually C++, and not legal Java. Even more ironic, the Java equivalent would be several characters shorter.

  49. Mod that son of a bitch down. by Anonymous Coward · · Score: 0

    IBM has achieved 90% the speed of C in Java.
    Bullshit. This is just FUD. Java has many
    charms but 90% the speed of C is not one of them.
    Try 25%. Maybe.

    1. Re:Mod that son of a bitch down. by clard11 · · Score: 1

      Nah. Server side Java is the thing these days. With a good JIT Compiler, your steady state performance is going to be very good.

      --
      catch (ModDownException mde) {post.modUp("Interesting")}
  50. You can catch some of the problems.... by tcopeland · · Score: 4, Informative

    ...that Effective Java talks about by using a static code analyzer. Like this one:

    http://pmd.sf.net/

    PMD will find places where you've used concrete collections rather than interfaces, left unused code lying around, etc., etc.

    Tom

  51. Thinking in Java by alexo · · Score: 1

    Effective Java is the best second book for learning to program well in Java. The best first book is Thinking in Java by Bruce Eckel, which is just out in its third edition.

    You forgot to mention that most of Bruce Eckel's books are available online in a variety of formats, for free.

  52. Buy this book by r0ckflite · · Score: 1
    I bought this book some time ago. It really helped me. Each section is concise and incredibly well written. Buy it.

    --

    Push the button Max!!!!

  53. Re:Short Book by tom.allender · · Score: 1

    GridLayout or GridBagLayout layout managers for positioning components in the window.

  54. Moderators SUCK ! by Anonymous Coward · · Score: 0

    hey, the comments in the parent post are actually
    quite INCISIVE !!! As opposed to the
    "jeepers, javas grate" type comments
    in this thread that get scored +5 insightful.

  55. Re:Advice: One new thing per project by hughk · · Score: 2

    I have always worked on the principle of one new thing per project wherever possible. New languages are a no-no, so when I speced out projects, we stuck with languages where there was a good level of in-house knowledge - and delivered on time. Java is mainstream now so it remains a good choice even though there are OO languages that may be better. It is well supported and comes with a good collection of objects.

    --
    See my journal, I write things there
  56. Why Java can be faster than C++ by olg · · Score: 1

    In two words, dynamic compilation and inlining. You can do a lot more with dynamic information and dynamic performance profile. Being able to inline 50-100 nested calls in a hot spot may give you something the most sophisticated static compiler will never dream of.
    (F.e. you can eliminate a virtual method call just because you dynamically know what method you are actually calling; you can inline methods from system and third party classes, etc.). Just don't forget to add -server to your java run.

  57. Re:Advice: Stick with a real OO language by Andreas+Rueckert · · Score: 1

    I'm trying to write a Java chess app just for fun to see if I can do it and if Java is actually a limiting factor in the project. So far I'm very impressed with the Java performance. Definititely no show-stopper even in such a performance-critical field.

  58. Re:An intelligent reply? What gives?? by Anonymous Coward · · Score: 0

    "...Sun doesn't have that either! That's too powerful and dangerous and useful to let the USER to have!"
    "Java programmers have no concept of line breaks, or how much should be put on a line."

    #1 You're an idiot.

    #2 An opinion of Java programmers has no bearing in relation to the merits of the language. Your generalization about Java programmers is inane and irrelevant.

    #3 Your example of bad Java code is actually bad C code, and bad code can be written in any language. This has no bearing on the merits of the language itself.

    #4 Your implication that Sun holds back functionality because its too powerful or useful is stupid.

    #5 The Java language is actually more compact than C++. The Java APIs are wordy and therefore explicit, and many people - myself included - think that is a good thing.

    #6 Your entire argument amounts to a bunch of complaints backed up with hand waving, erroneous conclusions and anecdotal evidence. Don't bother raising a point if you can't support it.

    #7 You're an idiot. Its worth saying twice.

  59. Excellent Book by Anonymous Coward · · Score: 0

    I had been doing network admin work for a year and read this book as part of comming back up to speed.

    Excellent book. Lots of information that is normally hard earned. At least it was the first time I learn all this.

  60. Re:bravo! by HyperbolicParabaloid · · Score: 2

    you seem to be under the illusion that java exists only for web pages. you are wrong. Most java is not contained in web pages.

    --


    -------------------------
    A person of moderate zeal
  61. Worth the money by grungeman · · Score: 2, Informative

    I know two Java books that are definitely worth their money:

    - Effective Java
    and
    - Java Platform Performance by Steve Wilson and Jeff Kesselman

    Of the second book there is a HTML version available at this link


    --

    Signature deleted by lameness filter.
  62. Excellent book by Anonymous Coward · · Score: 0

    This is the best computer book I have read in a very long time. It has changed the way I think about OO design and Java. I don't think I ever understood it until I read this book. Now I think I could apply many of the lessons from this book to writing good-quality C++. If you use Java, I highly recomend this book.

  63. Re:Short Book by BreadMan · · Score: 1

    AWT/Swing are still too slow. Even with the latest release.

    For reasonable GUI performance SWT is the way to go. The object model approximates AWT's so there's not a huge learning curve if you want to experiment.

  64. Commercial Implementation by Camel+Pilot · · Score: 2

    Can you name one commercial implementation in Squeak?

    Good point. However how many commericial applications are written in Java? I am not talking about custom client/server apps or installer programs but popular shrink wrap applications that are written in Java? Just curious as I never seem to encounter any and often wonder why not - given the Java advantage of cross-plateform capability.

    1. Re:Commercial Implementation by Anonymous Coward · · Score: 0
      how many commericial applications are written in Java?

      A few off the top of my head.... Borland's JBuilder, Oracle's JDeveloper and Enterprise Manager. Tarentella's "viewer". Are they high volume sellers at Best Buy/Circuit City/etc? No. Are they commerical applications (very likely not delivered in colorful "shrink wrapped" boxes)? Yes.

      From a marketing standpoint advertising the the app is written in Java shouldn't particularly buy much in the marketplace. So why bother. [ except in Borland's case in that they can "eat their own dogfood". ]

      As for multiple platform being a benfit.... the vast majority of "shrink wrapped"software is written for just one platform. [ see alsoendless slashdot flamefests on evils/benefits of Mozilla multiplatform tradeoffs.. ]

      Additionally, the java apps usually are quite sensitive to the java runtime environment preseent. But that isn't entirely unlike being dependent upon some squirelly dynamic library.

      [ Unless Squeak has changed since I last looked at it a couple of years ago there is no use of the "native" widget set. A squeak app will look the same no matter what platform it is on. In the "shrink wrap"/lowest common denominator market that isn't likely to fly so well. "Looking funny" (unless there is an overwhelming counterbalance in functionality) will be enough to squash wide acceptance; style over substance wins more often than it should. ]

      Peace

  65. It won the 2002 Jolt Award by Bubblehead · · Score: 2, Informative
    I bought the book last June because it got the 2002 Jolt award for Books. I rarely got disappointed by Jolt award winners (books and otherwise), and this book is no exception - it rocks!

    If you're interested, you can get a free subscription to the print edition of Software Development Magazine. It's one of the few high quality freebees (and no, I am not affiliated with them). Also, as Scott Myers got mentioned here a few times: He writes for SD Magazine once in a while.

    --
    Under capitalism man exploits man. Under communism it's the other way around.
  66. Great for quoting by bartash · · Score: 2

    This is the best java book I have read. I swear I already knew 80% of what is in the book but I had forgotten half.

    But the most useful thing about the book is that you can quote it to people. It has been a useful tool for applying to the Open Source mailing list I have to participate in.

    And if you are writing an API in Java you need this book shipped to you overnight delivery. You can thank me later.

    --
    Read Epic the first RPG novel.
  67. Re:An intelligent reply? What gives?? by Anonymous Coward · · Score: 0

    In that case, please tell me--why does Sun hold back powerful and useful functionality? I'm sure they have a really good reason, right?

    The C++ specification is incredibly verbose, and that's a good thing. Also, it hasn't changed *nearly* as much from version to version as has Java 1.0,1.1,1.2 (2.0?),1.3 (??), 1.4, etc., etc.

    Also, I can support all of my points. And I have supported them, preciesely as much as you have supported yours. Idiot. :)

  68. question for all you Java experts by pb · · Score: 3, Insightful

    I'm not a big fan of Java, but I was impressed by everything that has been said here about how much Java has matured, so I figured I'd put it to the test.

    I dug up some old benchmarks (the BYTEmarks, which includes a jBYTEmark, normalized to that same P90) that I can use to fairly compare Java and C performance.

    I've got a 1.2Ghz Duron, and the C version of the BYTEmarks seems to reflect this accurately--with scores of 26.6 Integer and 21.4 FP, with a P90 being 1.00.

    I'm comparing this against two separate Java implementations--Sun's JVM for Linux, and gcj (I also tried out a program that translates Java bytecodes to C, but the resultant executable didn't perform correctly). Here's a table of results:

    C Bytemark: INT: 26.6 FP: 21.4
    SUN (--server) INT: 4.21 FP: 1.80
    GCJ INT: 3.63 FP: 1.71
    SUN (Default) INT: 2.18 FP: 2.14

    Now, I'm not surprised that the C version ran so fast, but I am surprised the the Java benchmarks did so badly, considering that both benchmarks were normalized to an index of 1.0 for the same Pentium 90! Maybe I got a bad copy of the jBytemarks--it was hard to find a copy at all--but it looks pretty legit.

    Do any of you Java people have some amazing tips for me? I did use all the optimization flags I could find. Or is this typical performance for Java, making a 1.2Ghz Duron run as slow as a P200 or a K6/300?

    --
    pb Reply or e-mail; don't vaguely moderate.
    1. Re:question for all you Java experts by Anonymous Coward · · Score: 0

      Try it on Windows. Sun's JVM blows on Linux. You could also try IBM's JRE on Linux, which is typically faster than Sun's.

    2. Re:question for all you Java experts by pb · · Score: 1

      I'll think about doing so when next I reboot; I already tried IBM's JRE, and it is most definitely faster than Sun's. :)

      --
      pb Reply or e-mail; don't vaguely moderate.
    3. Re:question for all you Java experts by BCoates · · Score: 1

      I don't think i understand what you're doing here; it sounds like you're using totally different benchmarks in C and java, so the numbers shouldn't be comparable at all, should they?

      At best you might be able to compare jvms with it, but since the benchmark is designed to measure cpu performance (isn't it?) it might not give meaningful results for that either.

      --
      Benjamin Coates

    4. Re:question for all you Java experts by mtmmtm · · Score: 1

      try ibm:s jdk. it is 20 % faster than gcc-c-code on FIR-filter (float-perofrmance).

    5. Re:question for all you Java experts by Sven+Tuerpe · · Score: 1
      Do any of you Java people have some amazing tips for me? I did use all the optimization flags I could find. Or is this typical performance for Java, making a 1.2Ghz Duron run as slow as a P200 or a K6/300?

      Sure. Wipe the words milliseconds, GHz, performance, benchmark, and optimization from you memory. They don't matter in about 99.99% of all programming, and caring about them where you shouldn't is likely to lower the quality of your program code. In particular they don't matter when comparing languages. Thank you for your consideration.

      --
      http://erichsieht.wordpress.com/category/english/
    6. Re:question for all you Java experts by pb · · Score: 1

      I happen to enjoy benchmarking; it's a good way to compare different languages and language implementations, and also a good way of testing how much a particular language implementation (or set of them) has matured over time.

      Obviously the times to care about benchmarking are 1) before you start coding -- if performance is important, find a good set of tools for your project and 2) when you're done with a cycle of development, to test the performance of your application, and see how it can be improved.

      So far, I've found that C implementations haven't (or can't?) improve too much more (i.e., an order of magnitude) while Java implementations easily can (and, in fact, can easily show orders of magnitude performance differences).

      But most of the time, your tips are applicable, much like the first rule of optimization.

      --
      pb Reply or e-mail; don't vaguely moderate.
    7. Re:question for all you Java experts by pb · · Score: 1

      The BYTEmarks are CPU performance tests, designed to measure the performance of a new CPU or platform. Both the C and the Java tests were run on the same P90 (an INT and FP score of 1.00 = P90 performance) and can therefore be compared to that.

      You're right about the JVM performance issue--I think it was originally normalized with Symantec's Visual Cafe? I can only assume they tried to use the best Java implementation they could at the time, but judging from straight CPU performance, I can only infer that JVMs have gotten worse, or that there are other factors at work. Maybe I should try those JVMs under Windows to see how drastic the performance difference is.

      --
      pb Reply or e-mail; don't vaguely moderate.
    8. Re:question for all you Java experts by GCP · · Score: 1

      I'm coming pretty late to this discussion, but you still might see this. It sounds as though you're asking a sincere question, and I think you deserve a better answer.

      I don't know how you did your tests, but Java benchmarking is a funny thing. Java should be run in a HotSpot or equivalent runtime optimizer, and when it is you get a slow startup time, slow runs for the first few runs of an app, and then quite fast performance thereafter after the code has been compiled, optimized, and cached by the runtime system.

      On a server, that's how a real Java app operates. It is started up, then it is run again and again within an ongoing process. It doesn't have to restart and recompile, so it spends most of its time running quite fast after a slow start. Benchmarks that look at the first run instead of the 1000th are okay for C but completely misrepresent Java. Measurements should reflect the 99.9% case, not the exceptional case (startup).

      In my own informal experiments, I've found that Java gets pretty close to C++ after it gets rolling. (I haven't benchmarked against C.) The differences are interesting to me, too, but are usually swamped by other issues such as database connections that dwarf the language delta.

      --
      "Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
  69. A bit late to write on Java. by Anonymous Coward · · Score: 0

    Now that .Net's here, I don't see why people still bother writing on Java. Yes, Java was great back then in the old days, but it's quite dead now.

  70. update by pb · · Score: 2

    After doing a bit more research about JVMs, I installed IBM's JVM, which outperforms both GCJ and Sun here:

    IBM INT: 5.8 FP: 6.4

    These results still aren't as good as I'd hoped, but it does show that all of the JVMs aren't up to par yet, and therefore should be careful in choosing one!

    --
    pb Reply or e-mail; don't vaguely moderate.
    1. Re:update by Anonymous Coward · · Score: 0

      Here's a tip: get rid of Linux, it's got the crappiest JVM's around (that no one cares to optimize).

      Get a real OS with a real JVM.

  71. Re:bravo! by Anonymous Coward · · Score: 0

    Hahahaha ...

    ah.

    Hahahaha ...

    uhm. Hahaha. This is really good. Sorry - Hahahaha ... the sites never work, so good. Try turning on your brains about once a week.

  72. Actually... by perkr · · Score: 1

    A portable text editor w/ standard features would probably only need 200 lines or so since most of the functionality is provieded from the API, the power of OOP.

  73. I initially liked Java... by callipygian-showsyst · · Score: 1

    ...until my employer made me work with Java visionary and author Patrick Naughton. Now I don't want anything to do with it.

  74. Re:bravo! by Anonymous Coward · · Score: 0
    From an end-user, I usually turn off java and javascript.

    I do turn them on about once a week, when a site *requires* them. My reaction is always the same, why did I bother? The sites never work, ever.

    J and JS are junk. Give them up, already.
    We know you're lying, because the daily child porn sites you access all require client-side JavaScript validation.
  75. Is Java that big a pain? by Anonymous Coward · · Score: 0
    So did it turn out that you were making things harder than they had to be, or is Java really just programmer hostile, excrutiatingly verbose, pain in the ass?

    I don't think Java is programmer-hostile, or particularly verbose, although like all languages it can be a pain in the ass. I'll agree that most names in the JDK are descriptive, which comes at the cost of being long. It lacks certain shorthands I've seen in Python (yay built-in data structures and the slice operator!) and case-sensitivity does make for a lot of typo errors. And strong typing mixed with the Java primitive types is a headache. OK, I am now talking myself into your point.

    I would like to see an example of a language that isn't programmer hostile, excruciatingly verbose, or a pain in the ass. MIPS assembly isn't verbose, but I have yet to see a language that did less work for you. Scheme has great elegance so long as your editor matches parentheses for you. Python I like, though whitespace as structure makes me a little uneasy when I think too hard on it. C and Perl I won't comment on because I left my asbestos underwear at the dry cleaners. ;-)

  76. Good book, one caveat by Anonymous Coward · · Score: 0

    As everyone says, Effective Java is a good book. Bloch presents the pros and cons of his suggestions, to help you decide which ones are worth following.

    You just have to keep in mind that your development project differs from the massively used JDK APIs that Bloch spent his time on. For example, changing public interfaces is much less of a problem when you're working on a self-contained project with a small team.

  77. Useful not just for Java mavens.... by PinglePongle · · Score: 1

    I am an infrequent Java programmer, but I found this book extremely useful when thinking about design in other languages. Much of the advice about how to fashion reusable libraries, how to think of the users of your class as potential wrong-doers is extremely useful.

    --
    It's all very well in practice, but it will never work in theory.
  78. Re:An intelligent reply? What gives?? by YouMakeMeSoANGRY · · Score: 1

    Firstly, a Java application written for Java 1.0 will still compile and run with Java 1.4. When the C++ standard (or the subset of the standard that any given compiler actually implements) changes people do not have any such guarantee.

    Secondly, I'd be interested in knowing exactly what 'powerful and useful' functionality Sun is holding back?

  79. Great book! by jeffbeadles · · Score: 1

    This is a great book for those who know some about Java, and want to know more.

    Also, if you ever get a chance to see Joshua speak, go for it! He's a really engaging speaker, much better than the rest of us nerds :-)

  80. Re:Where's the TOC??? (you missed some...) by Anonymous Coward · · Score: 0
    11 Standard Required Joke
    1. 58:???
    • 59:Profit!!!
  81. Re:bravo! by rob_canoe · · Score: 1

    So that is why my J2EE App Server only works about once a week. It is when you turn it on.

  82. Re:Short Book by znaps · · Score: 1

    AWT was never slow. Swing is now quite fast with the 1.4 release. SWT is cool too, but harder to extend the functionality of compared to Swing.