Learning to Program with Fun Stuff

I’ve been programming since the days of yore when Commodore 64 was the personal computer of choice. I can program but I wouldn’t call myself a programmer. I can program VBScript macros on my work terminal and churn out a mean spreadsheet. I have learned the basics of programming Javascript, PERL, PHP, Ruby, Elixir and a few other languages I’ve forgotten, but I rarely implement anything worth sharing.

The main problem is the gap between my skills and vision. On one side, as I start learning a language my skills are improving, but on the other side I can’t envision anything worthwhile to create with my limited knowledge. I could eventually bridge the gap, but only with greater effort than I have mustered so far.

I had a day off from work today and started to play with a program called Pico-8, a “fantasy game console.” I watched a few tutorials and put together a mini game called Periwig that can be played in a web browser.

You are a wig. You can jump by pressing Z. There’s a bald guy standing over there. What should you do?

The Beauty of Constraints

Pico-8 is an integrated development environment for simple games which get saved as “cartridges.” Anyone can play the games other people have shared in a browser or through the program itself with the “splore” command. The program can also display the source code for those programs and be used to make more games.

Pico-8 uses a subset of the Lua scripting language, and includes integrated tools for creating sprites, maps, sound effects, and background music.

What makes Pico-8 a great tool for learning programming are the self-imposed constraints. You can only use 16 predefined colors. The resolution is 128 x 128 pixels. No one is going to expect whatever games you make to have great graphics, a fantastic soundtrack, or hundreds of levels.

But you also get immediate payoff while coding. First I drew a wig and programmed it to move back and forth on the screen when pressing the arrow keys. I then added some code to animate the wig when it moved. Then I added in a bald guy and had his head move back and forth.

As I completed each step I ran the program and celebrated. My wig can jump! I haven’t had this much fun programming since I was a wee sprig.

After a few hours of programming I have something that I can either continue to develop or abandon for another idea.

And what I’m learning has real value. How these games are made resembles how commercials games and programs are made. While the program isn’t free, the games made on the program can be shared with anyone. There are also similar fantasy consoles that are open source and free.

Aphorisms #1

1.

The pages turn swiftly on words
gathered like stones
over the years and lost hours

Inspiration waits with breath
bated, while the poet
drunkard balances on one foot

Until the tremors subside
the writer either falls
or stumbles forward one line

A poet must reach for sanity
but also presage a text, a reader
and a world more humane

Five Ways to Make Progress as a Writer

I’m reading about creativity, and decided to answer one question posed by Brian Johnson in his review of the book Art and Fear.

How can you make a 5% improvement in your life?

Brian then followed this question with a numbered list of five blank lines. This is what I decided would improve my life as a writer.

  1. Cut distractions. Add emphasis.
  2. Ritualize the creative act.
  3. Research and experiment.
  4. Publish or perish.
  5. Remember that ontogeny recapitulates phylogeny.

1. Cut distractions. Add emphasis.

De-clutter. Practice the life changing magic of tidying up. Leave only what supports creative work or the general practice of life.

  • Reminders go in places of prominence, ie. one’s implements should dominate the center of an otherwise clean desk.
  • Chocolate and energy drinks should be kept nearby to your work space.
  • Join a food subscription service.
  • Cancel video streaming services.
  • Generally, use what you have and only add what you need.
  • (However, do consider getting a ChromeBook because wow they flicker on in 0.4 seconds and will run for 11 hours on a 55% charge.)

In other words, create an environment that will support the work you want to do. The writing of architect, Christopher Alexander, comes to mind. Architecture can support life by creating a space where life is naturally drawn. What environment and daily practices will encourage writing or drawing?

2. Ritualize the creative act.

Write and draw every day. Follow a pattern–a pattern that can evolve–but, still, a recognizable pattern that will trigger creativity.

  • Carve out specific times and places to work.
  • Light a scented candle or switch on a playlist of relaxing sounds like white noise, binaural beats, nature recordings or ASMR.
  • Visualize a successful session and the steps ahead.
  • Give thanks to your implements. Did some poor badger die for your brush? Express your appreciation.
  • Relax by reading until a thought occurs and the will to express yourself surfaces.
  • Practice the pomodoro method of staying focused without burning out.
  • Design the stopping point. A time limit? A word count? What happens at the end of a session?

3. Research and experiment.

Shape the creative ritual by reading about creativity. What do researchers write? What have artists done? Through trial and error reshape the ritual. What works for you?

  • Dig through Google Scholar for papers on the neuroscience of creativity.
  • Find summaries of books on creativity, for example, Philosopher’s Notes by Brian Johnson.
  • Listen to podcasts, vlogs and audiobooks during downtime: commutes, lunch breaks, postprandial walks.
  • Look for measurable results. What are your Key Performance Indicators?

4. Publish or perish.

Creativity is a form of meditation. It hones your mind and perspective, and that should always be the primary motivation. But, with every step towards enlightenment, how can one not wish to share the insight? Ultimately, by sharing you attract the attention of good people who will support your work.

  • Finish fast and start fresh.
  • Create commitments and respect them. At work we call these Service Level Agreements.
  • What new channels can you use to deliver your work?
  • If you’re saving something as a draft, it’s probably going to wilt and wither. Can you hone the draft into something whole that will live on its own?

Ultimately, you want to create a social environment that will nurture your creative spirit.

5. Remember that ontogeny recapitulates phylogeny.

A writer and artist must develop through all the stages of human, mammal, vertebrate and so on. From a tiny embryo, you develop a spine, drop your tail, until one day you finally pick up the pencil and the stooped posture of a creative. Ask yourself, from where do writers and artists come from?

  • Dream and remember your dreams.
  • Learn how to solve problems and the problems those solutions create.
  • Speak openly and discover what grows or seethes in the hearts of others.
  • Which stories agonize people and which stories shift perspectives?

Life enriches art and art enriches life. It would be great if I could earn a living from creating art, but my forty-hour work week is not a distraction. It can enrich my life and my creative work. I am developing as human society has developed through the ages.

Stories for People

Last week I began to read a random fantasy novel but dropped it to start in on the last novel that Diana Wynne Jones almost wrote, The Islands of Chaldea. Her sister Ursula finished the book and I’m terribly glad she did. I had the opportunity to compare a blah opening chapter to a novel with an excellent opening chapter.

The Myth of Characters

They say fiction is all about characters. And that’s true in the same sense you can say that sailing is all about boats. There is some implicit fun about ships, but if sailing was all about fun then you wouldn’t need much more than a surf board. Sailing is about getting out to new places, connecting those places and solving problems with buoyant conveyances. Likewise, characters exist in stories for what they convey.

After I had read the first twenty pages of the Diana Wynne Jones novel, I was struck how completely I knew the characters. The fantasy novel barely scratched the surface of weapons and armor. Many authors make the mistake of describing their characters with detail but in isolation or only in the moment. An experienced writer like Jones describes the web of relationships which surround the main characters.

  • How are the characters related?
  • How do the characters view each other?
  • What problems do the relationships and perspectives create?

What does this kind of introduction do for the story? It gives the brain reading the story a social map and that’s good because the human brain craves this kind of information. Take a mental inventory of what you discuss or overhear during a day and see how much describes the perspectives people have of each other.

Writing Page by Page

The Islands of Chaldea ends with a note from Ursula Jones which gives a glimpse of her sister’s writing process. Diana never made notes. Her process followed the same process she had followed as a child. She would write, share what she wrote with her siblings and then would have to keep writing when they begged for more. Having read many books by Diana Wynne Jones I can easily imagine a hungry audience nipping at her heels.

For me, who suffers from analysis paralysis, I find Diana Wynne Jones inspirational. She wrote great stories one page at a time. They were not perfect stories, but the stories moved swiftly from start to finish, carrying readers from one place of safety to another.

Translating the Haiku Form into English

I want to make a plea that may seem a little odd. It’s about haiku, the shortest form of poetry known to humanity. Here’s the thing. If you are writing haiku in English, your haiku are probably too long.

A haiku should be
Five, seven, five syllables
And la dee dah, dah.

Crazy, right? Haiku are only seventeen syllables. How can that be too long? I’m sorry, it just is. The Japanese language doesn’t work the same way as English, and in particular the Japanese syllable took a very different turn from the English syllable.

English syllables are dense and chaotic. English words string together a code of 26 letters into odd constructs. Japanese words use a set of glyphs and a more simplified syllabary. The basic unit of Japanese is a syllable: either a single vowel, a consonant-vowel combo, or the “n” sound alone. There are about 100 such syllables. English contains over 15,000 syllables and even today I don’t believe anyone has successfully delineated them all.

Because of this, English can encode information more densely than Japanese. Consider this, in English the word “strengths” is a single syllable. If this word were transliterated into Japanese it would require about seven Japanese syllables.

Beneath Trees

ki no moto ni / shiru mo namasu mo / sakura kana

Bashou wrote this poem about eating outside while watching the cherry blossoms blooming. This romanized transliteration may give you an idea how sparse and tiny a Japanese haiku really is.

Most translations of Japanese haiku end up inserting extraneous information in order to pad the translation to fit the seventeen-syllable structure that readers expect. The poem above is usually translated in such a way to explicitly portray that cherry blossoms have fallen into the food. This insight is not encoded directly in the poem. It is the reader’s insight. That insight is the payoff from reading the haiku and letting it knock around the phonological loop of short-term memory.

Here’s my own translation.

beneath trees
    soup and salad and
        cherry blossoms

Eleven to Twelve English Syllables

My suggested form for writing English form haiku follows a pattern of three syllables, five syllables and then three syllables with wiggle room for another syllable depending on the density of the words or the pacing of the lines.

Less is more. In twelve syllables the poet will need to find, refine and focus on the resonant image of the poem. A seventeen syllable haiku looks like a resonant image photobombed by an unctuous cousin.

raindrops patter
    still falling down from
        leaf to leaf

This poem was initiated by my momentary surprise as I noticed I could hear rain falling although the rain clouds had passed. The rain was still falling through the leaves in the trees where I had recently sheltered.

These twelve syllables capture that moment for me succinctly. I can’t imagine how five more syllables could say anything more worth saying in connection with my surprise and delight.

Better Than Before

Gretchen Rubin loves to explore human nature and wrote the bestselling book The Happiness Project that details a series of experiments she undertook to improve her general happiness. In the pursuit of happiness she now turns to look at habits with her book, Better Than Before: Mastering the Habits of Our Everyday Lives.

The Importance of Habit


People love their brains. What makes us human if not encephalization? That’s the size of our brains compared to body mass, and our ratio tops the chart. The reason human babies are born so cute and helpless is to give them more time to grow their brains. Because of this there is a bias towards decision making, willpower and motivation. And yet, our brains use the energy of a 20-watt light bulb. Brains love mental shortcuts.

If you walk into a restaurant day after day, at some point you’ll stop looking at the menu and order what you like. If you drive down the same street, you’ll stop searching your phone directory for nearby restaurants. On your way home from work you’ll head down the streets you know. Your brain goes on autopilot and this saves mental computing power for the non-routine tasks.

Habits are easier to maintain than motivation, willpower or constantly reassessing decisions. Habits can either push you toward or away from your goals. Good habits will help your brain maintain its edge. Bad habits create drag.

Know Thyself

Gretchen Rubin’s book has one key insight about habits that sets it apart from many others. People are not all alike. First of all, they have their own particular goals and will not necessarily want the same habits as others. Some habits may be key to attaining others (like sleep) but our habits express our identity.

More importantly, people are not alike in the way they can build, maintain or drop habits. For this reason the book covers a number of key differences in personality. Do you start projects without finishing them? Do you dislike shopping or love it? Rubin believes one must know such things in order to tailor strategies of habit building for the individual. For example, night owls should avoid exercising in the morning since it will only frustrate them.

Internal and External Rules

Rubin loves to categorize people. Early in the book she talks about how people are motivated by rules. Depending on whether they are motivated or not motivated by internal or external rules, people fall into one of four quadrants.

  • Upholders are self-starters because they are motivated by external rules as well as their own personal rules.
  • Obligers meet external expectations but don’t follow an internal compass.
  • Questioners could care less about expectations unless they understand the reason behind the rule.
  • Rebels defy both external and inner expectations.

Each of these kinds of people need to approach habits differently. A rebel, for example, needs the habit to be framed in terms of freedom rather than internal logic or external expectations. Obligers should seek external accountability from a friend or coach.

