views:

725

answers:

10

Someone asked What is a Wrapper? and it got me thinking - where would I point a new developer in search of some foundational description of useful patterns?

The GoF book has long been a foundational part of the canon for OO programming, and all of us at one time or another have benefited from the descriptions of common patterns there.

But I've found that many of the patterns there are nichey or - i hesitate to say it - sort of irrelevant. The focus in that book was heavily on OO design as it pertained to UI, in particular "fat client" UI. Many of the patterns pertain to edge cases that are rare even within that limited domain.

Without intending to stir up too much controversy, I'd like to know if you think there is a need for a revised foundational patterns book.

I know about PEAA by Fowler. Here again, sort of nichey. If you are not in the enterprise, and you are not building fat-client UI, that is to say if you are in the vast majority of programmers today, these books miss the mark. If you are building web2.0 apps in ruby or perl or python or even ASP.NET MVC, what is your concise source for advice on patterns? do you even care about patterns?

What I am looking for is something more general and foundational, I guess, than either GoF or PEAA. Something that would describe what a Wrapper and Proxy are, without referring to UI or an ESB. A reference that would eliminate discussion of obscure and rarely used patterns and really focus on the most useful and general ones, with concrete examples relevant to today's app styles.

Is it even possible to author a book that would achieve those goals? Maybe it is not a book, but more of a ~16-page paper?

I know there have been wiki efforts at those sorts of things, the c2 repository being one. But I suggest that the old ways - printed books - are sometimes the best ways, especially when we're dealing with foundational tenets that change slowly if at all.

Is there something like this out there? If it does not exist, is it even possible to provide it? What would YOU recommend to a new programmer interested in learning about patterns?

+2  A: 

I don't think so. There are plenty of websites and other online resources for this topic.

Jay Riggs
yet, sometimes I just want hardcopy... threat of electrocution for reading computer on the can is just not worth it.
Matthew Whited
When the boss isn't looking, print them off and stick 'em in a binder :)
SnOrfus
@Matthew: Print media is so 20th century! I actually agree with your preference for books in many circumstances (I really liked your example!) but I doubt it's possible to write a 'canonical' book on the topic. Aren't there many example of books where authors have tried to do this?
Jay Riggs
+20  A: 

I personally found great use out of the Head First: Design Patterns book. It may not go as completely in depth as one would like out of a canonical tome, but it is definitely something that could get use not only from complete beginners to the subject, but also to more advanced users looking for a refresher.

TheTXI
agree++ on the Head First book.
Jekke
I agree, this book is very approachable for anyone looking to grasp the basics of design patterns.
ebrown
Great book! Could not recommend it enough.
KG
Another great book is Design Patterns Explained by Alan Shalloway and James Trott.
David Yancey
A: 

We don't need more "patterns", we need better languages. If patterns unrelated to the problem domain are appearing in code, that means insufficient abstraction is being used. If the language is too weak to support better abstractions (PHP, C++, C#, Java are common examples) then it ought to be replaced with a superior language. Documenting mistakes doesn't fix them.

John Millikin
Please don't put C# in the same bandwagon with PHP, C++ and Java. C# is not in the same language class with the prior mentioned languages, it's order of magnitudes better at supporting higher level abstractions than any of them. C# (at least 3.0) is closer to Python than it C++ as far as the abstraction level goes.
Pop Catalin
Also, preaching Paul Graham isn't helping anyone who actually develops software for a living.
SnOrfus
@Pop Catalin: Please don't put C++ in the same bandwagon with PHP and Java. C++ is orders of magnitude better at creating high-level abstractions of low-level operations than either of them. C++ (at least C++0x) is closer to God than it is to Java.
Shog9
You can get awfully abstract in C++, or any other language where you can write Turing-complete programs to generate code for the compiler. It may not be easy, of course. That aside, it isn't clear to me that a perfect computer language would be without idioms or patterns.
David Thornley
I agree with John to an extent. Explicit design patterns exist beyond the limit of a language's available abstractions. If a language requires many sometimes-convoluted patterns to use correctly, it might be a sign that abstractions built into the language are simply not powerful. Of course languages can be useful regardless of how many patterns you need to implement a program right (sometimes you need pointer arithmetic!), but there is something to be said for the conceptual simplicity of higher-order languages here.
Gracenotes
+4  A: 

While I find certain books useful and maintain an extensive library of software engineering related books, the majority of my research takes place online because it's far simpler.

I'm a strong advocate for free knowledge and books tend to cost money which can inhibit the spread of important or need-to-know information. I think an online interactive learning environment might be more useful when it comes to a skill set like programming.

Doomspork
I agree, wikipedia is an excellent reference on patterns for me. http://en.wikipedia.org/wiki/Design_pattern_(computer_science)
Kekoa
One problem I have found is that on the wikipedia pages the explanation is not very good for a beginner. Sure it will explain its uses and how to code it in a variety of languages, but it doesn't do as well in terms of bringing someone up from novice to advanced usage. That's one thing I like design pattern books which focus on novice users for.
TheTXI
@TheTXI: the WP topics do tend to steer clear of some of the problems the OP calls out though (excessive focus on UI examples for instance). Might require more research from a beginner, but at the same time give him a better chance of understanding the pattern itself (vs. a single implementation + usage scenario).
Shog9
+2  A: 

I've seen a lot of patterns books. The examples of Design Patterns may have examples that correspond to UI, but the patterns really are more abstract than that. The Proxy pattern is very universal. The Adapter or Wrapper pattern is universal as well.

I think it would always be useful to have additional books that go into more depth than what the GoF book does. I don't see a need to make the patterns themselves more general, but perhaps others can explain it more clearly.

Kekoa
I agree that some of the GoF patterns are very universal.
Cheeso
+1  A: 

Have you taken a look at POSA 1-5? The patterns community compiled a bunch of different patterns across a few books called Pattern-Oriented Software Architecture.

If you're looking for an introduction to patterns, Head-First Design Patterns is really good.

Ball
+3  A: 

I doubt we need more books on Design Patterns. We just need to be aware that the knowledge available in the field of software construction is immense. I could easily rattle off twenty titles I think every developer should read and another thirty specific to what I do.

It simply take a while to absorb it all. So, it's not unreasonable for a developer who's been in the field for years to be missing certain concepts widely considered fundamental, like what a wrapper is.

Jekke
The "What is a Wrapper" question came from a new user, I'd guess. I'm not suggesting it's a bad question. It's a fine question. It got me thinking - what other patterns that I consider "basic" does this person not know about? And where would I point him to provide that basis?
Cheeso
+1  A: 

The GoF book is a patterns catalogue, and as such is not a book about learning design patterns. In that light, there are more patterns catalogues in existence beyond the GoF book, some of which are for particular problem domains (like PoEAA) and others are general catalogues for all problem domains (like GoF).

A list of some catalogues exists here.

SnOrfus
+2  A: 

In terms of newer books, I'd probably suggest taking looking at Design Patterns Explained by Shalloway and Trott. A number of my colleagues have spoken well of that book.

Although I do agree that the GOF book was a catalogue, the biggest contribution of that book was that it gave developers a common language to use to describe techniques that were being used at the time. Its hard to convey the significance of that now, but it really was an 'ah ha!' moment bac then.

JayL
A: 

The C2 Wiki is an excellent reference for patterns that is far more use-case agnostic than GoF or Martin Fowler's PEAA. A good place to start on C2 is the pattern index.

Paul Morie