Organizing Bits of Code


Does anyone have a good way to organize bits of code so that you can go back to get it later? I use the documentation page pretty frequently, but I forget if the bit of code is in the graph section, note section, etc. It’s somewhat difficult going through all of my previous activities trying to find the piece of the activity I’m thinking of.

For example, I’d like to be able to search “check student graph against correct graph” and find all of the code that goes into doing that.

Do you make a single activity with all your code examples in it? Word doc? Something else?

1 Like

I keep a Google Document with useful bits of code ready to go, with mostly bits for displaying variables for equations and setting up screens I use often. I’m happy to share if you’d like, though I don’t know that it would be terribly useful.

Having a shared community document (or maybe even a section of the website) that works as a function library for common tasks, code to generate certain function types quickly - here’s code that will randomly generate a quadratic with intercepts and vertex that are all integers, for example - and just a place to shake out some community standards with Desmos staff guidance might be really cool, and make it easier for less code savvy creative types to make some powerful learning experiences.


I’d be interested in seeing how you organized it. I think I had seen mention of Desmos Fellows being tasked with creating that kind of document, but they might have meant the “try this” code in the documentation page.


The fellows created the CL bank of wonders a while back and the bank was transferred into the examples category of this site. The code snippets haven’t been updated with current tech so watch out for methods that may be outdated.

Want to update an example or share one of your own? Send me a message or post to the examples category.


Here’s a link to my stuff for what its worth.

Code Snippets