Custom procedures

So I’m writing the same code basically on most of my screens and when I watch videos it seems to be what others are doing also, but this isn’t the best coding practice. I was wondering if computational layer supports writing custom procedures and or functions so I wouldn’t have to continually duplicate code that has already been written. Yes I do duplicate previous components, but when I want to change something, I don’t like to have to go back through every screen and make the same changes over and over again.

Also I have gifs on every slide and I’m not sure if that’s what is bogging down my browser or if it is just my very old laptop, but I can only write code for about ten minutes at a time and everything locks up and I have to close my browser tab and then reopen it and I’m good for another ten minutes or so.

1 Like

This is something I have wanted since computation layer was first launched! I’d love to be able to have proper procedures, and even libraries where common code is stored, templates for screens in activities etc.

But it seems as though computation layer + Desmos Classroom is not really designed for proper software engineering practices, and I don’t know if there are any people still in Amplify who would be worried about making it into a nice modern programming language that encourages good practices. (I fear that you and I might be in the minority and that most people are happy enough copying and pasting code everywhere.)

3 Likes

I am absolutely with you.

Even just having global and scoped variables or even functions would be enormously helpful.

3 Likes

Yep. Their are so many things that I would do differently if C.L. was more like a typical programming language.

Being able to increment variables and change a variable’s value would also be nice.

1 Like

I think some of these are inherently difficult due to the design of the language, though, which is more like a spreadsheet (with formulas linking different values) than a procedural programming language. But there are lots of quality-of-life improvements that functional programming languages have that are missing in CL.