Get and Set

In my darkest moments, I worry that my study of programming, and specifically C# for Unity, will yield the same results as my attempt many years ago to learn ice skating. Then I remind myself that I can write a script that moves an object right and left. This is far more movement than I have ever managed on a rink.

This week’s code lab class was on properties. A property is a “wrapper” around a variable. The wrapper is a function (or functions) that adjusts every time the variable changes. A property “gets” and “sets” the variable, meaning that it retrieves it through the “get” function when it changes and (if necessary) modifies it through the “set” function. The property and variable must be the same word. The critical difference being that the property name is capitalized.

This is how programming works, I understand. But there is a part of my brain that shatters when it meets the resolute inflexibility of C#.

I took the pieces down the hall to the Clive Davis Institute, where Margrethe Aanestad’s Eternal IV, 2021 hangs on a wall. It is a giant pastel dot that turns from blue to black depending on where you are standing and the direction the light is hitting. It is a part of a series of Eternals that Aanestad began in 2017, each one unique “due to their handmade cumulative process of adding individual marks and traces.” Up close, you can see blue filaments curling at the edges of the circumference, pulled inward like cosmic dust or traveling outward like solar flares. Get and set.

***

On the art of computer programming, Donald Knuth had this to say:

A scientific approach is generally characterized by the words logical, systematic, impersonal, calm, rational, while an artistic approach is characterized by the words aesthetic, creative, humanitarian, anxious, irrational. It seems to me that both of these apparently contradictory approaches have great value with respect to computer programming.

First, let’s marvel for a moment at Knuth’s use of parallelism and antithesis, and how he uses hedging language to make it clear to the reader that the border between “scientific” and “artistic” is porous. I can’t help but notice that the word “generally” specifically targets the scientific approach, as if to unsettle the scientific side from the onset.

***

Brief Vya update: I spent most of the weekend revising a script called ActivateText. It does exactly what the name implies. As the Vya object moves through the scene, it triggers the activation of textboxes that contain the introduction’s main narration. Initially, the textboxes were on a timer and meant to fade out after 10 seconds, but this wasn’t working very well, maybe because they were all using the same textbox game object. Now Vya freezes until the player presses the spacebar to keep moving, so there is time to read or not read the narration at the player’s leisure. It also helps break the monotony of just holding down the left arrow key to move. Yes, Vya moves to the left in order to activate the narration. It’s a bit unusual, but after years of reading Hebrew texts, right to left reading comes naturally to me. I wanted to capture that feeling. I’m also absolutely going to use properties in this game—like memory/Memory and decay/Decay.

Previous
Previous

On the beach

Next
Next

Introducing Vya