Slashdot Mirror


Developing Java Software

Simon P. Chappell writes "It's good to learn a programming language, but it's a far better thing to learn to write programs in that language. What the world needs are less programming language books and more books on programming with the language of your choice. Enter Developing Java Software, 3rd edition by Russel Winder and Graham Roberts. Dr. Winder is the primary author and I became aware of this book when he mentioned it on the Groovy mailing list. Knowing him to be an intelligent and helpful member of the Groovy development team, I rushed to suggest that I could review it for him." Read the rest of Simon's review. Developing Java Software (3rd edition) author Winder and Roberts pages 885 (19 page index) publisher Wiley rating 7/10 reviewer Simon P. Chappell ISBN 0470090251 summary A good book for learning to write programs with Java.

Developing Java Software is a text book, and is targeted towards university undergraduates, most likely in some form of computer science curriculum. It is also completely suitable for self-learners who want to teach themselves how to write software in Java. The book has been used by the authors when teaching undergraduate classes at University College London, so it has been fully tested in the academic environment.

There are five parts, with twenty four chapters between the first four parts and ten appendixes in the fifth. Each of the chapters are short, most are less than 40 pages, tightly focused and fairly self-contained.

The first part, the longest of them all, starts out with the introduction chapter that no book is complete without. Really, how many people who want to learn Java don't know that it used to be called Oak and was originally designed for set-top boxes? Anyway, after that little excursion, the book moves onto useful stuff like "Programming Fundamentals", introducing concepts like statements, variables and expressions. Next is "Adding Structure" where we discover methods and control structures. Chapter four is "Introducing Containers" and does a good job of covering arrays and the whole slew of container data structure classes in the standard library. Chapter five is a little time off for good behaviour, where we get to spend some time "Drawing Pictures" before heading into chapter six for "Classes and Objects". Chapter seven explains "Class Relationships" while chapter eight introduces us to "Exceptions". Chapter nine is "Introducing Concurrency with Threads". We finish up with chapter ten covering "User Interfaces".

Part two addresses the "Process of Programming" and this is where it really differentiates itself from the rest of the Java book crowd. Chapter eleven gives an overview of "The Programming Process". Chapter twelve begins the process of making that real by addressing "Unit Testing". Chapter thirteen continues the story with "Test-driven Programming Strategies". More practical advice comes in chapter fourteen as they introduce the reader to "Programming Tools".

Part three brings two "Case Studies in Developing Programs". Chapter fifteen introduces the case studies. The first study, "Contacts Book" is in chapter sixteen and the second, a "Pedestrian Crossing Simulation" is in chapter seventeen.

Part four is "The Java Programming Language in Detail". This is the more reference portion of the book and it's seven chapters cover variables, types and expressions, flow-control, classes and packages, inheritance and interfaces, exception handling, threads and concurrency.

Part five is the "Endmatter" and holds ten appendixes.

The first thing to like with this book is that it has an engaging style. The style comes not just from the body text, but also from the notes, tips and references in the margins of the book. As someone who learned Java almost ten years ago, I have difficulty plowing through yet more body text explaining the same old stuff that every other Java book covers; yet, jaded and cynical as I am, I enjoyed the sparks of honesty and humour in the text.

As I alluded to in my opening remarks, this book takes the approach of trying to not only teach Java, but how to approach and actually write programs using Java. The book takes an iterative approach and emphasizes the use of testing tools. Interestingly, they use TestNG rather than the de facto standard JUnit. This is the first book that I've seen that uses TestNG; perhaps JUnit is finally getting some competition?

The book is completely targeted at Java 5. All of the code examples use the new features where appropriate. This makes the book worth considering for those that already know Java but want to finally climb onboard with the latest version.

Naturally, there is a website available at www.devjavasoft.org where all of the source code for the programs in the book may be downloaded, together with answers to the exercises and any updates or revisions of the material in the book.

One of the challenges of writing or updating a book of this size is that it's possible (nay, almost guaranteed) to miss important things. The tip at the top of page 190 is a classic example, where the reader is advised that calling System.gc() will force the Java Virtual Machine (JVM) to perform a garbage collection. This is not, and has never been, true. The most that the System.gc() call will do is let the JVM know that now would be a good time for it to garbage collect, but there are no guarantees that any collection will actually take place. With this being the third edition of the book, I expected errors of this sort to have been caught by now.

Another point to consider is that with this being a textbook the writing style is less like a mass-market book and it also includes questions and exercises at the end of each chapter. I normally avoid books of this sort, although this does seem to be one of the better ones.

I hate being picky about typography, especially with the average level being quite good these days, but this book is set in a smallish font for the amount of text on each page. It is a serif font, but I didn't find it the most comfortable to read. Also, and this is the most egregious fault in the whole book, the program listings are set in a proportional font! I could hardly believe it when I saw it. While I realize that the authors are unlikely to be responsible for the final font selections, I fear that it damages an otherwise strong book and does them a disservice.

This is a good book for learning Java. More importantly, it's a good book for learning to write programs with Java.

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

