News for hackers. Stuff that matters.
Re:Pyret: A new programming language from the creators of Ra... by tel on Saturday November 09, 2013 @07:50PM (#6704435)
I agree with you in that managing real code in a place that gets less frequently executed is a bear, but I wanted to emphasize the value of having tests very near to the primary documentation for a function. That's a complete win, I feel.
Re:Pyret: A new programming language from the creators of Ra... by sitkack on Sunday November 10, 2013 @11:25AM (#6707082)
Which it totally is! That is why all the functions I test are in pairs suitable for nose or py.test

    def test_foo():
        assert False, "test code for foo"

    def foo(farb):
        pass
Tests should absolutely be next to the code. The test should make it into the documentation. Code is documentation and should make it into the generated documentation, not the first thing you see but it should be there along with commit history, etc.
Re:Pyret: A new programming language from the creators of Ra... by tel on Monday November 11, 2013 @01:45PM (#6713161)
If that ended up nicely formatted beneath the definition of `foo` in the documentation I would recommend it wholeheartedly. In practice it doesn't happen, sadly.