Friendly Debugger for p5.js

UPDATE: New version of the story! https://medium.com/@ProcessingOrg/2017-marks-the-processing-foundations-sixth-year-participating-in-google-summer-of-code-d365f62fc463

For Google Summer of Code 2017, I worked on a project to redesign p5.js’s friendly debugger module to improve user-experience — in particular, to make it more inviting and helpful for both those who are experienced at coding and those who are new to coding. Started from examining language-specific common error cases, I developed a new feature for p5.js, the Friendly Error System (FES), which creates console messages that can hint at the debugging solution rather than throw an error and exit. JavaScript often allows “silent failures”, meaning the code will fail to execute the expected behavior without a warning (i.e. error messages) from the debugger. For example, JavaScript doesn’t support type checking by default, making errors in parameter entry harder to detect for new JavaScript developers.

The FES project for GSoC ’17 included: (1) a new function for parameter validation and friendly error message creation based on inline documentations, (2) updated inline documentations and function designs to match the newly implemented FES, (3) new unit tests for FES and its related functions, and (4) updated official documentation on FES for developers.

I ended up creating multiple pull requests before finalizing the last version for release. Here are the links to all my pull requests I made during GSOC (in reverse chronological order):

By default, FES is enabled for p5.js (development mode), whereas completely disabled in p5.min.js. The best place to find details of FES, its limitations, and future plans is the p5.js community’s wiki documentation for FES:

In summary, we identified some false negative cases resulting from the discrepancy between designs of the functions with actual usage cases. Most of the impacted functions are in a redesigning process. Output messages of FES still have room for improvement, especially for their clarity and precision for describing the detected errors. Furthermore, we will need to continue working on identifying more error cases (possibly in conjunction with outreach programs and workshops) and making the code more accessible (e.g. Spanish translation).

We plan to publish a separate post on Processing Foundation’s blog for announcing the new features and elaborating on the philosophy behind FES.

)

    美羅 = Mira C ( ⸚)

    Written by

    this beautiful network does some exhaustive search.

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade