The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Effective coding (books)

Quick question:

Most tech books are either references, recaps of the same language semantics, or design/management discussions. I enjoy the latter ones a lot, but it doesn't greatly improve my code, but rather the processes. Bloch's "Effective Java" is an excellent coding book in the same league as Meyer's C++ versions. Does anyone know any other gems with the same focus? (for me, that mostly means in the Java world)
Friday, June 02, 2006
Most of what the books can teach you will be your coding process, and not the actual code. I happen to like Code Complete. It's chalk full of examples, but at the same time talks at a level of abstraction that helps you improve the way you think about coding rather than nitpick a few common mistakes.

Looking up a function call or finding the correct calls for a decent algorithm in a specific language is something I find you can generally google, where as designing the algorithm or cohesion of a part of your program is more language independant and can be taught easily by books.
Josh McFarlane Send private email
Friday, June 02, 2006
The books I mentioned are not about how to use a library, but rather common pitfalls and poor idioms used in production code. For example, why inheritence breaks encapsulation is an excellent example, while more mundane but important ones might include how to properly maintain the contract when overriding .equals() or using StringBuffer to concatinate Strings.
Friday, June 02, 2006
I think that I am not sure what your question is because I think Josh's answer is a good one and your response kind of seems to think it isn't.

"I enjoy the latter ones a lot, but it doesn't greatly improve my code, but rather the processes"

What I guess is difficult to understand is what you mean by improving your code?  To me, that almost entirely boils down to readability.  That is the best improvement I can make and usually by making the code functions (not to mention debugs better).

Here is an example, I used to do this a lot:
if (blah)

I would occasional need to do something else with the if and think geez, why didn't I block that when I had the chance.  In other words:

if (blah)

That is one recommendation in Code Complete that for me was like of course, dummy, do that every time... there is no reason not to, it is easier to read, makes it less likely to make a mistake, and saves time (because at the very least you will likely add test code at some point which will make you put a defined block.

But I don't know if that is what you are looking for.

Maybe by improved code you mean performance.

Or optimization.

Or shrinking lines of code.

or whatever else I don't know.
Mark Flory Send private email
Friday, June 02, 2006
Sorry if I was too vague, and both you and Josh are right about Code Complete. I should have focused more on that paragraph than the second, since its close and a very good suggestion. I'm sorry for not acknowlodging it earlier.

What I had meant to ask a bit different than regarding style or references. My meaning of processes was oriented towards XP, design patterns, etc. What I was thinking of was a genre that fits between Code Complete and higher-level design. Something that is willing to not be language agnostic, but whose tips can be carried over.

I guess the best way to say it is that I am looking for books that make you a better developer in a particular language. Most Java/C++/etc books try to get you up to speed in a certain subset, sometimes in a problem class (e.g. concurrency) or a particular implementation. What is hard to find, though, are books that cut across the language to improve your code, improve maintainability, and save you from common mistakes.

In the Java book I mentioned, an item was regarding overriding equals(). That's not uncommon to see, but most people don't abide by the contract nor do they also override hashCode. That can create hard to find bugs when invalid results are returned by support libraries. A more abstract example would be to favor static factory methods over constructors. That advise can be brought over to another language, like C#.

The result is a lot of useful knowledge to both make you better at raw coding and in that particular language. Most books that I find either focus too narrowly or too broadly and a very few hit that sweet spot.

(Sorry about the length, but I hope that clarifies my question. Thanks!)
Saturday, June 03, 2006
Most Java books are total dreck.

I agree with you about Josh Bloch's "Effective Java", though. It's one of my favorites. You might also be interested in his "Java Puzzlers" book:

But for the most part (even though I'm a Java programmer) I don't read many Java books. I really like "Algorithms in C++", by Robert Sedgewick:

*Everything* in that book is completely applicable to Java programmers. At least, to Java programmers who are more interested in algorithmic code than in working with web frameworks and writing CRUD apps.

I'm currently reading "The C Programming Language" by Kernigan & Ritchie. It's not *directly* related to Java, but I think it provides some important background and history with respect to computing in general.

I also really like "Machine Learning" by Tom Mitchell:

And "AI Application Programming" by Tim Jones:

In the software-engineering world, I think "Design Patterns" and "Core J2EE Patterns" are both valuable books. Just don't read them as though they're some sort of gospel truth. Design patterns are just handy, repeatable techniques for designing software systems. They're certainly not sacred. (And the books describing them are often ridiculously boring.)

I also like to read books about other technical (non-programming) topics. Right now I'm reading "The (Mis)Behavior of Markets" by Benoit Mandelbrot:

Some of my other previous favorites are "The Man Who Loved Only Numbers" by Paul Hoffman:

...and "Prime Obsession: Bernhard Riemann and the Greatest Unsolved Problem in Mathematics" by John Derbyshire:

If you're at all interested in natural language processing or computational linguistics, you ***HAVE*** to read "The Language Instinct" by Steven Pinker:

Other books on my to-read-list (all of which will, I think, make me a more valuable programmer in the long run):

* "Godel Escher Bach" by Douglas R. Hofstadter

* "The Lady Tasting Tea: How Statistics Revolutionized Science in the Twentieth Century" by David Salsburg

* "The Java Virtual Machine Specification" by Lindholm & Yellin

* "Society of Mind" by Marvin Minsky

* "Approximation Algorithms for NP-Hard Problems" by Dorit Hochbaum

* "Concurrent Programming in Java" by Doug Lea

* "Inside Microsoft .NET IL Assembler " by Serge Lidin

I also read a lot of economics and politics. My favorite authors in those genres are Harry S. Dent, Alan M. Dershowitz, Noam Chomsky, Bill Moyers, and Robert M. Pirsig.

Anyhow, sorry for the overwhelming list of books and links. But I passionately believe that there's more to being a great software developer than just keeping up on the latest "How to Learn JAXP in 24 Hours" books. Blah.
BenjiSmith Send private email
Sunday, June 04, 2006
Thanks BenjiSmith! I'll probably go dig through a couple of 'em.
Sunday, June 04, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz