dsdshcym / dsdshcym.github.io

https://yiming.dev/
1 stars 1 forks source link

"A Philosophy of Software Design" by John Ousterhout - Yiming Chen #10

Open utterances-bot opened 5 years ago

utterances-bot commented 5 years ago

"A Philosophy of Software Design" by John Ousterhout - Yiming Chen

undefined

https://yiming.dev/clipping/2019/01/27/a-philosophy-of-software-design-by-john-ousterhout/

pennadev commented 5 years ago

Sandi Metz is saying everything John Ousterhout says not to do. Following random heuristics like lines of code per structure is NOT pushing code to "deeper" structure, it pushes code to a shallow one. Did you even listen to his talk at google or read his book? How did you get it so backwards?

dsdshcym commented 5 years ago

@pennadev Thank you so much for pointing out this!!!

Following random heuristics like lines of code per structure is NOT pushing code to "deeper" structure, it pushes code to a shallow one.

Yes, you are right. I would come to the same conclusion if I re-read this post again.

How did you get it so backwards?

I think it was my bad not explaining the connections well. I wanted to say "when a class reaches 100 LoC, we check if this class is deep or shallow." From my personal experience, huge classes often have a lot of public methods, but few private methods, which make them shallow.

But still, like you said, "following heuristics" is not a good strategy. Understanding the values behind these heuristics (deep vs. shallow) is what we should do. This is also why this talk and this book are so valuable.