I have the opportunity to interview a lot of young programmers here at Credera. As part of the interview process, we typically give three to four programming problems for candidates to solve. Invariably, the first thing young programmers do is start writing code. This is a big red flag for me.
Well (this may date me a little) but my first programming class used VAX assembly and FORTRAN. That class had a lab and it required you buy three things:
For the readers under 30, the thing on the left is called graph paper. The thing in the middle is a flowchart template. And those funny looking things on the right are called pencils.
There weren’t laptops in those days, and there were very few PCs. We had to wait for our turn at a terminal to type in our program. So, we actually had to sit down beforehand and think about what it was we were trying to do and how we were going to do it. Then we took that solution and converted into a set of instructions. It’s an important distinction: the code isn’t the solution. The code is a representation of the solution for the computer.
This is the thought behind John Johnson’s famous quote, “First, solve the problem, then write the code.”
Thinking about solving a problem has become a lost art. I would estimate that less than 5% of people I interview take time to think about the problem or the solution before jumping ahead with the code. Those from an object-oriented background are notorious for this, as they tend to just start naming objects.
This typically leads to poor code that is unstructured, unreadable, and buggy. Programmers are reluctant to make wholesale changes to a method or function, therefore, bug fixes end up being bolted onto an already poor structure.
(Note: I think this is one of the under-appreciated benefits of Test Driven Development (TDD). With TDD, you’re forced to think about what you are trying to do and how you will handle all the edge cases.)
So, what’s the best programming tool you’ll ever use? It’s not an IDE, text editor, or messaging client. It’s not graph paper or pencils. It is your brain and the problem solving skills you’ve been honing your entire life. To be a stand-out programmer, I encourage you to use your brain and solve the problem before jumping into the code.