Think With A Programmer's Brain

bob.ts - Dec 20 '21 - - Dev Community

So, I recently got a question from an individual participating in #100daysofcode on Twitter. I follow this hashtag to cheer on newer developers and support their efforts.

The question went like this ...

(What) do you think can help me think like a programmer apart from (working on various examples over time)?

I had to take some time and gather my thoughts. This isn't an easy question.

Can I Answer This Question

First, I started as a programmer when I was 10-years-old; no college education at that time. I did get a Bachelor of Science, Computer Science (CS) later in life. The Internet didn't exist when I graduated so I guess I am a self-taught frontend developer.

I have worked on small and large teams, developing internal one-off applications and enterprise-level customer-facing applications.

I have used Waterfall, Kanban, Scrum and Agile. Some of these teams had loose requirements, others had to go strictly by the books.

Benefits of College Education

Let me start by saying that self-taught programmers can learn these things. There are excellent books, college courses online, and other online resources and communities to learn from.

However, they do not have the benefit of being as structured, or in many cases as in-depth as actually going to college for a CS degree so there is much more self-directed learning that need to occur.

Computer Science

  • College students in CS are trained heavily in algorithms and data structures. They generally have better and more efficient solutions.
  • They are trained in compiler theory and most of them know how to implement a compiler or an interpreter.
  • They are trained in higher mathematics (Calculus, Linear Algebra, Statistic).
  • Their problem-solving skills are generally better than self-taught programmers who do not learn Algorithm, Data Structure, Compiler Theory, OS Theory.

Communication

A large part of what I got out of college was communication. I still remember learning about the various techniques that teams would use and these skills have been invaluable over the years.

On teams today, forty to sixty percent of my day is in meetings:

  • Planning at a cross-team level.
  • Planning at the team level.
  • Writing and managing card for upcoming work (discussing these with various members of the team).
  • Participating in, or presenting in Knowledge-Transfer sessions.
  • Documenting processes.

The job is almost half communication.

THE ORIGINAL QUESTION

So, the original question is simply: "How can someone learn to think like a programmer?"

1. Programmers need to program.

They need to ...

  1. Write code.
  2. Watch the code fail.
  3. Learn to debug the failed code.
  4. Fix the broken code.
  5. GO BACK TO STEP 1.

Part of this process includes Refactoring.

  • There are formal times when refactoring is required to convert "working code" to better code that is faster and more useable over time.
  • There are informal times when refactoring is simply seeing and implementing a small improvement in code. This is generally a learning tool (if-branches, converted to switch-statements, converted to an object-reference tool). Essentially, learning when to use all the various parts of the language appropriately.

2. Programmers need to be familiar with CS Theory

  1. Problem-Solving Skills (yes, there are many good courses on problem-solving and critical thinking).
  2. Algorithms and Data Structures.
  3. Understand that more math is needed than just High School level.

3. Communication

Communication is also a learned skill. This is not simply being open and able to carry a conversation. This communication includes:

  1. Working with "customers" to determine their needs.
  2. Working with designers and developers (on the team, or otherwise) to refine needs and plan the development process.
  3. Working with Quality Assurance to assist them in testing the application.
  4. Presenting work in meetings (Review or Knowledge Transfers).
  5. Working with Senior or Junior Developers.
  6. Participating in Code Reviews and Pull Requests.
  7. Reaching out to teammates when stuck on an issue.

Communication can also include things like ...

  1. Being able to build a good resume (it helps if this matches the LinkedIn information).
  2. Possibly writing articles to show your professional side.
  3. Speaking (at meetups or conferences).
  4. Marketing yourself (social media).

4. Knowing How to Research

Most developers know that StackOverflow can be a great resource when you are stuck on an issue.

This comes down to ...

  1. How to correctly search on Google (or other search sites ... I use Google)
  2. Find relevant information from reliable sites (w3Schools used to actually contain a lot of incorrect information)
  3. How to determine if the located information actually applies to what you are trying to do.

5. Knowing When to Take Breaks

Taking breaks in this sense is not just about getting lunch or a 15-minute break every hour. What I am talking about here is knowing when you are so deep into a problem that you can't see your way out. A break is often needed to get away from the code ... to let your subconscious work on the issue.

Summary

The original question was ...

(What) do you think can help me think like a programmer apart from (working on various examples over time)?

Here are the core areas I feel are important to get that "programmer brain."

  1. Programmers need to program (there needs to be a lot of time writing code).
  2. Programmers need to be familiar with CS Theory (understanding these theories improves ability to write and diagnose good code).
  3. Programmers need communication skills.
  4. Knowing how to research.
  5. Knowing when to take breaks.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .