Home » Chapter 1 : Preliminaries
Becoming a "Programmer"
In my work and research, I am an interdisciplinarian, which means I do not have a singular topical focus. In this context, for me, programming is a tool that I use in many different ways. So, to me becoming a programmer is more about the topic than it is programming itself. This is analogous to any tool that we might use for any purpose, the focus is on the goal, not the tool. For example, recently for a project .........
When you hear that someone is a programmer, what does that mean to you? I have an acquaintance, T, she is a programmer. T has a degree in Computer Science, her job title is Software Engineer (which is an advanced level the computer programming profession), it is what she does for her employer each day, and the way she earns a living. In my mind, T is a programmer. I have another acquaintance, S, she works at Walmart. Her job there is as an Optical Technician in the Optical Center, that is how she earns her living. However, in my mind, S is also a programmer. Why? Because she knows how to solve problems using a programming language because she attended a coding camp independent of her Walmart job. A third acquaintance, D, has a Ph.D. in English and teaches literature at a univerrsity. I consider him a programmer as well. He has no formal training in Computer Science or programming, but learned on his own because he needed the skills to complete some of his research projects. I consider all three of these people programmers even though only one of them has formal training in programming. Would you say that is valid?
Author, speaker, and programmer Linda Liukas suggests that everyone is a programmer, because programming is about solving problems. We all encounter and solve problems every day. Solving problems is the act of using algorithms (a set of steps to solve a problem). So, if you have ever encountered any problem, came up with a way to solve that problem, then, according to Liukas, you are a programmer. Would you say that is valid?
One might say, well, "I'm not good at solving problem. I'm terrible at math." I'm not talking about math (only), and neither is Liukas. In fact, I'll let you in on another little secret, being a programmer has much less about "being good at math" than you might think (or have been told). I started working as a programmer (profesionally, like T above), in 1985. As of this writing, that's nearly 40 years ago. I can tell you from my experience, being a programmer is more about being able to communicate (listening in particular) about problems, putting together solutions to those problems and then converting the solution into a form that a computer can help realize. Very (very, very) often, math is not involved at all.
So why do Computer Science majors have to take so much math? Because math is a formal language, that is, a formalized approach to solving problems and learning to do that hones one's problem solving skills—
the critical aspect of being a professional programmer. It is also practice with using and creating algorithms (a set of steps to solve a problem). Like anything else that you might practice to become proficient at doing. But does that mean you have to do all of the math to be a programmer? In my opinion, no, it is not a requirement. I know many successful programmers (some with professional titles as "programmers," and others, like D above, who successfully use programming to fulfill for their own purposes).
I use this book to teach programming across disciplines, which means my students (you) are not necessarily Computer Science students. Many Computer Science students have taken my classes and have found the intetdisciplinary approach very informative and beneficial. I have also had students from many other disciplines as well. Can you (or anyone) become a programmer? To answer this, I contend that we first have to shed the notion that a "programmer" is someone who writes code professionally as their income. This may be your goal or it may not be, either way, my answer to that question is, yes, you (anyone) can become a programmer. I believe this is analogous to saying anyone can be a musician, that statement does not necessarily mean everyone who learns to play a musical instrument or sing wants to earn their living through music. With the willingness and investment of time practicing, anyone (including you) can be a programmer (or a musician, or anything you choose to pursue).
Learning and becoming proficient with any subject is a matter of progression. You start somewhere and you learn pieces of the subject a bit at a time. As you progress you approach the goal of proficiency one step at a time. At whatever point you stop studying and learning your knowledge of the subject is greater than when you started. If we were to visualize this progression it might look something like this:
I have taught programming to hundreds of people in workshops, corporate training sessions in industry, and in college classrooms. I'll let you in on a little secret —
the biggest mistake I see students make is they focus all their attention on getting the syntax of their code "right," instead of understanding the problem and the concepts to solve the problem first. Unfortunately, a lot of programming instruction supports this mistake by placing the majority of the pedagogical focus on syntax in their assignments as well. This approach is a mistake because anyone can get the code "right" these days, simply by searching Google, Stack Overflow, or using an AI tools like ChatGPT or CoPilot. You can find the code examples (the syntax), copy them, run them, until one of them does what the assignment asks. Then, you turn in that code as your solution, get a great score on the assignment, and get an A in the class. Great! However, you have learned nothing about programming —
this is where Concepts First, Syntax Second comes in.
Let's consider a scenario...
A student, Bob, is in his Python for Beginners class and the next assignment says the following:
Write a program that performs a binary search on the following list: ["Joe", "Bob", "Sid", "Liz", "Rob", "Eli", "Ben", "Rex", "Jay", "Cal"]
Well, Bob does not really understand what a binary search is, how it works or how to write one in Python. He does know that the code has to be "right" or he'll fail the assignment, so he opens ChatGPT and copies and pastes the assignment prompt into the Chatbot and it gives him the following code solution:
def binary_search(arr, target):
left, right = 0, len(arr) - 1
while left <= right:
mid = (left + right) // 2
if arr[mid] == target:
return mid
elif arr[mid] < target:
left = mid + 1
else:
right = mid - 1
return -1
names = ["Joe", "Bob", "Sid", "Liz", "Rob", "Eli", "Ben", "Rex", "Jay", "Cal"]
names.sort()
target_name = "Liz"
result = binary_search(names, target_name)
if result != -1:
print(f"'{target_name}' found at index {result}")
else:
print(f"'{target_name}' not found in the list")
Then Bob copies the code from ChatGPT into his code editor and runs it. It works. He reads the code a couple of times and thinks, "Oh, yeah, I get it," and turns in this code for the assignment. Bob gets a good grade and Bob is happy.
The first piece of advice for Bob is, slow down. That may sound counter-intuitive because time is always at a premium, but to put concepts first requires time investment up front, before any code is written (or searched for) at all. How might Bob approach this problem without resorting to an online search or asking a chtbot first? First, he should try to relate the problem to something tangible in order to associate the assignment promopt with something real. The assignment provides a list of names to search, if we had that list and was asked to find one (Liz, for example), what is this analogous to in the real world? Looking for a word in a dictionary or contact list. What is common about those lists? They are sorted alphabetically. So, if I had a paper dictionary and needed to find a word that starts with the letter L, how would I do that? A common approach would be to open the dictionary to some arbitrary page about in the middle and look at where I'm at in the alphabetical sequence. Let's say I happened to open it to a page full of words that start with P. Because Bob knows the alphabet, he knows that L comes before P, so he'll find that word to the left of where he is currently in the book. So, he might split the left set of pages about in the middle and look again at where that put him in the alphabetical sequence. He'll repeat this until he finds the word.
The first thing Bob should realize about the assignment prompt is that this approach won't work as is because the list the assignment provided is not sorted. But, the assignment explicitly states it wants a binary search as the solution. So, this means Bob's program will need to sort the list first. And then he can attend to the steps to write in code that mimics the real-world example of manually searching the dictionary for a words in the same manner.