On Mon, May 15, 2017 at 6:56 AM, Erik Bray <erik.m.b...@gmail.com> wrote: [...] > In PEP-8, Python's style guide for Python code, there's an admonition > right at the beginning titled "A Foolish Consistency is the Hobgoblin > of Little Minds" (the wording is tongue-in-cheek; don't take it > literally!): https://www.python.org/dev/peps/pep-0008/#id15 > > The point is that no matter how well motivated a coding guideline is > it's just that--a guideline (maybe even a very important one!). But > one never bend over backwards to write non-idiomatic, convoluted, or > not well-motivated code just to satisfy a guideline. The guideline > should absolute be *considered* strictly when reviewing some code, > especially if it's critical mathematical code (in the case of Sage). > But that doesn't mean there will never be exceptions where one can't > use their common sense.
+1, but... <ancient history> The reason for the "100% doctest policy" is because in 2007 during a discussion at Sage Days 5 (see [1]) Craig Citro proposed "We should require 100% doctesting in new code". Many other people in the room and I thought this sounded like a good idea and interesting challenge, since Sage was starting to rapidly grow at the time. I wrote a coverage script to see where we stood and it was fun to include the stats with each new release. The stats are *very* impressive to me today: ~/sage/src/sage$ ../../sage -coverage --summary . Global score: 96.1% (42697 of 44428) We quickly started realizing how incredibly useful Craig's suggestion was in practice, and that it was clearly going to be absolutely critical to growing our developer base beyond a handful of people. Also, being able to take absolutely any function in the code, and paste something into the sage: prompt that interactively exercised that function was also very useful. Moreover, it was shocking the extent to which anybody touching since matrices over the rationals could easily break something else "far away" in modular forms (heh -- it happened today! [2])... The only serious challenge to this policy that I recall was when Michael Abshoff merged a massive amount of non-doctested quadratic forms code from Jon Hanke in 2008. I was pretty annoyed and ensured that the code was properly tested in a timely manner. </ancient history> - William [1] https://wiki.sagemath.org/days5 [2] https://groups.google.com/forum/#!topic/sage-devel/7VpAxhycBe0 -- William (http://wstein.org) -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.