9

The Pragmatic Programmer is highly recommended by many people. I've just finished reading it, and I can see why people recommend it, although I would point out that Code Complete covers almost all of the same material in much more depth.

However, one thing that bugged me was the way the authors never mentioned any downsides of flexibility, generalising, and leaving room for future development. Those concepts are all very good, but what happened to the principle of YAGNI (You Ain't Gonna Need It), which prevents developers wasting their time implementing flexibility that's never going to be used?

A search of SO reveals 400 questions about YAGNI, so I doubt the concept was too obscure for the authors. I am, of course, nowhere near as experienced as them, so why didn't they mention any use of restraint throughout the book?

Thanks.

Community
  • 1
  • 1
Dijkstra
  • 2,490
  • 3
  • 21
  • 35
  • 2
    You really would have to ask them, though I would guess that the reason is that saying YAGNI doesn't sell books. – Oded Jul 31 '10 at 16:27

3 Answers3

2

They don't call it YAGNI, but there is keyword on page 11 that has at least the the same focus:

Know When to stop!

Doc Brown
  • 19,739
  • 7
  • 52
  • 88
  • 2
    I don't think that's really the same thing though. Knowing when to stop fiddling with your code is different from knowing when not to design excessive flexibility into the system. Maybe I'm confused as to what YAGNI is about though. – Dijkstra Jul 31 '10 at 16:53
  • I can only guess if Hunt & Thomas had "YAGNI" in mind when they wrote that passage, but I have the strong feeling their intention was in the same direction. – Doc Brown Jul 31 '10 at 21:54
0

[YAGNI] prevents developers wasting their time implementing flexibility that's never going to be used

Implementing flexibility doesn't necessarily take more time. In my experience it is something that can (and should) be part of your natural programming style. IMHO code that is inflexible is generally due to poor programming practices.

cdiggins
  • 17,602
  • 7
  • 105
  • 102
0

They didn't forget. I think the book just predates YAGNI becoming well known.

kirk.burleson
  • 1,211
  • 2
  • 18
  • 29