Reflections on programming progression – Part 1

Geek, Lighting Tech, Maker

Reflections on programming progression – Part 1

What follows is a look at experiences and progression in programming both in context and style.

When I was a child, I walked as a child, and talked as a child.

Looking back at my first program, it seems rather utilitarian, it had a simplicity, yet it was also blind and had no care to anything around it, nor itself.

walk 5 steps forward
turn 90 degrees right
walk 20 steps forward
stop
say "hello"
turn 180 degrees right
walk 20 steps forward
turn 90 degrees left
walk 5 steps forward
say "world"

In normal circumstances this program simply makes a person look silly walking a strange L shape and calling out words. However if  10 steps into line 3 there happens to be a cliff, the results may not be as funny. 

Programs to me then were simply series of actions, ones that I take over and over that could be easily automated. 

This thought process, while it can be considered correct, was wrong in a fundamental way. I have capabilities other than just walking. If I came to the edge of a cliff, I know enough not to continue forward. However this program does not allow me to stop.

Learning to stop on the edge

knowing that my program would be potentially fatal, I decided I needed a way to protect against that, this led to a weird little introduction to loops

action = {walk 5 steps forward,
turn 90 degrees right,
walk 20 steps forward,
stop,
say "hello",
turn 180 degrees right ,
walk 20 steps forward,
turn 90 degrees left,
walk 5 steps forward,
say "world",
}

for line in action
do
if ( atCliff != 1) then $line
else break
done

I think That is all for now, Let me know what you think, And If I should continue on 🙂

No Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.