review for unittests
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Sat Jan 29 22:10:29 PST 2011
On 01/29/2011 09:48 PM, Jonathan M Davis wrote:
> You mean 80 lines of code in the examples or in the actual code? I'm fine with 80
> columns for examples, but I'll go insane if we start requiring 80 columns for
> normal code. That starts getting restrictive and ugly _really_ fast.
Yes, once you go beyond 80 columns.
> You're
> quickly forced to put the next part of a statement on the next line just because
> you're hitting the 80 character limit instead of properly lining things up, and
> it makes them much harder to read.
When Gutenberg built the first press, the resolution and the coarseness
of the paper forced him to make the sheets pretty large. Since then the
resolution of printing has increased amazingly, but people quickly
figured out that reading is seriously impaired if the layout has more
than about ten words per row of text. So in the hundreds of years that
people have had available for improving printing media, the ten words
pattern has stayed put. It's a human constant.
Such a measure definitely to code, too. 80 columns should be enough for
writing and reading meaningful code. Lines that go significantly beyond
that limit have an intrinsic readability problem.
> As for the documentation, I made sure that the examples fit in the grey code
> boxes, and that's what I was aiming for. If that doesn't do it and restricting
> them to 80 columns does, then I'll do that.
They don't fit on my screen.
> I'll make another pass at at the documentation and see if I can hit a better
> balance between too little explanation and not enough. In fact, I think that
> I'll just merge it into std.exception (since you seemed to think that that would
> be the place to put it) and post what it would then look like once put into
> Phobos (since doing stuff like putting assertPred documentation in the module
> comment would affect the module as a whole and std.exception obviously already
> has stuff in it). I'll take care of that and get it up within the next few days.
Yes, please integrate with std.exception. For the documentation: all you
need is take your initial examples and make them compilable. Otherwise
they were perfect.
Thanks,
Andrei
More information about the Digitalmars-d
mailing list