Hacker News new | past | comments | ask | show | jobs | submit login

Does Ousterhout actually say modules must always have a longer implementation than their spec, or just that this is a generally desirable feature?

If he did, I agree with you, he was wrong about that. I also agree that the unix file API is probably not a good example.

But whether or not he did, I think the dissection of edge cases would be better off emphasizing that he's got something importantly right that goes against the typical "small modules" dogma. All else being equal, deeper modules are good--making too many overly small modules creates excessive integration points and reduces the advantages of modularity.

P.S. While I'm here, this is not really in response to the parent post, but the example in the article really does not do justice to Ousterhout's idea. While he does advocate sometimes just inlining code and criticizes the pervasive idea that you should shorten any method of more than n lines, the idea of deep modules involves more than just inlinining code.




I'd say he's in between — he strongly recommends that most modules be "deep."

I agree that blindly making lots of tiny things is bad, but his criteria for how to chunk modules is flawed.


> Does Ousterhout actually say modules must always have a longer implementation than their spec, or just that this is a generally desirable feature?

I mean the spec is a lower bound on the size of the solution, right? Because if the solution were shorter than the spec, you could just use the solution as the new shorter spec.


Not necessarily. The implementation is very often more defined than the specific. If the implementation is the spec, then it means that even the smallest change in behavior may break callers.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: