So, what exactly is programming?

Aneesh Patil
4 min readApr 3, 2021
Photo by Oskar Yildiz on Unsplash
Photo by Devin Avery on Unsplash

People explain the word ‘programming’ or ‘coding’ in thousands of different ways, many of which include technical jargon like algorithms, methods, complexity, etc etc. When I first got into programming back in freshmen year, I didn’t have a clue about what a computer does or how programs work. However, as weeks went by I started to get a good grasp of the concept and this is what I make of it and how I explain programming to all my non-CS friends. Think of it this way, you just hired yourself a personal assistant who, turns out, is relatively incompetent. It’s 3:00 in the morning and you badly need a hot cup of coffee to stay up and finish your assignment that’s due in a few hours. Since you don’t have time to make coffee, you ask your PA to make you a cup. How do you think you would go about explaining this?

  • Step 1: Fill the coffee machine’s water reservoir till the 450 mL mark
  • Step 2: Place the unopened coffee pod in the chamber
  • Step 3: Place the coffee mug on the plate
  • Step 4: Close the reservoir’s lid
  • Step 5: Press the ‘brew’ button and wait 4 minutes
  • Step 6: Bring it back to me before I fall asleep

Seems about right? Well, programming is just this in a nutshell. Well except, you’re not asking your PA to make you a cup of coffee. Well, also you’ll be working with computers instead of PAs but you get the gist. Regardless of the language, the entire logic of programming is adding structure and organization to your main task. A programmer must be as specific as possible to cover all sorts of edge cases to ensure the program performs the task as desired. As a programmer, you’ll often make use of sequence diagrams to create pseudocode. This helps break down the bigger problem into smaller steps. Let’s see how the coffee-making task rolls out as a sequence model.

Flowchart Model — Coffee-making example

While the curve-edged rectangles represent the start and termination of a program, the rectangles denote task statements, and the diamonds denote conditional statements. This chart simplifies the process of problem-solving by building a flow of tasks and information. It starts by checking if there is any water in the reservoir. If it’s empty, we move to a block that tells us to fill 450 mL. Else, we go on to place a pod in the coffee chamber and mug on the drink plate. The next immediate step is to close the reservoir’s lid and press start on the machine. Until 4 minutes are elapsed we must busy wait. In programming, you will come across a ‘==’ sign very often. This is an operator used to compare two values. It uses a flag (boolean) that outputs TRUE if the values match and FALSE if not. In contrast, we also usually use a not-equal-to operator (‘!=’) that outputs TRUE if the values are different and FALSE if the same. Let’s go through how this would come out if we formally code it out:

Program Start if reservoir.isEmpty() {
reservoir.fillWater();
}
coffeeMachine.placePod(); // place the coffee pod
coffeeMachine.placeMug(); // place the mug
coffeeMachine.startBrew(); // hit start button on machine
while (timeElapsed != 240) { // wait while coffee is being brewed}coffee.bringToMe(); // bring me the coffee ASAP!!Program End
Photo by John Moeses Bauan on Unsplash

Phew… Defining all these tasks might seem cumbersome and you also must be wondering why can’t I just go make myself a cup of coffee instead of that? Or, why can I not just go perform the task instead of telling a computer how to do it? Well, you could for a maybe for 9–10 times but we know our time is precious. If I asked you to name me the prime numbers between 1 and 20, I’m almost certain you could do that without flinching. But what if I raise the upper bound to 1,000 or 10,000? Automation is extremely crucial in today’s world — not just in finding prime numbers but also in advanced technological breakthroughs.

I always encourage my juniors to focus on the basics of programming because that is what creates a foundation for future courses. What programming language you choose does not matter because logic across the field remains the same. Yes, there are some popular ones out there like Java, Python, and C but in the end, go with the language you’re most comfortable with.

========================================

If you have any questions, feel free to ask them below! If you enjoyed this article, drop a follow to stay tuned for more tech and programming-related articles!

Photo by Jon Tyson on Unsplash

--

--

Aneesh Patil

UW-Madison Alum 🎓 | Software Engineer | Passionate about Tech and Business ☁️