Coding as a form of magical thinking?

Posted by beckybratu on May 16, 2018

“Magical thinking” is a term used in psychology to refer to the erroneous belief of some that their actions directly influence events around them. In programming, that type of thinking boils down to your basic “if/then” algorhitmic causality.

if statement
  do something
else
  do something else
end

That simple relationship draws me in when it feels as though everything else around me, in the “real world,” is in chaos or otherwise outside of my control. When writing code, you can always predict an outcome – you can, in fact, prescribe it. Understanding the “if” statement protocol also denotes an understanding of your intended user and her behavior when using your app. It can ingrain an ideal route you’d want your user to take when using your app; it can incorporate exceptions to less-than-likely events; it can speed up or slow down a process. When properly coded, your “if” statement protocol should be ready for anything – no surprises.

As I gear up to code my Sinatra final project, I take refuge in “if” statements, where every outcome is accounted for.