Error messages are incredibly useful tools. Despite their frequent association with frustration, they provide intermediate and expert programmers with instantaneous feedback on their code. To those already indoctrinated in good debugging practices, an error message can provide them with the information they need to identify and rectify any errors in their code.
Novice users, by contrast, have a rather different error message experience. What may seem familiar to an expert user is unfamiliar to a novice. Error messages and verbose stack traces can be obscure or obtuse, and lead beginning programmers in the wrong direction. Additionally, in certain specific edge cases, Python error messages correctly identify that an error has occurred, but provide the user with the wrong error type and wrong line of code.¹ For novices, this only makes matters worse. With these challenges in mind, we set out to create something better than the status quo.
PyLearn is a system designed for novice programmers, to facilitate the debugging process by providing clear, comprehensible, and more specific error messages. Though we set out to create PyLearn with novices in mind, we and our hundreds of beta testers have found that PyLearn is a beneficial tool for novice and expert users alike.
PyLearn is used from the command line just as you would use a standard Python interpreter, and can operate as both a standard file-based interpreter and an interactive interpreter. Through our custom error-classifying decision tree, we can often provide end users with a clearer, more specific message than stock Python. Additionally, we correctly handle all cases in which standard Python fails to properly classify an error, and go beyond Python's efforts to reinforce good coding practices from the get go. In the event that we are unable to classify an error better than standard Python, PyLearn gracefully degrades to the standard error message.
If any of this sounds remotely appealing to you, which we certainly hope it does, feel free to hop over to our Downloads page and try PyLearn for yourself. Though the release permanently available for download from this page will be frozen in time, future development of PyLearn will occur in an open-source capacity on our public Bitbucket repository.
Finally, we'd like to take this opportunity to express our gratitude to those who assisted in the creation of this project. To Amy Cszimar Dalal, our fearless leader and advisor, and the Carleton College Computer Science Department in its entirety, a hearty thanks.
But especially, we'd like to extend our eternal gratitude to Dave Musicant, Sherri Goings, Laura Effinger-Dean, Andy Exley, and the 153 Intro to CS students who agreed to teach and test PyLearn in some capacity over the course of Fall Term 2012 and Winter Term 2013. Without your patience, flexibility, questions, suggestions, stress-testing, and all around feedback, we know that PyLearn wouldn't have been anywhere near as successful as it was. Thank you.
So, without further ado, happing coding, and don't forget—learn something!
- The PyLearn Team, 16 March 2013
¹ For the curious, this involves unclosed multi-line statements and stems from Python's grammar being LL(1), along with a couple of implementation quirks in the CPython parser.