170 comments

  1. Arghhh... by Anonymous Coward · · Score: 0, Troll

    This is a very ass-sucking review. The only criticism is the typeface? I bet that it's not *that* impressive of a book.

    1. Re:Arghhh... by eln · · Score: 2, Funny

      To be fair, the typeface must have been really abysmal. I mean, it knocked 3 whole points off the score of an otherwise perfect book!

      I can't recall ever having a grade on anything I've written drop from an A+ to a C- based on what font I used. This guy REALLY hates proportional fonts.

    2. Re:Arghhh... by jdray · · Score: 1

      Are you willing to bet the cover price of the book on that?

      --
      The Spoon
      Updated 6/28/2011
    3. Re:Arghhh... by RingDev · · Score: 1

      With a preface like this: Knowing him to be an intelligent and helpful member of the Groovy development team, I rushed to suggest that I could review it for him. I assumed this would be a bit of a biased review. I think your assessment is accurate. The review author is ass sucking and complains only when he realised he got a hair in his mouth.

      Not saying it's a bad book. I agree strongly with his statement about recent college grads needing more knowledge about how to develop software. It's just hard to take the review serious with the bias that came along with it.

      -Rick

      --
      "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
    4. Re:Arghhh... by kalidasa · · Score: 1

      A 1 to 10 scale for a book is not the same thing as a 0 to 100 grade in a class. The average grade in most of your classes is probably 70 (undergrad) or 80 (grad); the average rating for a book on a 1 to 10 scale should be 5.

    5. Re:Arghhh... by Anonymous Coward · · Score: 2, Funny

      Well, personally, I had my grade drop from an expected A+ to an F when I used nothing but wingdings in a 10 page paper...

    6. Re:Arghhh... by Bill+Dog · · Score: 2, Funny

      The professors' plight: Every year the same material, just a different group of wingdings.

      --
      Attention zealots and haters: 00100 00100
    7. Re:Arghhh... by lightversusdark · · Score: 1

      When I was doing my Masters, I was knocked down from 10/10 to 7/10 on a particular submission, for the sole reason that I had submitted my listing in proportional as opposed to fixed-width fonts. I of course vowed never to get caught out again or give the lecturer in question any other reason to otherwise penalise me.
      I suppose I must credit him with making me think about it, which I had never previously done.

      --
      "There is nothing nice about Steve Jobs and nothing evil about Bill Gates." - Chuck Peddle
  2. No basic types by Anonymous Coward · · Score: 0

    Rule #1. NEVER USE BASIC TYPES

    Please use "Int" instead of "int"... A good JVM will run this code nearly as fast, but the added bonus is that you make your code way more generic. Java is not C++.

    1. Re:No basic types by Palshife · · Score: 2, Insightful

      Good advice for Java 1.5 and up, but without autoboxing you'll be using primitives because of their pervasiveness in the JDK.

      --
      Attention deficit disorder is a complicated issue, spanning several major... HEY LET'S GO RIDE BIKES!
    2. Re:No basic types by mkosmul · · Score: 4, Insightful
      Rule #1. NEVER USE BASIC TYPES Please use "Int" instead of "int"... A good JVM will run this code nearly as fast, but the added bonus is that you make your code way more generic. Java is not C++.
      On the other hand, Java is not SmallTalk. Primitive types are there for a good reason and you can and should use them to your advantage where it makes sense. BTW, it's Integer, not Int.
    3. Re:No basic types by Anonymous Coward · · Score: 0

      There is also not really anything generic about Integer... unless of course you want to substitute it with my newly improved derived class DoubleIntegerWithHexChars.

    4. Re:No basic types by msobkow · · Score: 1

      Autoboxing still comes at an instance-construction expense, no matter how well-tuned the implementation.

      I'd much rather see signatures that distinguish between intrinsic and box arguments, as it allows fine-grained performance tweaking.

      I am rather disappointed that we still don't have unsigned types in Java. It really is critical for providing efficient mapping of XML types, database types, and CORBA/IDL/IIOP interfaces. I'm also going to have to find an appropriate library that will map Java's 64-bit signed millitimestamp intrinsic to local platform libraries/data types. Mapping BigInteger and BigNumber at that lower level is probably inconsistent as well.

      XML string types are trivial. Just use a string pattern to validate setter arguments.

      --
      I do not fail; I succeed at finding out what does not work.
    5. Re:No basic types by Anonymous Coward · · Score: 1, Informative

      Which you can't, because like half of java.lang, Integer is final, which means no other classes may extend it. Because, of course, no one would EVER want to add new attributes to Strings. (Like, say, font information, color info, minor things like that.)

    6. Re:No basic types by Anonymous Coward · · Score: 1, Insightful

      Please use "Int" instead of "int"... A good JVM will run this code nearly as fast, but the added bonus is that you make your code way more generic. Java is not C++.

      Yeah. While you're at it, make sure to store the value of pi in a variable, just in case the value of pi changes in the future.

    7. Re:No basic types by Anonymous Coward · · Score: 1, Insightful

      So why not just write a class called FormattedText and define a String member variable rather than make String a base class? After all, the methods you'd inherit from String are all relevant only to the actual character content, not formatted character content, and so can be called on the toString method.

    8. Re:No basic types by radtea · · Score: 4, Insightful

      A good JVM will run this code nearly as fast...

      Translation: "Lots of JVMs will run this code so slowly that your customers will think their machines have locked up."

      In some cases it is possible to control what JVM your customer uses. I once managed a Java dev team that produced great, fast code, including excellent Java3D graphics stuff. But performance on some customer's machines was terrible, because they were running one of those all-too-common JVMs that wasn't so good. My solution was to ship a good JRE as part of our install, hidden away in the application tree and used only by our application (thereby not breaking every other application on the machine that depended on the bad JRE's bugs.) This increased the size of our installer by 15 MB or so, but it was worth it to get a better customer experience. Our support calls dropped to almost nothing after that.

      However, not everyone shipping a Java application has this luxury, particularly those writing fo rthe Web. To suggest to those people that they should adopt some particular programming practice because it won't cause major issues with a "good" JVM is like telling a drowning person that water is necessary for life. It's true, but it isn't the least bit relevant to the practical predicament the person is in.

      --
      Blasphemy is a human right. Blasphemophobia kills.
    9. Re:No basic types by minniger · · Score: 0, Flamebait

      Excellent idea... for the first 10 min. Then no one can figure out what the hell is going on without finding the particular docs for your particular extension to String. Especially the poor sap that has to figure out your code 2 years from now.

      Yes, Ruby... I'm looking at you.

      Ahghg!

      Please don't flame me!. I love Ruby, I really do! It's the bestest ever!

      Really.

      Ahem...

    10. Re:No basic types by John+Courtland · · Score: 1
      I am rather disappointed that we still don't have unsigned types in Java.
      Last time I made that argument on this site, a ton of assholes flamed me. I totally agree with you, and if you've read Goslings reasoning behind WHY he didn't include signedness, you'll need to pick your jaw up off the floor.
      --
      Slashdot is proof that Sturgeon's Law applies to mankind.
    11. Re:No basic types by BritneySP2 · · Score: 1

      So... Why do we need a VM in the first place? Computer hardware isn't that slow these days, but computers do seem slow -- because they run VMs, JIT-compile all the time, etc. I call it "VM hell" that we are all in. No, we, in fact, ain't need no stinkin' Java or .NET (are we).

    12. Re:No basic types by msobkow · · Score: 3, Insightful

      Sometimes theory has to bend to make room for the practical.

      --
      I do not fail; I succeed at finding out what does not work.
    13. Re:No basic types by Tim+C · · Score: 2, Insightful

      Java is not C++.

      Neither is it C# - you'll be wanting Integer, not Int, except that for large amounts of number crunching that's a truly horrible idea. Mind you, for large amounts of number crunching Java isn't a particularly good idea in the first place if performance is key.

    14. Re:No basic types by Anonymous Coward · · Score: 1, Insightful

      I'll be the first to defend the fantastic job dynamic compilation can do (such as automatically inlining calls to virtual function if it decides it can - and uninlining when it can't anymore), or the GC (like the new generation pretty much behaves as allocating on the stack).. BUT.

      This is just moronic.

      True, javac and the JVM will automatically translate Int(eger)s in ints when they can, and thus it will be as fast... As long as you don't store it in an object, or pass it to a virtual function that the JVM can't inline. Because then it has to create the actual object, it will have to dereference it everytime it's used, and the GC will have to deal with it.

      Second, it's not "more generic" in any way, since Integer is final - so you can't specialise - and, OTOH, java will autobox an int as needed - so you're not actually gaining anything -.

      Third, using Integer opens you to NullPointerExceptions

      This is the kind of "rule", defended through a lack of understanding of what's going on behind the scene, that is causing much of the performance problems some Java programs have.

    15. Re:No basic types by VGR · · Score: 4, Informative
      Which you can't, because like half of java.lang, Integer is final, which means no other classes may extend it. Because, of course, no one would EVER want to add new attributes to Strings. (Like, say, font information, color info, minor things like that.)

      First of all, String and the primitive wrapper classes are used by most of the core classes like ClassLoader and Class. If they could be overridden, it would be a gigantic security hole. Also, many crucial mechanisms rely on those classes' immutability, so allowing for the possibility of a mutable subclass would introduce considerable instability.

      Second of all, people all too frequently seem to want to use inheritance for every task. Inheritance is not a toy. It's a String and some other data, not a new kind of String or a String with specialized behavior. Subclass when you must, not whenever you can. As someone else pointed out, you're far better off using a class (such as java.text.AttributedString) that aggregates a String and your other attributes of interest.

      --
      The Internet is full. Go away.
    16. Re:No basic types by SwedishPenguin · · Score: 1
      Most programs do not use VM's, so that's not why computers seem to be slower. It's more an issue of bloated operating systems, inefficient design and more and more bells and whistles.
      The disadvantages of VM's are exaggerated IMO, the portability of applications achieved with Java outweighs the disadvantages. (note that this doesn't apply to C# programs written with Visual studio, I'm not sure why C# runs under a VM considering that it was designed for Windows only)
      Java may not perform quite as fast as C/C++, but the difference is neglible, and is only noticable in applications requiring alot of processing.
      Java programs are however slower to start, since they require that the JVM be started and the JIT compilation to be performed.

      The Swing toolkit, IMO, does a huge disfavor to Java in this regard. Because the entire toolkit is emulated, making the GUI slow, contributing to the general perception of Java as slow.
      I much prefer the SWT toolkit, since it both integrates better with the native environment and performs better. In fact most people wouldn't be able to tell a Java SWT app apart from a C/C++ GTK/Windows/Mac application.

    17. Re:No basic types by PastaLover · · Score: 1

      I totally agree with you, and if you've read Goslings reasoning behind WHY he didn't include signedness, you'll need to pick your jaw up off the floor. Do you happen to have a link for that? Haven't read it yet.
    18. Re:No basic types by Decaff · · Score: 4, Informative

      (note that this doesn't apply to C# programs written with Visual studio, I'm not sure why C# runs under a VM considering that it was designed for Windows only)

      It allows the same binaries to run on Windows on different processors - .NET developers don't need to worry about switching between 32 or 64-bit systems.

      Java may not perform quite as fast as C/C++, but the difference is neglible, and is only noticable in applications requiring alot of processing.

      Actually, it can be the other way around. The more processing, the more chance that the run-time profiling and optimising gets to work, the faster Java runs.

      Java programs are however slower to start, since they require that the JVM be started and the JIT compilation to be performed.

      The JVM starts fast, and modern Java does not require any JIT compilation before the program starts. Instead the interpreter starts running, and hotspot optimisation kicks in later.

      The Swing toolkit, IMO, does a huge disfavor to Java in this regard. Because the entire toolkit is emulated, making the GUI slow, contributing to the general perception of Java as slow.

      Was true years and years ago, not now. It isn't all emulated - Swing uses DirectX to write to displays on Windows, for example. I am not actually sure that 'emulated' is meaningful. Swing draws controls using the Windows graphics API. So does every other Windows app. These days, having custom controls is very common (just look at media players).

      I much prefer the SWT toolkit, since it both integrates better with the native environment and performs better.

      Not true any more either. SWT has a reputation for actually being slower than Swing on at least some platforms, such as X. (Anyway, what does 'native GUI' mean on X-Windows anyway?)

      In fact most people wouldn't be able to tell a Java SWT app apart from a C/C++ GTK/Windows/Mac application.

      With Java 6, the same is true for Swing - a lot of work has been put into that, especially with the Vista interface.

    19. Re:No basic types by zootm · · Score: 1

      I'm not the poster of your post's parent, but I did a bit of searching (since I was interested too), and in most cases it seems to be simply that he believed that unsigned types just add complication to little real benefit. He often cites that Java was supposed to be reasonably simple to understand the semantics of, and that unsigned types tend to dilute that. I tend to agree (I never really "got" unsigned types), but here's some indicative quotes:

      In programming language design, one of the standard problems is that the language grows so complex that nobody can understand it. One of the little experiments I tried was asking people about the rules for unsigned arithmetic in C. It turns out nobody understands how unsigned arithmetic in C works. There are a few obvious things that people understand, but many people don't understand it.

      Source

      Q: Programmers often talk about the advantages and disadvantages of programming in a "simple language." What does that phrase mean to you, and is [C/C++/Java] a simple language in your view?

      ...

      Gosling: For me as a language designer, which I don't really count myself as these days, what "simple" really ended up meaning was could I expect J. Random Developer to hold the spec in his head. That definition says that, for instance, Java isn't -- and in fact a lot of these languages end up with a lot of corner cases, things that nobody really understands. Quiz any C developer about unsigned, and pretty soon you discover that almost no C developers actually understand what goes on with unsigned, what unsigned arithmetic is. Things like that made C complex. The language part of Java is, I think, pretty simple. The libraries you have to look up.

      Source

      Hope that's the sort of thing you were looking for. :)

    20. Re:No basic types by zootm · · Score: 1

      To be fair to Sun and to Swing, they have been improving that library greatly in the last while. The version of Swing which comes with Java 6 (released the other day) is actually really quite good.

    21. Re:No basic types by PastaLover · · Score: 1

      Thanks :-) Exactly what I was looking for.

    22. Re:No basic types by krelian · · Score: 1

      So, what really goes on with unsigned arithmetic in C?

    23. Re:No basic types by nonsequitor · · Score: 1

      We did the same thing with our installer when we first had a beta site running Java on Linux. We rolled our own RPM file that would install everything in our directory so it was impossible for the customer to screw it up. Of course I still got support calls about Java on Linux on my personal cell phone at 11 pm on a Saturday evening from that customer, but after 10 minutes of digging it comes out "Well its not really for your product, that works great, which is why I'm calling you to get this other application working."

    24. Re:No basic types by Javagator · · Score: 1

      Have you ever tried to do image processing with signed bytes? This is one of the reasons I have stopped using Java for my personal programming.

    25. Re:No basic types by ClosedSource · · Score: 1

      That answer makes sense if you assume the only purpose of unsigned types is to perform arithmetic on them. Somehow I doubt Gosling did much real-world embedded development or he would understand that.

    26. Re:No basic types by ClosedSource · · Score: 1

      "Second of all, people all too frequently seem to want to use inheritance for every task."

      Actually, these days people all too frequently seem to want to use interfaces for every task.

    27. Re:No basic types by John+Courtland · · Score: 1
      You drop the two's compliment and treat the entire bit array as an integer from 0..MAXINT*2. That simply means no negative numbers. Or all negative numbers, depending on your application. The problem with signedness in limited bitrange (like 32bit) math is that when you go from MAXINT to MAXINT+1 you end up with MININT... no overflow, no exception, no nothing. It will silently overflow to MININT.
      Try this:

      public class test {
      public static void main(String [] args) {
      System.out.println(Integer.MAX_VALUE + 1);
      }
      }
      And put that in a file called test.java. Run javac test.java. Then run java test. It'll return MININT. You have no way of getting any higher without using a 64bit data type, which is insane.

      The sad thing is that I'm fucking wasted and I still get the idea. Gosling's decisions make me mad sometimes.
      --
      Slashdot is proof that Sturgeon's Law applies to mankind.
    28. Re:No basic types by Anonymous Coward · · Score: 0

      It's funny you mention that, because I've worked on a program that had different values for pi in more than one place. Ever heard of an irrational number? 3.14159 in one place, 3.14 in another, the result of two different coders. Shoulda used a variable for pi.

    29. Re:No basic types by CptPicard · · Score: 1

      Right. I replace integers with my own implementations all the time, as the rules of math tend to be so subjective... also (1+2)/5 is so much clearer as new Integer("1").plus(new Integer("2")).divide(new Integer("5"))...

      --
      I want to play Free Market with a drowning Libertarian.
    30. Re:No basic types by Anonymous Coward · · Score: 0

      That's because it's a question on every interview, so people study the crap out of it and then want to use it everywhere because they don't know the KISS principle.

    31. Re:No basic types by dave1791 · · Score: 1

      ... or java.lang.Math.PI

    32. Re:No basic types by joshv · · Score: 1

      Gosling has never apparently seen the hoops you have to jump through to emulate unsigned arithmetic with signed types. Yes I am sure the compiler supporting unsigned int's would have been much confusing for us poor inellectually challenged Java devs.

    33. Re:No basic types by arevos · · Score: 1

      First of all, String and the primitive wrapper classes are used by most of the core classes like ClassLoader and Class. If they could be overridden, it would be a gigantic security hole.

      One could get around this problem simply by restricting the effects of the overrides to a subset of classes. For instance, one could restrict it to a certain namespace, or a certain application domain. I should point out that the JVM-based language Nice allows one to override existing methods without incompatibility issues with standard class files, so it's quite possible to have the functionality described without compromising security.

    34. Re:No basic types by joshv · · Score: 1

      In other people's code, I quite frequently see interfaces with only one implementation.

      Yes, I imagine, sometime in the far future, someone *might* possibly think about a different implementation. It happens rarely. In the meantime I have two pieces of code to update every time there is a change to a method signature.

    35. Re:No basic types by zootm · · Score: 1

      By "emulate unsigned arithmetic", do you mean jumping to the max value when you remove one from zero? Is this something you need to do frequently?

    36. Re:No basic types by joshv · · Score: 1

      I get a byte from a file. I need to add it to another byte from the file. I need the bytes to be treated as unsigned, otherwise arithmetic operations on them are not going to proceed as expected.

      This requires upcasting the byte to an int and doing a bitwise & with 0xFF to wipe out the sign. Then you do your arithmetic with the ints and then downcast back to a byte if need be.

      If you think this rare, realize that there are all sorts of byte streams out there that were not created by Java applications, that intend every 8-bits to be interpretted as an unsigned byte.

    37. Re:No basic types by zootm · · Score: 1

      What a pain. Cheers for that clarification. I realise it's not rare, but it is an interoperability issue rather than a direct issue with Java in and of itself.

    38. Re:No basic types by Anonymous Coward · · Score: 0

      "(note that this doesn't apply to C# programs written with Visual studio, "

      C# code can be written in Notepad dontcha know?

      "I'm not sure why C# runs under a VM considering that it was designed for Windows only"

      C# doesn't run in a VM. The code is compiled to MSIL then JIT compiled to machine code during execution. There is no concept of a Virtual Machine. And it isn't designed for Windows only.

    39. Re:No basic types by cyborg_zx · · Score: 1

      There are pleanty of GUI classes to do with formatting et al. The only real issue here, as far as creating a wrapper, is that things that expect 'String's couldn't work with your subclass because there's no way of producing a valid inheretance for it. As ever, there's more than one way to do these things and there are trade-offs in either approach.

    40. Re:No basic types by honor,+not+armor · · Score: 1

      Forgive me, but I don't know much about the different flavors of JVMs, since I learned on Sun's and haven't touched any others (unless you count running Azureus on GCJ). Can you give some recommendations about the different JVMs (and the name of the one you chose), or maybe link a comparison chart?

    41. Re:No basic types by Decaff · · Score: 1

      C# doesn't run in a VM. The code is compiled to MSIL then JIT compiled to machine code during execution. There is no concept of a Virtual Machine.

      This isn't true.

      http://en.wikipedia.org/wiki/Common_Language_Runti me

      "Common Language Runtime (CLR) is the name chosen by Microsoft for the virtual machine component of their .NET initiative."

      Just because you have JIT compilation does not mean you aren't using a VM. The combination of VM and JIT has been around for decades.

    42. Re:No basic types by honor,+not+armor · · Score: 1

      Furthermore, for anyone wanting to know the differences between .NET and Java or wanting some information on how the CLR (.NET VM) works, I found this comparison to be very helpful.

    43. Re:No basic types by ClosedSource · · Score: 1

      It's not a direct issue with Java as long as you don't intend to do systems programming with it. This is one of the reasons why Java is generally not used for that purpose.

    44. Re:No basic types by zootm · · Score: 1

      Yeah, along with (generally) requiring a VM, I suppose. I expect it was something of a pain in the ass for the JNode team...

    45. Re:No basic types by Yogs · · Score: 1

      All this is very true.

      The flip side is that very often you want a class to do something very similar to a final class String comes to mind for regular expressions and DNA, but there are many possibilities. I'd say there are really more for collections I'd say than for String, but whenever you see static util classes popping up on the same class for different reasons it's clear that isomething is broken in OO land.

      You can create a wrapper and manually delegate everything, but I think this happens frequently and brainlessly enough that there should be in-built language support for delegating a particular interface to a member of the class. Then just override what, if anything, it makes sense to override.

      Anyways, my 2c.
      I have a lot of gripes with Java.

      BTW: Referring back to the String example, there's another problem. The interfaces don't come anywhere close to covering the members of String. It's not hard to solve this problem... just create the new interface(s) and declare that String implements it/them. By not creating standard covering interfaces you're not only encouraging, you're more or less demanding a lot of concrete instances of String, when what you really mean is something String-like in some way.

    46. Re:No basic types by VGR · · Score: 1
      BTW: Referring back to the String example, there's another problem. The interfaces don't come anywhere close to covering the members of String. It's not hard to solve this problem... just create the new interface(s) and declare that String implements it/them. By not creating standard covering interfaces you're not only encouraging, you're more or less demanding a lot of concrete instances of String, when what you really mean is something String-like in some way.

      You mean like CharSequence?

      --
      The Internet is full. Go away.
    47. Re:No basic types by Anonymous Coward · · Score: 0

      Given that comparing two objects that implement CharSequence is undefined, I think not. Never give an object's job to an interface.

    48. Re:No basic types by ClosedSource · · Score: 1

      There's a trend toward imagining that any code you write might be the basis of the world's next big framework. Look at Netbeans and particularly Eclipse: apparently they believe that perfection has been achieved as IDEs so they have nothing better to do than turn them into platforms.

  3. A Leveling book. by Anonymous Coward · · Score: 0
    This is a good book for learning Java. More importantly, it's a good book for learning to write programs with Java.

    What a tepid review. You could have added that it's a great book for making sure your kitchen table doesn't wobble if one leg is short.

    1. Re:A Leveling book. by richdun · · Score: 3, Funny

      You know, I bet it's also a good book for learning how to develop applications with Java.

    2. Re:A Leveling book. by Anonymous Coward · · Score: 0

      Probably an even better book to get a fire started.

    3. Re:A Leveling book. by j4v4n4t0r · · Score: 1

      HaHa! It's also a good way to learn how to set your server on fire from 50 people hitting the 'application' at once. Has anyone use docs.sun.com during working hours? It's really like Sun runs this stuff on Windoze. Java is horrible, it's great for the programmer but kills a machine. BTW, does the book discuss how to make the JVM memory footprint smaller?

  4. I usually buy reviewed books from /. but.... by Kranfer · · Score: 3, Informative

    I think after checking this out more on Amazon.com I am going to pass on this particular book. Not only is it $65... $15 more than usual Wrox books (which I personally like) but it also seems to have a lot of condensed information with potentially useless programming situations... I find it hard to believe that the reviewer did not find much wrong with the book and only gave it an 7/10? If we convert that into a grading scale, obviously thats 70%... thats struggling to get points across, and will be adequate for basic points ofr JAVA 5. As a suggestion, I would love to see a review of a good JAVA 6 book, so I know what others have checked out, so I can make an educated decision on what my nice shiney new JAVA 6 book will be.

    --
    -- Josh
    "Whoopie! Man, that may have been a small one for Neil, but that's a long one for me!" - Pete Conrad
    1. Re:I usually buy reviewed books from /. but.... by Anonymous Coward · · Score: 0

      but, if we assume that book quality is normally distributed then very few books would be 1 or 2, very few books would be 9 or 10, many books would be 5, and 7 would indicate a book of good quality

    2. Re:I usually buy reviewed books from /. but.... by Anonymous Coward · · Score: 0

      ...more than usual Wrox books (which I personally like)


      There is someone out there who _likes_ the crap that Wrox churns out????

      I know. Let's get enough authors to fill the cover, pay them by the page, and call the result good.

      bleeech.

    3. Re:I usually buy reviewed books from /. but.... by grimarr · · Score: 1

      But there's no reason to think that book quality DOES follow a normal distribution. (Also applies to movies, which a previous poster discussed.) The big reason is that there are editors and publishers that act as filters, and only books that pass the quality test get published. (Vanity publishers excepted.) The filtering process may have flaws, but it certainly prevents the process from being random.

  5. Gee whiz, what a true and deep nugget of wisdom: by Anonymous Coward · · Score: 0

    It's good to learn a programming language, but it's a far better thing to learn to write programs in that language.

    I would read the rest of the review, but I'm not sure I'd understand it.

  6. Why purchase? A good alternative.... by Anonymous Coward · · Score: 5, Informative

    ...is Bruce Eckel's Thinking in Java which has already invented the idea displayed here. Thats why you'll see that this book (tij) doesn't fully go into the bare Jave code but mostly reflects on the things which really matter. Knowing what things like Objects are, why objects differ from primitives, etc. Being a Java enthousiast myself it still amazes me how many people "program in Java" yet never learned how to interpret the JDK documentation, especially the so called API documentation.

    Anyway, the Thinking in Java book is both available for free download (see URL above) and if you wish a hardcopy (or the latest release) then you can also purchase it. In my opinion this is a much better book which is also presented in a more fair way.

    1. Re:Why purchase? A good alternative.... by krelian · · Score: 1

      The fourth edition (which covers java 5) is only available in book form, not as a downloadable ebook.

  7. Java User Interfaces by Dareth · · Score: 3, Funny

    chapter ten covering "User Interfaces".

    Was the ink from the first printing dry before Chapter 10 became outdated and deprecated?

    --

    I only look human.
    My mother is a halfling and my dad is an ogre, so that makes me an Ogreling
  8. Re:Gee whiz, what a true and deep nugget of wisdom by Intron · · Score: 1

    It's good to learn to write, but it's much harder to learn to write a good review.

    --
    Intron: the portion of DNA which expresses nothing useful.
  9. Java EE 5 book? by namityadav · · Score: 1, Offtopic

    This might be a good place to ask this question. The only Java EE 5 text that I have with me is the Java EE 5 Tutorial. Is there any other (More detailed, better written) book on the same topic that Slashdot readers can recommend?

    1. Re:Java EE 5 book? by mandelbr0t · · Score: 1

      I've not run into anything specific to 5.0 as it is likely too new for people to write books given the consulting opportunities available. I found the O'Reilly "Enterprise JavaBeans" 3rd. Ed. to be quite useful in wrapping my head around the overall architecture. "J2EE Design Patterns" (also O'Reilly) has some good pointers about applying design patterns to a J2EE application. Sun has their J2EE core blueprints in both web and print form. I notice that there's another O'Reilly about "Designing J2EE Applications".

      J2EE knowledge is tough to come by as it is the primary source of income for many people. Google has very little -- most of the Google hits I found were on various mailing lists looking for configuration help for a specific app server. However, synthesizing information from multiple sources still allowed me to answer both general and specific questions I had about J2EE architecture and APIs.

      mandelbr0t

      --
      "Please describe the scientific nature of the 'whammy'" - Agent Scully
    2. Re:Java EE 5 book? by thetoastman · · Score: 1

      The latest Thinking in Java has Java 5 specific chapters including generics and concurrency. My only complaint is that sometimes the index is a bit weak.

      In general, it's an excellent book.

    3. Re:Java EE 5 book? by Anonymous Coward · · Score: 0

      try the following link:-
      http://www.theserverside.com/tt/books/wiley/master ingEJB3/index.tss

      Good intro to EJB in Java EE 5

    4. Re:Java EE 5 book? by nule.org · · Score: 1

      The parent post was about enterprise edition, not SE. I haven't seen any EE 5 books out yet, although I know O'Reilly's Enterprise JavaBeans 3.0 is out, which to me was the most important part of EE 5. Although, I have to admit, I haven't bought the book because going through the NetBeans tutorials pretty much teach you all you need to know about EJB3 (assuming you get the basic idea of enterprise design patterns and have a conceptual idea of how EJBs work). Also, at the moment your choices for an EE 5 container are pretty slim (pretty much only glassfish). If you're deploying on JBoss like I am you can only use EJB3 and a handful of other technology like JAX-WS 2 and then only if you set it up right and include the right libraries.

      It is a bit of a shame, because EE 5 has really made enterprise Java a lot simpler and for some of us has made it a great choice for developing apps. Hopefully the amount of good documentation will increase soon.

  10. Re:Gee whiz, what a true and deep nugget of wisdom by YankeeInExile · · Score: 1

    Funny, I was reading that and thought to myself that it was overqualified. What they ought to say is It is good to learn many programming languages, but it is a far better thing to learn to write programs

    --
    How does the Slashdot Effect happen given that no slashdotters ever RTFA?
  11. Huh? by DoofusOfDeath · · Score: 4, Insightful
    What the world needs are less programming language books and more books on programming with the language of your choice.

    I can't disagree more. Most programmers already know programming pretty well, and don't need their books on specific programming languages to be diluted with general programming instruction. Each of us is a programming amateur just once (I hope), but learns many additional languages throughout his career, and I think we want those non-newbie books to be concise and get to the point.

    Every new programmer must learn to program in some language, but we certainly don't need a large variety of books that cater to people at that stage of proficiency - just one or two good ones.

    1. Re:Huh? by RingDev · · Score: 4, Insightful

      I disagree with your assessment. I have known numerous great coders. But there is a huge difference between a software developer and a coder. Developing software takes a significantly larger knowledge body than coding. Sure, I can grab a few top-of-their-class code gurus, stick them in a dungeon with jolt and an complete requirements list and expect a somewhat decent application. But what about gathering and assessing that requirements list? developing a test plan? determining differences between the spec and the user's needs? implementing a maintenance strategy... the list goes on and on. A good programmer will give you good code. A good developer will give you a good product.

      There are thousands of books on programing in different languages. The same 'Hello World' code slapped into chapter 1 of each of them. But how many books are there that can help a good programmer become a good developer?

      -Rick

      --
      "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
    2. Re:Huh? by chroot_james · · Score: 1

      I disagree. How to do things the Java way for large applications is not the same as how to do things the Lisp way or the Python way. Anyone who's worked on a large project will know that...

      I would even say that most programmers do NOT know programming pretty well. They know some programming and can get their day to day tasks done in a mediocre way. Anyone who's worked on a large project will know that...

      And to top it off, I'd also say that working in a corporate environment, where it's typical to buy software from a 3rd party and then modify it and finally implement it, shows us that software is rarely high quality so books on fixing software and building software in specific languages is more useful than something that focuses on theory, which rarely accommodates the needs of the employers...

      --
      Reality is nothing but a collective hunch.
    3. Re:Huh? by Abcd1234 · · Score: 1

      But how many books are there that can help a good programmer become a good developer?

      What you're describing isn't programming, it's Software Engineering.

    4. Re:Huh? by Greg_D · · Score: 5, Insightful

      What the world really REALLY needs are more programming books that reinforce software engineering concepts and best practices as they teach you the language. Almost every programming language has its own unique set of rules that makes code easier to develop and manage.

      Most programming language books I've seen will give you just enough rope to hang yourself... you'll be able to write a sweet multithreaded Hello World program with a nice GUI and a database connection, but without understanding how and why to develop and use objects properly, you might as well be coding in PHP 4.

    5. Re:Huh? by pottymouth · · Score: 1


      Agree completely. It seems every book out there wants to review programming basics to such a degree that you end up with a 500 page book with 50 pages of relevant text (the trick being to find the 50 you need)...

    6. Re:Huh? by morgan_greywolf · · Score: 1
      But how many books are there that can help a good programmer become a good developer?


      There are plenty of good books on software development. But we don't need one for each new language. The software development process is the same whether we're talking about C++, Java, Python, Perl or befunge. Programming is language specific. Software development is language agnostic.
    7. Re:Huh? by RingDev · · Score: 1

      I would strongly disagree with that statement. There will always be a debate as to whether a CS degree is an engineering degree, but the act of engineering a solution is greatly different than that of following a very specific set of instruction to create code.

      -Rick

      --
      "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
    8. Re:Huh? by RingDev · · Score: 1

      A very good point! Although I wouldn't say the two sets are completely disconnected. Developing an application in VB6 (shudder) is vastly different than developing an app in VB.Net/C#/Java. Both of which differ greatly from developing ASP.Net/JSP. There is overlap though, and I agree that there is not a need for each language to have it's own development book.

      -Rick

      --
      "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
    9. Re:Huh? by Anonymous Coward · · Score: 0

      What the world really needs is less Java.

    10. Re:Huh? by pclminion · · Score: 1

      Naah.. Take a language like Python for instance. Suppose you're a really good C programmer, and you have to write a Python program which adds 2 to each integer in a particular array. So you write:

      for i in xrange(len(array)): array[i] += 2

      Thing is, an experienced Python programmer would use a more functional approach (even though the above imperative approach is also possible):

      array = [x + 2 for x in array]

      Or...

      array = map(lambda x: x + 2, array)

      It's not enough to know the syntax of the language in order to use it the "right way." "There's more than one way to do it" might be mantra in the world of Perl, but that's a silly concept.

    11. Re:Huh? by Decaff · · Score: 1

      I can't disagree more. Most programmers already know programming pretty well, and don't need their books on specific programming languages to be diluted with general programming instruction.

      And I can't disagree more with this. Programmers who know programming pretty well are rare. A very large number stick with single language or two and are resistant to new approaches. Look how long it took for OOP to become mainstream, and I still read posts here from people who just can't see the point of it. There needs to be far wider tuition of general programming.

    12. Re:Huh? by deKernel · · Score: 0

      First off, a CS degree is not an engineering degree. I say this because I have an engineering degree. This might come off as snooty, but it is the truth. One major difference is in the problem solving area. As a student, you are taught to not just solve the problem but to understand the circumstances to the problem which will lead you to find the best solution WITHIN THE CONSTRAINTS OF THE ENVIRONMENT. I put that in caps for a reason. Think about it for a second. To solve a problem many times in life, you don't have an unlimited pool of 'parts' to choose from so the secret is to use what you have effectively.

      The second difference is that we are taught to keep the big picture in mind while delving into the details. This might sound trivial and stupid but what makes the difference many times. I say this with 12+ years of experience.

      While in college, I had several friends going for their CS degree so I am quite aware of the requirements of that degree. The difficulty is high compared to many degrees, but it doesn't match the difficulty of an actual engineering degree. I will give you an example, in my intro class the instructor told each individual to look around you because the person in front of you and on both sides most likely won't graduate with the same degree you will. He was right.

    13. Re:Huh? by Abcd1234 · · Score: 3, Insightful

      And I would argue that, unless you know how to develop a solution in the context of an overall design, you'll never be a good programmer. And *that* requires an understanding of software engineering (as the term is used in the industry, much to the chagrin of pissy, self-important engineers the world over (and yes, I'm referring to the other poster in this thread)).

    14. Re:Huh? by javamann · · Score: 3, Insightful

      "an complete requirements list"? You luck bastard! I'm lucky to get a half page of 'notes'.

    15. Re:Huh? by aardvarkjoe · · Score: 1

      For me (an experienced C coder, and one who has never used Python), the first one is obviously the "right way" to do it. Assuming that it does what it's supposed to do, I might as well choose the way that I will understand easiest when reading it tomorrow.

      "There's more than one way to do it" might be mantra in the world of Perl, but that's a silly concept.

      Why, because then somebody else's code might look a little different than yours?

      --

      How can we continue to believe in a just universe and freedom to eat crackers if we have no ale?
    16. Re:Huh? by RingDev · · Score: 1

      I feel your pain. That situation was a bit of a hypothetical. I've spent a good portion of my day flipping through bug reports that the users have submitted as "Incorrect functionality." I open the documentation to find what the correct functionality is only to find that the situation is either not documented, or documented saying the exact opposite.

      -Rick

      --
      "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
    17. Re:Huh? by Anonymous Coward · · Score: 0

      For me (an experienced C coder, and one who has never used Python), the first one is obviously the "right way" to do it.

      Except that it isn't. What if I wrote the same thing in C but in the Python style?

      void map_on_int(int (*mfunc)(int), int *v, int n)
      {
      if(n) { *v = mfunc(*v); map_on_int(v + 1, n - 1); }
      }
      int add_2(int v)
      {
      return v + 2;
      }
      void foo()
      {
      int array[5] = { 1, 2, 3, 4, 5 };
      map_on_int(add_2, array, 5);
      }

      Looks pretty damn stupid. The same thing written in an imperative style in Python looks equally dumb. Programming is not some kind of hippie relativism where whatever feels good is A-okay.

    18. Re:Huh? by Anonymous Coward · · Score: 0

      As a [engineering] student, you are taught to not just solve the problem but to understand the circumstances to the problem which will lead you to find the best solution WITHIN THE CONSTRAINTS OF THE ENVIRONMENT. That's because in engineering you have an environment to work in. If you're building a bridge you already know the endpoints and that it'll basically be a line. If you're designing a building you know the laws of gravity aren't going to change. Often times in CS the task will be something like to build a single 'bridge' that can be installed over a river, between continents, or in a Lego landscape. Or the 'laws of gravity' like which direction the stack grows will change on you.

      The second difference is that we [engineers] are taught to keep the big picture in mind while delving into the details. That's because the details often don't matter as much in engineering. If you use a bolt that is 1% too short chances are your structure will still stand. If you use a buffer that is 1 character too short chances are your program will explode and (take out the nuclear reactor with it).

      To solve a problem many times in life, you don't have an unlimited pool of 'parts' to choose from so the secret is to use what you have effectively. In CS you *do* have an unlimited pool of 'parts' to choose from, whether created from scratch or copied. Engineering would be a lot harder if you never had to actually *build* the structure in real life (if the design alone was the finished product) because the amount of possible choices would explode. So you want to make a bridge out of a giant ferris wheel instead of a flat road? Sometimes in CS that kind of thing is actually the 'best' solution. And that's crazy.
    19. Re:Huh? by Bill+Dog · · Score: 1

      Why, because then somebody else's code might look a little different than yours?

      Yes. Exactly. You should not program Python the C way, you should program Python the Python way. If you're just fooling around in a language for your own fun, and have no plans to program in it professionally, then fine. But if you're serious about it, and want/need to work with others in a language, then you should assimilate into that language and its developer community's style and idioms, so that you fit in and don't cause needless aggravation.

      This is what the reviewer meant by the world needing less books on programming languages (syntax) and more books on how one goes about programming in them (culture).

      --
      Attention zealots and haters: 00100 00100
    20. Re:Huh? by Anonymous Coward · · Score: 0

      Lisp. Ruby. Perl. Assembly.

      There's very little one could say that would be true of all of these.

    21. Re:Huh? by itlurksbeneath · · Score: 1

      Amen to that. I work with a couple of people that are "programmers" in title only. I look at some of their code when they get into tough spots (I stick to C/Java/Perl, myself - they code in VB and ASP) and have to shudder at some of the things they do. I'm not a VB programmer, but I do know programming in general and some of the things they do would get them drummed out of a CS program.

      --
      Have you ever considered piracy? You'd make a wonderful Dread Pirate Roberts.
    22. Re:Huh? by StarvingSE · · Score: 1

      A CS degree is not an engineering degree, I agree with this . It is more of a specialized math degree. However, I don't agree with your definition of what engineering is. I would say that Software Engineering is an engineering discipline that uses concepts from computer science, business, and other areas depending on the business domain. This is the same as lets say mechanical engineering using skills from traditional mathematics, materials, chemistry, etc). Software doens't have an unlimited bucket of parts as you seem to be inferring. Things such as time, manpower, hardware requirements really limit options and will take a skilled software engineering team to come up with a solution.

      We as software engineers also have to keep the big picture in mind while working on the details. The big picture is time requirements, the environment in which the software will be run, etc. Software and related technology also move at the speed of light compared to other engineering disciplines. We must always be kept up to date in our skillsets and train with new technologies on a constant basis.

      Your last paragraph does come off as snooty. I went to a science and engineering university, and both engineers and computer science had to take the same 2 years of calculus, differential equations, stats, etc. And I don't believe for a second that the major specific courses for CS and engineering differ much in difficulty, they're just different. I know this becuase most of my friends are engineers and I know what their classwork was like.

      I don't mean to make this sound like a flame, but I think you have a slightly narrow view of CS and software engineering. Also, before anyone makes comments about my /. handle, I am employed thank you very much. I had this account well before I graduated and was able to get a decent job.

      --
      I got nothin'
    23. Re:Huh? by Anonymous Coward · · Score: 0

      I do code in php4 you insensitive clod!

    24. Re:Huh? by Danga · · Score: 1

      One major difference is in the problem solving area. As a student, you are taught to not just solve the problem but to understand the circumstances to the problem which will lead you to find the best solution WITHIN THE CONSTRAINTS OF THE ENVIRONMENT. I put that in caps for a reason. Think about it for a second. To solve a problem many times in life, you don't have an unlimited pool of 'parts' to choose from so the secret is to use what you have effectively.

      A proper CS program will also teach the students to not just solve the problem but to understand the problem as well as the environment they are working in enough to solve it efficiently and with the "best solution". For instance, a proper CS program will teach what type of sorting algorithms work best on different types of data, teaching what type of data types would work best on particular hardware (32 bit vs. 64 bit), as well as why some languages might be better to use than other languages depending on the situation, etc. A good developer would use all of that knowledge as well as the knowledge they have about the particular OS the software may be aimed at, what type of hardware, what kind of requirements, etc to reach the best possible solution. You are not in some special group, others outside of the engineering programs learn and use what you mentioned too.

      The second difference is that we are taught to keep the big picture in mind while delving into the details. This might sound trivial and stupid but what makes the difference many times. I say this with 12+ years of experience.

      That is no difference at all. I can't tell you how many of my CS teachers wanted us to keep an eye on the big picture and not strictly focus on the details. If a developer has no idea what the big picture is then his little area he is working on may cause some big problems. I do agree that it makes a big difference but non engineers do this too.

      While in college, I had several friends going for their CS degree so I am quite aware of the requirements of that degree. The difficulty is high compared to many degrees, but it doesn't match the difficulty of an actual engineering degree. I will give you an example, in my intro class the instructor told each individual to look around you because the person in front of you and on both sides most likely won't graduate with the same degree you will. He was right.

      I would bet that any reputable CS program is AT LEAST as hard as an engineering degree. My roomate in college was majoring in EE and while he had to take a little bit more math than me (not much, I was a couple credits away from a math minor) from what I saw the rest of his program took no more effort than mine. Both programs were EXTREMELY difficult.

      As far as people dropping the major in my experience CS is very bad too. In the program I attended the assembler language class was the "weed out" class. I remember starting the semester out with about 25 students in the class. Only 8 were still around for the final and I know 3 of the 8 failed the class. One of the guys who failed the class was taking it his second time and he ended up switching to a different major. That is just one of many examples I could mention.

      I think a big difference between engineers and software engineers is most software engineers have a better ability to think abstractly. The regular engineers I have gotten to know over time struggle to "think outside the box" and work best on strictly defined and constrained problems. Both types of people are highly intelligent, they just think differently and are better in and/or enjoy certain areas more than the other which is why they end up deciding to either be a normal engineer or a software engineer.

      --
      Hey, there is only one Return and it's not of the King, it's of the Jedi.
    25. Re:Huh? by malraid · · Score: 1

      A determined Cobol programmer can write a Cobol program in any of those (or any other) languages...

      --
      please excuse my apathy
    26. Re:Huh? by Anonymous Coward · · Score: 0

      I will give you an example, in my intro class the instructor told each individual to look around you because the person in front of you and on both sides most likely won't graduate with the same degree you will. He was right.

      It's pretty obvious that you don't have a science degree, because that's not an example of anything other than the general level of stupidity at whatever clown college you attended.

    27. Re:Huh? by ClosedSource · · Score: 1

      In my view, whatever works is A-okay. The rest is just religion.

    28. Re:Huh? by fm6 · · Score: 1
      Each of us is a programming amateur just once (I hope), but learns many additional languages throughout his career, and I think we want those non-newbie books to be concise and get to the point.

      Yes that's a need — but it's a need that's already been met. The first thing anybody does when they're trying to get a new language accepted is to write a language reference. For Java, it's Gosling, Arnold, and Holmes. For C++, it's Stroustrup For Perl, it's the camel book. And so on. Yes, these books meet a big need. But there's no need to write these books over and over. And yet, that's what most programming texts do.

    29. Re:Huh? by GileadGreene · · Score: 1

      That's because in engineering you have an environment to work in. If you're building a bridge you already know the endpoints and that it'll basically be a line. If you're designing a building you know the laws of gravity aren't going to change. Often times in CS the task will be something like to build a single 'bridge' that can be installed over a river, between continents, or in a Lego landscape. Or the 'laws of gravity' like which direction the stack grows will change on you.

      Er... you may know the endpoints. In some cases the customer may not have specific endpoints in mind, just know that (for example) a particular river needs to be spanned at some point. The customer might also change their mind about the endpoints partway through the design. There's also the question of what kind of load the bridge should be built to carry. How much traffic will there be? What kind? Does it vary widely in different seasons? Is it likely to increase over the life of the bridge? By how much? How stable does the bridge need to be: Can it swing a little? How much? Under what wind conditions? The "environment" of a bridge is nowhere near as easily characterized as you so casually assume. The same goes for buildings. There may be some constants in a given problem domain, but there are also a pretty wide range of variables.

      You also seem to be assuming that civil engineering is the only kind of engineering. What about the microcontroller design engineers whose products need to function in everything from kitchen appliances to cars, and potentially in a wide range of climates? The aeronautical engineer whose product must function safely over a wide range of temperatures, pressures, airspeeds, while carrying a variety of passengers and cargo? The communications engineer whose product may be used for voice or data, in urban canyons and open prairies? There are plenty of engineered products where key elements of the "environment", ones that impact the function of the product, are not fixed, or even particularly well-characterized.

      That's because the details often don't matter as much in engineering.

      Wow. Just... wow. I can't believe you actually said that with a straight face (I'm assuming it was with a straight face). How much the details matter is dependent on the kind of product being engineered. Ditto which details matter. Just like in software development, where the exact details of the execution time of some particular algorithm may not matter that much for a web-app (so long as the time is "good enough" in most cases), but are absolutely critical for a real-time system.

      If you use a bolt that is 1% too short chances are your structure will still stand. If you use a buffer that is 1 character too short chances are your program will explode and (take out the nuclear reactor with it).

      It depends on the structure. Part of good engineering is determining what the tolerances of your design are, so that you know where you can get away with a 1% error, and where 0.0001% accuracy is critical. The odds are good that a nuclear reactor will require tolerances far in tighter than 1% in many places. By the same token, there are many situations where having a buffer 1 character too short probably isn't disastrous (maybe some non-critical data gets discarded in a few edge cases, but you don't lose anything the user really cares about).

      In CS you *do* have an unlimited pool of 'parts' to choose from, whether created from scratch or copied.

      I think that what the other poster was talking about was the limited availability of pre-designed building blocks, not the material shortages that might be faced in fabricating a particular design. In many cases it's simply not cost-effective to embark on (for example) a new ASIC design. So either the product won't get developed, or you need to find a creative way to make use of those components that you can rea

    30. Re:Huh? by Anonymous Coward · · Score: 0

      Feeling your pain on that one; in my case, those tend to be written by people whose opinions were considered and rejected by the higher-ups when the requirements were being done up, so they submit bug reports that amount to "I didn't get my way, but I'm still right!"

    31. Re:Huh? by hey! · · Score: 1

      I can't disagree more. Most programmers already know programming pretty well, and don't need their books on specific programming languages to be diluted with general programming instruction.


      Look at K&R. About the best goddam programming book ever. They got down to brass tacks right off the bat AND as a bonus they showed you how to be a better programmer. Not told you, showed you.

      Back in the day there were three other Kernighan books everybody had. The Unix Programming Environment, which showed you to to create Unix software, and Software Tools, which showed you how to make reusable software (Unix style) and Elements of Programming Style, which taught you how to express yourself in code.

      Each of these books was great, because it had a point and stuck to it. It didn't try to do all things for all people
      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    32. Re:Huh? by Iffy+Bonzoolie · · Score: 1

      The difference between the CS (non-engineering) degree and the EECS (engineering) degree with the software option at my school (UC Berkeley) was... 3 semesters of physics. There were a few other minor differences, but the CS curriculum was exactly the same.

      Other than what one may or may not have gotten out of those three basic (though admittedly very difficult) physics classes, I don't see how that engineering degree really taught better constrained problem solving - and it certainly didn't include more instruction on the domain.

      -If

      --
      Run a pencil-and-paper RPG campaign with your far-off friends: Gametable!
    33. Re:Huh? by chud67 · · Score: 1
      Every new programmer must learn to program in some language, but we certainly don't need a large variety of books that cater to people at that stage of proficiency - just one or two good ones.


      So what are one or two good ones that you would recommend?

  12. What the world _actually_ needs... by Anonymous Coward · · Score: 5, Insightful

    ... is more skilled programmers. I learn new languages from the language specification. Once you know how to write code in one language, and you actually _understand_ what you are doing, picking up a new language is easy.

    1. Re:What the world _actually_ needs... by pclminion · · Score: 1

      Once you know how to write code in one language, and you actually _understand_ what you are doing, picking up a new language is easy.

      No. Having a wealth of experience in C, Java, and Haskell (for instance) will do absolutely nothing to help you when you try to write a web server in BrainFuck.

    2. Re:What the world _actually_ needs... by Fahrenheit+450 · · Score: 1

      And, to be a bit less extreme, it's not even going to help you much if you move over to something like Prolog or Joy.

      --
      -30-
    3. Re:What the world _actually_ needs... by daVinci1980 · · Score: 1

      Pretty much the only thing that will help you with BrainFuck is an aneurysm.

      --
      I currently have no clever signature witicism to add here.
    4. Re:What the world _actually_ needs... by Miniluv · · Score: 1

      I'm not too worried about the collective Prolog and Joy production shops out there. While I'm sure somebody can point to more than 1 of each, and they're probably even doing cool shit, they're just not relevant examples.

      The parent's parent had a very good point in that a great many professional programmers lack the skills to elevate their game to that of developer. The world is worse off for this as well.

      I'm lucky enough to work with several guys who are genuine senior developers. I'm not a coder, but I've worked with quite a few and had to support code that ranged from beautiful to amazingly awful so I have some idea of where I speak. When a coder is lead on a project I make sure to spend a lot of time in the beginning making sure they have some concept of the real world that their app will be living and the needs of that world in terms of visibility and maintainability of their app.

      When a developer is lead on a project I try to hang around them as much as possible because their vision of how that app is going to work on its own as well as co-exist with the rest of our software world its really impressive and beautiful.

      These folks also learn protocols, languages, etc from the specs. They don't need someone holding their hand. Nothing wrong with folks who do need it, but I'd rather have the folks who don't writing my software.

  13. Hmmm, doesn't sound that good by philipdutre · · Score: 4, Informative

    Any Java book that starts with explaining statements, control structures etc. without first explaining what an object and a class is, does not sound very promising. In the CS educators community there is a movement towards an 'objects-first' approach in teaching JAVA, or more precisily, OOP using JAVA. Any book that typically starts with a 'hello world' program completely misses the point. First teach what an object is, what a class is, only then say something about how you can make these objects work together. This seems to be a much more fruitful approach in teaching students how to think OO, and then to put their ideas into any programming language, which happens to be JAVA in many cases. For a very good book to use in a programming 101 class, see 'Objects First With Java' by Barnes&Kolling (Prentice Hall; 3rd edition; June 2006)

    1. Re:Hmmm, doesn't sound that good by ggambett · · Score: 1

      If you do that, you get students very capable of designing complex class hierarchies who also don't know that "continue" exists, let alone what it does. True story. I was writing some pseudocode this last semester. Not one student, but practically all 30 of them, asked about it. At first I thought they were joking. Then I was at a loss for words. I'm talking 3rd year students here.

    2. Re:Hmmm, doesn't sound that good by Anonymous Coward · · Score: 0

      Why do you write Java in all caps ("JAVA")? Is it some weird Belgian thing?

    3. Re:Hmmm, doesn't sound that good by philipdutre · · Score: 1

      Yes, must be, I don't think about it, I've been doing it whole my life, also when I was working in the US. No-one ever compplained ;-)

    4. Re:Hmmm, doesn't sound that good by quintesse · · Score: 2, Insightful

      Yes and then they forget about the rest and you get situations like this (when asked to explain how a certain program works):

      Q: So, where does this program start?
      A: [no answer but a face which is one big question mark]

      Q: Well a program has to start somewhere doesn't it?
      A: It does?

      Q: Well somebody told you how a computer works, didn't they?
      A: Uhhh yeah

      Q: So they told you that a processor performs instructions one at a time?
      A: Yeah sorta

      Q: So that means it has got to start somewhere, doesn't it?
      A: Uhhhhuh

      So here I got a student that after 2 years knew how to design pretty class diagrams, could explain the meaning of inheritance, overloading, overriding, etc but basically didn't know that there is something like a program "flow"!

      So I'm sure that nowadays you should start with objects and classes real soon, but I still doubt the wisdom of doing it before having explained the more basic building blocks of any language.

    5. Re:Hmmm, doesn't sound that good by Bill+Dog · · Score: 2, Informative

      ...the wisdom of doing it before having explained the more basic building blocks of any language.

      But that's a big picture view, and if that's not against the actual, conceived spirit of Java, it seems to be of little interest to many its practitioners. More than for any other language community I've seen, Java folk are a generally insular bunch, think Java is all anyone really ever needs, and that knowing how things actually work are unimportant, you only need to know how to get something to work in Java.

      So for example when I was connecting a web service of mine to that of a Java team's here at work, when I asked them about something in the SOAP message (the interop of web services) from them, they started telling me about Java classes!
      "No, no, I just want to know what your web service is expecting for this field."
      "Well, in the Java code we..."
      "Okay, but I'm not connecting thru a Java interface, I'm using the web services interface."
      "Um, I can send you the Java code?"
      "(Arg.)"

      --
      Attention zealots and haters: 00100 00100
    6. Re:Hmmm, doesn't sound that good by serdagger · · Score: 2, Interesting

      I couldn't disagree more. Experts/educators in all disciplines are susceptible to falling into the trap of wanting to start with the fundamentals because that's what their (advanced) understanding is based on. It's that kind of thinking that led to the disastrous "new math" where set theory was taught before arithmetic. I even knew a physicist who wanted quantum mechanics taught in first year college courses as a build-up to Newtonian mechanics as a limiting case. This is wrong because we learn by doing, not by starting with theoretical fundamentals. We move on to that later to back-fill our knowledge. Starting with the theory sounds good, but name me one serious programmer (coder/developer/engineer/architect) who didn't first learn to program by tinkering, possibly using "Hello World" as a starting point.

  14. Not really by m4g02 · · Score: 3, Insightful

    "It's good to learn a programming language, but it's a far better thing to learn to write programs in that language. What the world needs are less programming language books and more books on programming with the language of your choice"

    Not really, I agree with Steve McConnell when in his book "Code Complete" (2nd edition) says that you shouldn't programm in a language but INTO a language.

    Most of the important programming principles not on an specific language but on the way one use them. Don't limit your programming thinking only on the concepts that are supported automatically by your language. The best programmers think of what they want to do, and then they assess how to accomplish their objectives with the programming tools at their disposal. (McConnell 843)

    --
    Sigs are for morons... Wait a minute...
  15. Continue is the "Devil" by Dareth · · Score: 1

    For a more indepth idea of what the continue keyword is see http://en.wikipedia.org/wiki/Continue_(Java)

    The first example of the use of continue made me want to cry!

    --

    I only look human.
    My mother is a halfling and my dad is an ogre, so that makes me an Ogreling
    1. Re:Continue is the "Devil" by Mattintosh · · Score: 4, Funny

      The first example of the use of continue made me want to cry!

      If you're not the baby Jesus, you don't count.

      Besides, continue is just a fancy way to do a break followed by a goto. Anything that keeps manual goto statements out of code is a good thing.

    2. Re:Continue is the "Devil" by Anonymous Coward · · Score: 1, Insightful

      Besides, continue is just a fancy way to do a break followed by a goto. Anything that keeps manual goto statements out of code is a good thing.

      Right, because goto's are ill-advised because they're spelled G-O-T-O, but if you have something that does essentially the same thing but uses a different name, then it's okay.

    3. Re:Continue is the "Devil" by Anonymous Coward · · Score: 0

      What's so terrible about the example?

    4. Re:Continue is the "Devil" by arevos · · Score: 1

      Right, because goto's are ill-advised because they're spelled G-O-T-O, but if you have something that does essentially the same thing but uses a different name, then it's okay.

      You could make the same argument about 'break'. However, whilst one can simulate the functionality of 'continue', or 'break', or even 'return' with goto, each of these keywords is significantly more specialised and limited in scope. Equating the disadvantages of goto with continue is just silly.

    5. Re:Continue is the "Devil" by mightybaldking · · Score: 1

      Continue is really not necessary at all.

      Print out all numbers from 1 - 10 except 7
      for (int i=1; i=10; i++)
      {
                if (i==7)
                          continue; // go to end of loop and continue with next iteration
                else // solely for clarity
                          System.out.println(i);
      }

      is in all ways equivalent to:

      for (int i=1; i=10; i++)
      {
                if (i!=7)
                        System.out.println(i);
      }

      if (condition) continue;

      can always be replaced with:
      if (!condition)
      { // code to "continue" over.
      }
      The cost is 1 layer of nesting, the benefit is a lot of clarity.

      I also feel the same way about break statements. If you need one, you should probably rewrite your loop conditions.

    6. Re:Continue is the "Devil" by arevos · · Score: 1

      The cost is 1 layer of nesting, the benefit is a lot of clarity. If you have a lot of nesting, and if your nested blocks are on the lengthy side, things can get unclear. Keywords like break and continue, and to a lesser extent return, are just optional syntactical sugar that can make code easier to read.
    7. Re:Continue is the "Devil" by mightybaldking · · Score: 1

      I disagree. If you are using an IDE that provides the option of collapsing blocks, then wrapping the code to be skipped actually makes the code easier to read.

      Otherwise, your continue/break is at the right hand side, which makes the flow hard to follow on a quick scan.

      Of course, if you have too many levels of nesting, maybe you should refactor and put some of that code in methods.

    8. Re:Continue is the "Devil" by arevos · · Score: 1

      I disagree. If you are using an IDE that provides the option of collapsing blocks, then wrapping the code to be skipped actually makes the code easier to read. Personal opinion :). I dislike collapsing blocks because you can't see all the code at a glance. I prefer being able to have a good overview of my code, so I tend to small, compact functions that will fit, more or less, on a single screen.

      Secondly, there are situations where a break is neater and more concise than ending the loop via a condition. Compare:

      continue_loop = true;
       
      for (i = 0; i < lambdas.length && continue_loop; i++) {
        try {
            lambdas[i]();
            continue_loop = false;
        }
        catch (e) {}
      }
      To:

      for (i = 0; i < lambdas.length; i++) {
        try {
            lambdas[i]();
            break;
        }
        catch (e) {}
      }
      Further, many languages have the notion of a foreach block, where one cannot introduce further conditions without resorting to a classic for loop. Compare:

      for (int i = 0; i < names.length || names[i] == rightName; i++);
      name = names[i];
      To:

      for (name : names)
          if (name == rightName) break;
      Finally, some languages don't even have a concept of a for-loop, so you have a choice between this:

      i = 0
      while i < len(names) or names[i] == rightName:
        i += 1
      name = names[i]
      Or this:

      for name in names:
        if name == rightName: break
      And with prototype.js, you can combine a the functionality of a filter and a map using a continue:

      $R(0, 10).map(function(x) {
          if (x % 2 == 0) throw $continue;
          return x * x
      }
      Okay, so you got me on the last one; it's an exception masquerading as a continue statement :)
  16. Java / Programming / Enlightenment by E++99 · · Score: 3, Funny
    As I alluded to in my opening remarks, this book takes the approach of trying to not only teach Java, but how to approach and actually write programs using Java.

    Yes, but what good is that if you don't know how to achieve enlightenment. Maybe what is really need is a book that teaches the Java language, AND how to go about the development process in a good way while using the Java language, AND how to achieve enlightenment while going about the development process in a good way while using the Java language. I mean, otherwise, what's the point? Or, on the other hand, maybe you just need a book that teaches Java.
  17. Diluted... by Anonymous Coward · · Score: 0

    Most programmers already know programming pretty well, and don't need their books on specific programming languages to be diluted with general programming instruction.

    Depressingly many programmers could benefit from reading a good, non language specific, book on the general principles of software design. In my experience there are quite a few people out there who manage to screw up even elementary aspects of writing a Java class. You would also do well to keep in mind that the author of a programming book has to cater to more than just old hands like you. These books are read by inexperienced people as well and dropping them some hints on how to do things properly isn't necessarily the waste of the authors time it seems to be to you. Also, most authors do try to structure their books in a way that enables experienced people to skip the 'basics' chapters.

  18. a different way of learning by angelwalkwithme · · Score: 2, Insightful

    I'm not trying to speak negatively about this particular book's contents, but just comment generally in response to a previous poster's reply. I think what we need less of is books that tell us how to use API's and control structures and logic as such. What we really need is a shift in the way we're taught to program in schools to mimic real world software creation. This book would more appropriately been titled "How to Program in Java" because development in the real world is quite different from just learning the language specifics. Software development is more about the deadlines you need to meet for the customers end and the balance between the most technical solutions and the most feasible ones. Essentially it's about the efficiency you complete a task given constraints of time and resource. We should stop writing books that just walkthrough different languages, and start teaching students in a way that places them in team projects and make them collaborate to complete projects. My undergrad school had only ONE class that was designed in this fashion, yet I would say that almost 100% of my work existence operates in this reality.

  19. Other Java books by LauraW · · Score: 2, Informative

    My current favorite Java programming book is Java Concurrency in Practice by Broan Goetz and others. It's not for beginners, but if you really want to understand how to write multi-threaded code in Java you need to read this book. Several times, probably, because it's a tricky subject.

    Other books I like for Java are Effective Java (though he needs to update it for Java 1.5) and Java Puzzlers.

    I don't know of any books that are good descriptions of the Java 1.5 features for experienced programmers. Some people like Thinking in Java, but it seems pretty wordy to me. I originally learned Java from Java in a Nutshell but it's been something like 8 years, so I don't know if the newer editions are any good.

    Disclaimer: some of the authors of these books are my co-workers, though I don't know them very well.

    1. Re:Other Java books by bartash · · Score: 1

      I just read Java Concurrency in Practice by Brian Goetz and I agree it is great. I also learned C from Russel Winder twenty years ago and he was a good teacher then, I expect he's even better now.

      --
      Read Epic the first RPG novel.
    2. Re:Other Java books by saurabh_dixit · · Score: 2, Insightful

      I am surprise nobody covered "Head First java". Its one of the best books to learn core java. Your fundamentals are clear once you read this one and moreover you won't sleep reading this book. One of the best books that i have seen on java.

    3. Re:Other Java books by macsuibhne · · Score: 1

      I learned C from Russel Winder as well. He was one of the better lecturers at UCL back in the day (I was there '83-'86). We must be near-contemporaries.

      --
      -- "Quis custodiet ipsos custodes?" -- Juvenal
  20. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  21. Mod Parent Up - Wise words by ObiWonKanblomi · · Score: 2, Interesting

    I'm finally glad to see some truly wise words, not to be mistaken for the more popular cynical opinion I see. I have experienced this myself. With that said, I would hope the title reviewed does focus on how, as you appropriately quote, "accomplish their objectives with the programming tools at their disposal".

  22. Underscores and HTML by pestie · · Score: 3, Funny

    You might want to check out this cool new markup language called "HTML" (hypertext markup language). It will allow you to bold or italicize words, thus obviating the need for surrounding words with underscore characters to indicate emphasis.

    Of course, if you're really 1337, you'll pretend you're on a terminal with non-destructive backspaces and use a construct like this^H^H^H^H____ for underlining.

    1. Re:Underscores and HTML by Anonymous Coward · · Score: 0

      Based on your website (http://www.bleeding-head.com/) I'm guessing you're still learning.

    2. Re:Underscores and HTML by Anonymous Coward · · Score: 0

      Ha ha, this is funny.

      You're criticizing him for using an *alternative* language (see I'm using it too, keep reading) which is more *lightweight* (typing a couple stars or underlines is more efficient than bracket, b, bracket, bracket, slash, b, bracket), more *reliable* (some blogs accept HTML, some don't, why should I have to figure it out), more *compatible* (you don't actually need to parse stars and underlines, the intent works fine in plain text), more *versatile* (there are programs like Markdown which will automatically convert this to HTML.. best of both worlds), and with a *longer history of usage*.

      And although there's really no advantage to the complexity of your solution, you feel a slight resentment that someone who is doing things an easier way and you want to "convert" them?

      So let me guess.. you're a Java programmer? Or maybe C++?

  23. StringBuffer, Hashtable/HashMap, Vector/ArrayList by DimGeo · · Score: 5, Insightful

    Learn the libraries to write fast code. Don't concatenate, use StringBuffer-s. Don't use buffer.append("a" + "b") - kinda defeats the purpose :) . Don't copy arrays to add an element, use Vector/ArrayLists. Don't do linear search, use Hashtable/HashMap. Don't insert into sorted arrays/vectors, use TreeSet. Don't search inside a Vector, use HashSet. Learn how to write objects that can be hashtable keys (i.e. they must have proper equals() and hashCode()). Learn how to write objects that can be used inside Tree-s (i.e. they must be Comparable-s that have proper equals() and compareTo()). Learn how to make objects sortable or implement Comparable correctly.

    Yeah, kinda basic but you will be amazed what kind of speed improvements you can get by learning these and using them whereever it is appropriate. With the proper data structure (most of them are already in the JDK) your app will fly.

    Oh, and don't redraw AWT/Swing like crazy. That's why the app is so slow. Learn how to use invokeLater to avoid deadlocks/bad data, etc.

    Learn how to synchronize properly with no deadlocks and what wait() and notify() are for.

    Learn char and byte streams and learn memory streams (ByteArrayInput/OutputStream, etc).

    Learn to love try-finally for dealing with streams.

    Learn to log.

    Learn by writing actual app code. Nothing beats that.

  24. Re: 5/10 by Anonymous Coward · · Score: 0
    the average rating for a book on a 1 to 10 scale should be 5.
    Perhaps the average review score should be 5/10, but it's not. Those who claim otherwise are in denial. Quick facts: The average for IMDB is usually somewhere between 6.7/10 and 6.8/10; currently it's 6.7. The average for all Netflix ratings is about a 3.6/5 (i.e. 6.85/10).

    6/10 means "this book/movie is crap"
    7/10 means "this book/movie is ok"
    8/10 means "this book/movie is actually worth readign/seeing"
  25. Learning Java by finkployd · · Score: 1

    As a c programmer trying to learn Java I grabbed a couple of books and looked at a lot of online tutorials. The one book that really "opened it up" for me was O'Reilly's "Java Network Programming". Mostly because I was not the least bit interested in writing GUI apps and every other "learn to program Java" book I found figured all you really want to do is learn to write an MS Paint clone. I understand having a real life example to teach concepts (and OO programming in general was hard for me at first) but I have a hard time getting into it if I am totally disinterested in the examples. Network Programming just seemed to present everything better and used examples that I could see relevance in.

    The way I learn now is by grabbing good code (various Apache java projects have a lot of good code in them) and reading it, while referencing Sun's online API docs.

    Just my $0.02

    Finkployd

  26. Re:StringBuffer, Hashtable/HashMap, Vector/ArrayLi by VGR · · Score: 2, Interesting

    You don't know as much as you think you know, especially about Strings. To begin with, I suggest you do some Google searches for the phrase "Premature optimization is the root of all evil." Now then...

    Don't concatenate, use StringBuffer-s.

    You don't seem to be aware that the following two lines are either identical, or so close to identical in their execution that you will never be able to discern the difference with any debugger or benchmark:

    System.out.println("The product of " + a + " and " + b + " is " + (a * b));
    System.out.println(new StringBuffer("The product of ").append(a).append(" and ").append(b).append(" is ").append(a * b));

    Details are here.

    It is true that in Java 1.0, StringBuffer was always the better way to concatenate. But that was over ten years ago. Modern Java programmers know you don't use StringBuffer unless you're doing frequent concatenations (such as inside a loop). And professional programmers know that readability and maintainability are way more important than saving a few cycles in some logging statement.

    Don't use buffer.append("a" + "b") - kinda defeats the purpose :) .

    Wrong. Concatenation of constants results in a single constant at compile time. In other words, the following lines will compile into byte-for-byte identical bytecode:

    System.out.println("Today" + ' ' + "is" + " December " + 13);
    System.out.println("Today is December 13");

    Feel free to try it for yourself if you don't believe me.

    --
    The Internet is full. Go away.
  27. Ditch Java and just use the C++ STL. by Anonymous Coward · · Score: 0

    You're correct, the key is to use libraries. But these days, Java is likely not the way to go. The Java class library is a mess, mostly due to Sun continually adding to it, while also retaining old classes for backwards compatibility. While they grafted some Java 5 features on (ie. generics), there are many places in Swing where static constants should be replaced with proper enumerations. Unfortunately, again due to backwards compatibility reasons Sun, can't do that.

    The C++ STL offers much the same functionality as the Java class library, but often in a more sensible fashion. Combine it with the Boost libraries, and you've got yourself virtually unlimited power. You can take advantage of high-performance native binaries. In addition, C++ is far more portable than Java. C++ can be used on systems that Java doesn't have a (recent or decent) port to, including UnixWare, FreeBSD, NetBSD, OpenBSD, and a host of other systems. Not having to have your users install a 15 MB Java runtime is also a major benefit.

    All major databases offer a C++ API. When it comes to GUI development, wxWidgets is fantastic, well-supported, portable, and frequently updated. You can also go with the excellent Qt framework, if you're willing to pay a bit (for commercial development). Apache puts out some high-quality XML parsing software. There are numerous networking libraries available for C++.

    In the end, Java offers little benefit over C++. With the addition of garbage collection to the upcoming C++ standard, there will be basically no advantage to using Java.

    1. Re:Ditch Java and just use the C++ STL. by DimGeo · · Score: 1

      One of the main benefits of Java over C++ is memory compacting. Though the newer memory managers for C++ do a great job at arranging the memory pieces in an efficient manner as to prevent severe fragmentation. You are right of course - stl is a great tool, and the others as well.

  28. Don't Do IT! by Anonymous Coward · · Score: 0
    For gods sake man, stay away from annotations. One giant incredible leap backwards. It's freak'n unbelievable. So lets put the SQL, and all the rest of the deployment details IN WITH THE BUSINESS OBJECTS. Yup, that's a great idea, like I'm sure the guy who writes the Java is ALSO the Database GURU, and if we tweak the database and want to to change a query, lets just EDIT THE JAVA AND RECOMPILE

    Insane. It's as bad as SQL jsp tags.

  29. Learn the fundamental principles first ... by ferespo · · Score: 3, Insightful
    And then choose a language and become proficient at it.

    In my University, I was taught general concepts: structures, recursion, iteration, abstractions, conditions, logic, programming paradigms, etc., never tied to a specific language. In fact, we used to use a pseudo-language to express solutions to problems.

    Real languages (Pascal, X86 assembler, basic, fortran, C, Java, C++, scheme, SQL) were used only in lab practices. It was pre-supposed that you already knew them or you had the basic concepts to learn them.

    Whenever I see that someone has been taught an specific language at the university (sometimes a whole semester!), I tend to think that this person will not be able to fullfil his/her position, because he/she has been taugth an specific technology instead of knowledge. It's like a doctor that has been taught how to operate certain medical device instead of how the human body works.

    Learn principles and then you'll be able to tell which language is the best at the job.

    And as a nice side effect, you'll always be able to catch up with whatever shows up in the ever changing madness of IT.

    1. Re:Learn the fundamental principles first ... by Shados · · Score: 1

      What you need is both. Schools that teach only the abstract stuff don't help their students anymore. Oh, big name schools are ok, because the companies hiring in there usualy have large ressources, and are used to "completing" the student's training, in a way.

      Elsewhere though? Learning language specific concepts is quite useful. You can later on "translate" them to another language.

      I'm not necessarly talking about a semester just teaching the language itself here, but more like learning the advanced, language specific stuff. Enterprise integration, caching strategies, environment configuration, etc. These DO translate from a language to another, if you understand them well. But no amount of theorical background helps you with that. Thats why so many places won't hire people without experience: You can have 5 years experience in Java software development (not just coding), and nail a job in .NET as a Senior developer. Have a master in computer science and no experience beyond the internships and summer jobs, and that master better damn come from MIT or whatever, else you're starting at the bottom of the chain.

      Its a kind of neither extremes are very useful. Knowing Java, .NET or Python upside down is useless if you freeze when someone asks you to implement a b-tree or a compression algorithm. Knowing every single theorical concept isn't all that useful either if you freeze when comes the time to write a make file. Bad examples, but you get the idea.

      Too many people seem to think that learning a language is just about learning if statements, loops, and object declarations. There's so much more to it than that.

  30. You exaggerate by ClosedSource · · Score: 1

    Most CS departments don't even own drums.

    1. Re:You exaggerate by itlurksbeneath · · Score: 1

      Ah.. True. Let me rephrase.

      I'm not a VB programmer, but I do know programming in general and some of the things they do would get them cat'ted to /dev/null.

      --
      Have you ever considered piracy? You'd make a wonderful Dread Pirate Roberts.
  31. BAH by ClosedSource · · Score: 1

    Markup languages are just file formats with delusions of grandeur.

  32. Re: int vs Integer by psyclone · · Score: 1
    Third, using Integer opens you to NullPointerExceptions

    Exactly why I use Integer over int in most cases. With int, you cannot have an undefined value, with Integer you can. Sometimes, the int/Integer may be optional. If there is data there (!= null) I can use it, else I won't. With an int, you can't do that check, it is always defined.

    So, like most programming decisions, it all depends on your needs.

  33. My first thought ... by jc42 · · Score: 1

    "It's good to learn a programming language, but it's a far better thing to learn to write programs in that language.

    And more important than either of these is to be able to successfully modify programs in that language.

    Very few of the jobs I've had in several decades of working as a programmer involved writing programs. Far more of the jobs in the real world consist of modifying a program that already exists, either to correct bugs or to add new features. This requires a very different set of tools and talents than developing the software from scratch.

    Another way of expressing it is that we rarely actually write programs. Rather, we usually modify programs. And we do this with code that wasn't designed or developed to make modifications easy.

    Let's face it; designing is easy. At least, the sort of design that typically comes out of all the methodological fads is easy. That's why people write so many books about it. But they hardly ever tackle the difficult part of programming, which is taking the results of a design and making it actually do what is now needed, which is slightly different from what was needed back then.

    And java is one of the languages where the implementation of the design isn't usually done well. As with C++, designers think that their good design will make it all work. When it doesn't, perhaps because the task has changed, and the designers have moved on, the programmers are stuck with trying to make sense of what is often write-only code. It isn't documented, because you don't need that with a good design, right? And code in these languages usually have the property that no line can be understood by itself, because of all the things that are defined elsewhere. And those definitions can't be understood by themselves, because they use things defined elsewhere. Making even the simplest change usually requires a full understanding of every line of the program, because everything depends on everything else.

    Maybe some day someone will write a good book on how to modify existing code successfully, without introducing more bugs than were there when you started. This is the really major technical advance that still seems over the horizon, even after decades of mostly bad experience with hacking other people's code.

    (One of the most successful techniques I've stumbled across consists of constantly asking myself "What would I like this to look like when I come across it N years from now and want to make a few small changes?" You might be surprised by some of the common mistakes that this helps you avoid. And I've often been happy that I did that, N years after I wrote something. ;-)

    --
    Those who do study history are doomed to stand helplessly by while everyone else repeats it.
  34. Grammar nazi by slim · · Score: 1

    What the world needs are less programming language books... Ouch!

    What the world needs is fewer programming language books.

    I didn't want to get all Lynn Truss on the lad, but hey, if he can be picky about typography, I can be picky about grammar.
    1. Re:Grammar nazi by cradle · · Score: 1

      That jumped out at me, too, but I can't decide whether to s/is/are/. I suppose "What the world needs" is indeed singular.

      Speaking of Lynne Truss, have you read this delightful review of her book?

          http://www.newyorker.com/critics/books/articles/04 0628crbo_books1?040628crbo_books1

      -David

  35. Re: 5/10 by lee7guy · · Score: 1

    And the culprits are including both user reviews and reviews by professionals, where you would expect the quality of grades being better.

    One scandinavian photo magazine, using 1 - 10 grades is actually so bad that you actually have to recalculate the grades. The grades almost always land in the 5 - 10 range, where 5 would mean utter crap. One pretty effective way of dealing with this is to subtract 5 from the original grade and use the result as a grade in the range 1 to 5. So far this "tactic" has worked pretty well.

    One obvious reason for magazines and such not giving too low grades are the dependancy of manufacturers actually sending them stuff to review.

    --
    Ceterum censeo Microsoftem esse delendam
  36. Re:StringBuffer, Hashtable/HashMap, Vector/ArrayLi by DimGeo · · Score: 1

    I'm not talking about this case, of course. I'm talking about generating a 1 mb XML file, for instance. :)

    As for "a" + "b" being evaluated in compile time - yes, but this isn't: (String)myArray.elementAt(i) + " at " + i.

    See? I know :) I said: learn about it. Don't memorize, learn.

  37. Forgot to mention by DimGeo · · Score: 1

    Actually, System.out.println("The product of " + a + " and " + b + " is " + (a * b)); compiles as System.out.println(new StringBuffer("The product of ").append(a).append(" and ").append(b).append(" is ").append(a * b));

    Use StringBuffers or memory streams to build large bodies of text. Use concatenation for dumps / logs / UI (sometimes if you generate 100 UI items via concatenation, it's better to use a StringBuffer and call setLength(0) at the beginning of the loop). Seemed obvious when I was writing the original post.

  38. Re:StringBuffer, Hashtable/HashMap, Vector/ArrayLi by dave1791 · · Score: 1

    ohhhh.... a budding flamewar over the best way to do string handling in Java!!!

    *gets out popcorn and settles in to watch*

  39. Re:StringBuffer, Hashtable/HashMap, Vector/ArrayLi by lightversusdark · · Score: 2, Insightful

    And don't forget about StringBuilder
    Do you really need thread-safe access to your buffer?
    Every little helps.

    --
    "There is nothing nice about Steve Jobs and nothing evil about Bill Gates." - Chuck Peddle
  40. Re:StringBuffer, Hashtable/HashMap, Vector/ArrayLi by DimGeo · · Score: 1

    They required us once to use 1.1-compatible libraries (in an OSGI company), so that's stuck in my mind, but yes, you're right of course :) .