Sales and Marketing Training

How the Order of Operations prepared me for Programming

Algebra has always been a favorite subject of mine. There’s not much theory involved, just a toolbox of methods and the order of operations to solve. If you reach back into high school, you’ll remember:

  1. First, all operations that lie inside parentheses must be done.
  2. Next, do any work with exponents or radicals.
  3. Working from left to right, do all multiplication and division.
  4. Finally, working from left to right, do all addition and subtraction.

Here’s an example from Math.com:

image
Source: Math.com

Applying this to development is pretty simple.

  1. Operations within the parenthesis equate to my page layout in a simple HTML format. I begin with a blank page and steadily populate it until it has all the elements I want. I always work with XHTML and CSS to ensure flexible user interface design. Anywhere where there are expressions (i.e., database or programmatic results), I comment on the code and type in dummy text, images, or objects.
  2. Next, I work with any exponents or radicals. These are my programmatic or database functions that extract, transform, and load (ETL) the data as I wish to display it on my completed page. I work on the steps in that order unless formatting in the actual query results in improved performance.
  3. Next is multiplication or division. This is where I simplify my code. Rather than one huge monolithic script, I abstract as much of the code I can into include files and classes. With web development, I tend to work from top to bottom, of course.
  4. Finally, working from left to right, all addition and subtraction. This step is the final process, applying the last tidbits of form validation, style components, error handling, etc. Again, I tend to work from top to bottom.

Good development is not any more complex than a difficult Algebra problem. You have variables, equations, functions… and a logical order of operations to get the best results. I see a lot of hackers that get it to work but you find (as I have) that if you don’t plan out your methodology and take a logical approach, you find yourself writing your code over and over and over when problems or changes are needed.

Algebra has always been a lot like a jigsaw puzzle to me. It’s always been challenging and fun, and I knew a simple answer was possible. All the pieces are there; you must find and put them together correctly. Writing code is no different, but it’s more enjoyable because your puzzle output is whatever you want it to be!

I’m not a formal developer, nor am I even a great one. I have, however, received compliments on the code I’ve written throughout many projects. I believe much of it is because I do a lot of preplanning, whiteboarding, schema extraction, etc., before I even write that first script tag.

Douglas Karr

Douglas Karr is a fractional Chief Marketing Officer specializing in SaaS and AI companies, where he helps scale marketing operations, drive demand generation, and implement AI-powered strategies. He is the founder and publisher of Martech Zone, a leading publication in marketing technology, and a trusted advisor to startups and enterprises… More »
Back to top button
Close

Adblock Detected

We rely on ads and sponsorships to keep Martech Zone free. Please consider disabling your ad blocker—or support us with an affordable, ad-free annual membership ($10 US):

Sign Up For An Annual Membership