Did the authors of The Pragmatic Programmer forget about YAGNI?
Asked Answered
X

3

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.

Xeniaxeno answered 31/7, 2010 at 16:23 Comment(1)
You really would have to ask them, though I would guess that the reason is that saying YAGNI doesn't sell books.Shoreline
L
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!

Loutitia answered 31/7, 2010 at 16:35 Comment(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.Xeniaxeno
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.Loutitia
M
0

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

Mecham answered 31/7, 2010 at 16:59 Comment(0)
T
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.

Tanah answered 10/1, 2013 at 17:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.