By the way, I am a questioner leaning towards rebel. I need to fully understand the why behind a habit, but I also have to watch that I don’t drop my good habits on a whim because I don’t feel like doing them. I got myself to start shaving on a regular basis by getting a shaving mug. My questioner loves the superior shaving lather which is warm, frothy and more natural. My rebel loves how I’ve dropped the shaving cream can and am doing something different.

Learn More

Cascading Effects

What does it take to get a good night’s sleep? Sadly, a good night’s sleep is the product of a whole day’s worth of decisions.

Beneficial habits and sound decisions aren’t always made in the moment. For example, the final revelation that helped me quit smoking for good was realizing I did not choose to smoke when I lit each cigarette. I was choosing to smoke each time I bought cigarettes.

So now I’m trying to get a good night’s sleep. For that I need a set bedtime early enough in the evening to allow about seven hours of sleep. For that I need to start winding down about an hour earlier. I’ll don my blue-blocking glasses and listen to something relaxing like birds chirping in a rainforest. I find that to be easier if I feel like I’ve had a good day as opposed to one that is unfulfilled. Otherwise I stay up late trying to accomplish more.

It also helps to have a healthy dinner and to exercise after work. If I get home and eat fast food while sitting in front of the television, I fall asleep early and then I won’t be able to sleep normally that night. So it is important for me to have energy after work and for that I need to be able to work productively rather than burning myself out. But if I eat out of the vending machine rather than eat just what I packed, I will likely have a sugar crash that will decrease my efficiency.

Why would I eat out of the vending machine? Brain fog that comes from not eating a healthy breakfast because I didn’t wake up early enough in the day. And why did I keep hitting that snooze button? That’s right. I didn’t get a good night’s sleep.

Cascading_Effects

It is a viscous cycle with many more cascading effects feeding into it than I outlined here. A tidy bedroom helps me wake up refreshed. Meditation helps. Many other little things contribute to a good night’s sleep.

A good night’s sleep is hard to find. Metaphysical grandmas will send you down the wrong road and then their cats will jump and claw until you run into a ditch. Next thing you know ruffians are marching you and your family off into the woods, and there goes your good night’s sleep.

The heat these past few weeks has drained me of energy. Even if I wake up early, eat a healthy breakfast, go into work with a clear mind, eat a healthy lunch and work productively, I find I am still exhausted by the end of the work day. All I want to do at that point is find something cold to drink, something convenient to eat and then do (in the weakest sense of the word) something sedentary like watch television. This invariably leads to a cycle of bad sleep.

If I am aware of these cascading effects, it can help me achieve my goals. I don’t get a good night’s sleep, so I must follow the moment back to the point when I fell off the path. If the heat drains my energy, then I can follow my brother’s suggestion and take a cooling shower after work.

I would write more on these cascading effects, but now it is time for me to start winding down. I have done enough today. I want to get up early and go have breakfast with my parents and from there see if I can get a good start on my work week.

Ethereal Instruments

Two sisters invited a surgeon to their laboratory by showing him animated 3D cutaways of two ultra-precise surgeries they could perform. When he arrived at their lab he was surprised to discover that their lab was inside the body of a brilliant scientist and musician who laid in a coma. The older sister explained that she invented a device that could hear the scientist’s thoughts and based on equations she had heard in his mind they had learned how to shrink themselves.

Ethereal_Instruments

The butler oversaw the process of injecting them into the scientist’s sternum.

From inside the miniature universe, the sisters showed the visiting surgeon wonders of the human body, but first they asked him to ignore any irregularities he might notice as they were all part of a secret plan. I never found out what, but the plan had something to do with nutrients. I could see these nutrients binding to the outer walls of puzzle-piece cells.

The surgeon had a small guest room in the lab inside the scientist’s chest. The two sisters knocked on the door and found him wearing the listening device that broadcast the scientist’s thoughts. The device looked like a bent silver pipe with a chain connecting the two ends. He seemed to love immersing himself in the scientist’s mind filled with elaborate musical compositions performed by ethereal instruments that did not exist in reality. Somehow this had touched him more deeply than all of the physiological wonders that surrounded him.

When it was time for the surgeon to leave, a shadow crossed over him in the form of his mother who did not care for music. As the butler guided the surgeon to through the front door, he showed him a drawing of a man in a suit which existed in four different realities and was colored differently in each.

When I woke I did not think all would go well for the surgeon. I felt this was his creation story as a criminal mastermind.