3 ms·
I don't think you can make comparisons like that and feel good about them. I certainly believe that there are 20 line programs which are harder to reason about
by tel 12y ago
I don't think you can make comparisons like that and feel good about them.
I certainly believe that there are 20 line programs which are harder to reason about than some 1000 line programs with types. That's a big silly, though, I'd believe the same even without the "with types" caveat.
So, here's what I believe:
* Types impose logical structure on programs which is continuously
checked, high-level, and very human interpretable
* All things being equal, shorter programs are easier to comprehend
than longer programs
* If I were to list the things which aid program comprehensibility
then types + most of the things on the list in this blog post
actually go *far* higher on that list than "short length"
(Edit: I should add, given what came after this point, that "all things being equal" above is, in my eyes, a very difficult hypothesis to satisfy.)
- geocar 12y ago> I don't think you can make comparisons like that and feel good about them. I think most professional programmers could write a relational database in under 1000 lines. Arthur did SQL92 in 20: http://web.archive.org/web/20060505221834/http://kx.com/q/e/s.k http://web.archive.org/web/20060505221834/http://kx.com/q/e/... I think this example is perfectly illustrated: I find it more valuable than anything else I have found to have the entire program all on one screen. > If I were to list the things which aid program comprehensibility then types + most of the things on the list in this blog post actually go far higher on that list than "short length" I think there are so many useful and successful applications that "use types" and so many useful and successful applications that do not "use types" that types are probably irrelevant for success. That many of those useful and successful programs are very large suggests that size has very little (or nothing at all) to do with success. But comprehensibility? I cannot imagine what universe would have a large program as being "easier to comprehend" than a short program.
- tel 12y ago> I find it more valuable than anything else I have found to have the entire program all on one screen. Then we'll merely have to agree to disagree. I personally think this example is remarkable levels of incomprehensible. I'm not going to claim that my personal opinion has any level of generality, though. More power to you if that page of code is easy to comprehend. > I think there are so many useful and successful applications that "use types" and so many useful and successful applications that do not "use types" that types are probably irrelevant for success. The existence of examples both positive and negative is insufficient to demonstrate that some cause has no effect. You might strengthen that to say that in your experience the use of types has zero correlation with "useful and successful". I think with a little qualification there we could again get to a point where we'd merely have to agree to disagree. It's also vital to point out the selection bias incurred by either of our experiences. > I cannot imagine what universe would have a large program as being "easier to comprehend" than a short program. I could try to demonstrate examples of both, but it'd just be my opinion as to that selection. So, instead of trying to be comprehensible, I'll just state for posterity: Offhand, I believe it would be very easy to write a 1000 line (or even larger) implementation of SQL92 which I would find to be far more comprehensible than the example you've linked. In particular, I believe in this case that attempting to make that code fit on one page is a significant detriment to its comprehensibility. And again, I'm not going to try to convince you but merely state that as the fact of my opinion.
- icefox 12y ago> I think most professional programmers could write a relational database in under 1000 lines. Arthur did SQL92 in 20: > http://web.archive.org/web/20060505221834/http://kx.com/q/e/.. http://web.archive.org/web/20060505221834/http://kx.com/q/e/.... I can make any program only 1 line long if I remove all the newlines. I don't care if a program fits on one screen if it is unreadable. The example you cite is a poor example of a valuable program as it is on purpose made to be difficult to reason about.