Join me as I ponder course content and the mysteries of behavior
 
Progress With Code

Progress With Code

Coding hasn’t become a habit for me yet….

But maybe something else has.

I began this venture with the aim of reducing the amount of willpower required to tough through the learning process. Applying a strategy of preemptive reward to ease the burden on willpower, alluded to in Power of Habit, I successfully set up Manim. It was an arduous process with little reward along the way. I supplemented with small treats and continued the practice when it came to learning to code. Running and rendering some included test code was a huge milestone, but I had only made it to the starting line of this race with no end.

Upon learning super basic coding specific to Manim, I found much enjoyment in seeing how the code affected the render. I may have developed a Pavlov effect with respect to seeing a successful render, because I’m finding it satisfying enough such that I see no further need for treats. Furthermore, I’ve begun to crave playing around in Visual Studio, wanting to try to render a desired effect. At first glance, this seems like the formation of a habit. However, even though there is a clear reward and a craving for such, there is still no identifiable cue or routine when it comes to the act of coding.

However…

I keep craving a successful render, and I often find myself thinking of something else that may have worked. I make my way to my computer, turn it on, and open Visual Studio. I’ve done this quite a lot recently. Instead of sitting down and working on code for hours straight, I’ll get on and off throughout the day. This has created the unintended habitual routine of opening Visual Studio the moment my computer fires up. When I sat down today to work on my blog, I was legitimately confused when I noticed Visual Studio open on my monitor with my cursor blinking on a line of code. I hadn’t habitually coded, but I had completely automated the process of opening Visual Studio, regardless of my intent when I opened my computer.

Another unintended byproduct of developing this interest would have to be my YouTube recommendations. It brings a new appreciation to the algorithm for me, as I haven’t even had to search for most of the questions I’ve developed. Mostly, I can just sit down and watch videos on an automated playlist that will serve me tons of information that I find useful. To the right is a section of code that I wrote myself. I learned basic stuff like defining variables, and how to call these variables and manipulate them. You can see red text with an equal sign to the right, such as “ax=”, “curva=”, “area=”, and more. You can see that I defined the range of the axis in “ax=”, and set an equation for a function to fall on the axis in “curva=”. I then defined the area of my function, defined some visual text and math text elements, set their positions with “.next_to” and “.to_edge” statements, and programmed the sequence of rendered events with the beige “self.” calls. I learned all of this by watching videos of content creators while they code very complicated scenes. I’m managing to pick up much of the basic stuff and apply it quickly.

Please enjoy this short animation of a basic sine function. If you watch the video closely, you may be able to refer back to the code above and reverse engineer how I am achieving these effects. For example, the first “self.play” calls “(Write(text))”, and if you refer back to what I’ve defined as “text”, you should see exactly what gets written at the beginning of the video. In case you were wondering, “self.wait()” simply makes it wait for the default time period, one second, until it moves onto the next step, “self.play(Write(exMa))”. See if you can find where “exMa” is defined in the picture above.

I don’t want to toot my own horn or anything, but I can’t get tired of watching this video. It looks incredibly professional and it only took basic code to achieve this render. Animating the writing of some text, the movement of said text, and the drawing a function… These are all quite easy. I really want to learn how to create animations that show changes to the math function and how the function modulates in response. Unfortunately, I’m running into several roadblocks and it’s becoming a bigger problem than I expected. Hopefully, I can make some progress soon because it’s driving me crazy. I’m craving that successful render!

Leave a Reply