“Peyton Jones: Sometimes to say that it's obviously right doesn't mean that you can see that it's right without any mental scaffolding. It may be that you need to be told an insight to figure out why it's right. If you look at the code for an AVL tree, if you didn't know what it was trying to achieve, you really wouldn't have a clue why those rotations were taking place. But once you know the invariant that it's maintaining, you can see, ah, if we maintain that invariant then we'll get log lookup time. And then you look at each line of code and you say, “Ah, yes, it maintains the invariant.” So the invariant is the thing that gave you the insight to say, “Oh, it's obviously right.” I agree completely that just looking at the bare code may not be enough. And it's not a characteristic, I think, of beautiful code, that you should be able to just look at the bare code and see why it's right. You may need to be told why. But after you have that, now with that viewpoint, that invariant, that understanding of what's going on, you can see, oh yeah, that's right.”
―
Coders at Work: Reflections on the Craft of Programming
Share this quote:
Friends Who Liked This Quote
To see what your friends thought of this quote, please sign up!
0 likes
All Members Who Liked This Quote
None yet!
This Quote Is From

5,347 ratings, average rating, 284 reviews
Open Preview
Browse By Tag
- love (100947)
- life (78978)
- inspirational (75539)
- humor (44230)
- philosophy (30805)
- inspirational-quotes (28701)
- god (26815)
- truth (24628)
- wisdom (24454)
- romance (24271)
- poetry (23106)
- life-lessons (22507)
- quotes (20908)
- death (20490)
- happiness (18908)
- hope (18453)
- faith (18289)
- inspiration (17225)
- travel (16871)
- spirituality (15628)
- relationships (15431)
- religion (15353)
- motivational (15238)
- life-quotes (15207)
- love-quotes (15044)
- writing (14906)
- success (14151)
- motivation (13096)
- time (12807)
- science (12042)