How To Think Like a Programmer
By Neha Tyagi | Last Updated on October 30th, 2024 5:05 am | 5-min read
Learning how to code is challenging, that’s for sure. How can you make it easier for yourself? Learn to think like a programmer! The right mindset, mental models and problem-solving techniques make learning how to code a breeze. Plenty of people who want to learn to code, give up early. That’s why skilled developers make five and six figure salaries. It’s also why there is a shortage of developers in just about any industry you can think of. The supply is low and the demand is high. How can you put yourself on that same track to success? Here’s what we’ll get into:
- How coding is 80% debugging and just 20% writing new code
- The importance of finding your workflow for solving coding problems
- How deliberate practice and building coding projects can help you
- The advantages of an always-be-learning mindset
Table of Contents
Mindset: 20% Coding, 80% Debugging
Professional developers spend 20% of their time writing new code and 80% on debugging, testing and refactoring. Finding bugs and fixing them can be frustrating work. Pick a random post on Stack Overflow and you’ll find at least one person complaining about how that one bug cost them hours of work. Typical tasks you do as a software programmer consist of:- Write a block of code, like a function or feature
- Test that bit of code manually – does it work OK?
- Write an automated unit test for the code (optionally, before you code it)
- Find bugs in the code and fix them one by one
- Test your code for “edge cases” – what happens when you do [unlikely thing]?
Create Your Workflow for Problem Solving
Karl Popper, the great academic thinker and philosopher, has made an incredible contribution to scientific thinking: falsification. Here’s how that works:- In science you cannot be “right”, you can only aim to seek out evidence that refutes your hypotheses or ideas.
- Instead of testing theories to see if you’re right, you test them to see if you can prove them false.
- You first seek to understand the problem you’re trying to solve. What’s an optional? What is nil? What is unwrapping? You look that up, and learn more about these topics.
- Next up, you come up with a plan to test a hypothesis. Your idea is that somewhere in the code, an optional is improperly unwrapped and that causes the error. Your plan is to find the optional with debugging tools.
- The next step is of course taking action. You act out your experiment and gather results. Did you find the optional, and when you ran the app again, did you get any errors?
- Finally, you evaluate your results. You may for example have stumbled upon a solution that didn’t involve your original hypothesis. Can you go back and seek to understand how it works? And if you solved the issue, can you reiterate for yourself why it works like that?
The Importance of Deliberate Practice
Do a quick Google search and you’ll see that developers are in high demand these days. You see more than 2 million search results for “iOS developer jobs”, thousands of job posts on LinkedIn, and hundreds of pages with job descriptions of recruitment firms. It’s no surprise that the top iOS development courses on Udemy have tens of thousands of students, at $10 a pop. But is $10 and 50 hours of video content all it takes to become an iOS developer? Imagine that all those 40.000 students became successful iOS developers. There wouldn’t be a shortage of good developers any more! No, there’s something else going on… Anders Ericsson, a Swedish psychologist who studied human performance, wrote about the 10.000 Hours Rule. This rule states that any one could master any skill, with no innate talent, given that you spent 10.000 hours to practice it. That’s about 10 years of practicing programming! If you fill 10 years of practice with Udemy video courses, can anyone learn to code well and become a great developer? As it turns out, time spent is only one of many determining factors. Aptitude, talent and mentoring all play a role, but what matters most of all is deliberate practice. Deliberate practice is a simple concept. Are you racing through iOS tutorials and coding exercises as fast as you can, or are you deliberately examining, discovering and playing with code as you work through your 10, 100 or 1.000 hours of practice? You get where this is going: learning to think like a programmer involves practice, too. A few ideas on how you can practice deliberately:- Learn more about “break out” components, such as the UIViewController
- Dive into a Swift algorithm and use it to learn more about Swift syntax
- When you’ve learned about a new component, like URLSession, try to use it in your own iOS app project
Learn Something New Every Day
The difference between an iOS developer and a quitter is that the iOS developer is willing to learn something new every day. ”Willing” is key here. Many aspiring developers dream of a six figure salary, but not many of them are willing to put in the work. I get a dozen one-line emails a week from people asking how to make an app, but few of them go through the “trouble” of even trying to find this tutorial on my website. It is the ability to make mistakes that defines the mindset of a successful developer. Thinking like a programmer is nothing more than a disposition to make mistakes and learn from them. Surprised? Don’t forget that there are footsteps on the moon. They weren’t put there by people who wanted to go to the moon. They were put there by people that got to the moon! The airplane from Paris to New York didn’t turn back when it realised that it was 2 degrees off course. It adjusted course, and kept adjusting its course, until it got to New York. You can adjust course, and motivate yourself to keep going, by learning something new every day. It’s these small wins that compound over time. Not too small, not too big. Learning is a habit too, and habits help you achieve your goals. An approach you can use to help yourself learn every day is, coincidentally, automation. You can automate your own behavior based on a neutral trigger. Here’s an example: “Every morning, when I begin work, I spend 1 hour on Swift programming.” See how that works? You connect goal-based behavior with a trigger, such as getting out of bed, starting work or “When it’s Thursday 9 PM, I’m going to …” Such an automation helps you build a habit, and it prevents you from burning through your finite supply of willpower. The difference between a junior and senior developer is that one of them is willing to make mistakes. But which one is it? The most astounding fact is that when you learn to code like this, learning to code is easy. It’s fun! Thinking like a developer makes all the difference. Here’s a few brain-tickling coding tutorials for you to play with:- Palindromes In Swift
- Converting Roman Numerals With Swift
- Binary Search In Swift
- Shuffling An Array In Swift Explained
- Insertion Sort In Swift
Further Reading
Awesome! Now you know what it’s like to think like a programmer. It’ll help you learn to code, and write better code. Here’s what we’ve discussed:- Focus on writing 20% new code, and 80% debugging/rewriting existing code
- Create your own workflow for problem-solving, based on trial-and-error, experimentation and gaining insights and understanding
- Deliberate practice is critically important to master a topic
- Automate learning something new every day – coding is fun that way!
Related Articles
- Purple Color: Significance, Symbolism, and Shades
- Top MySQL Integrations for Optimized Database Management
- Inbound vs. Outbound Call Centers: Definition, Types, and How They Work
- How Companies are Leveraging AI to Create Logos- AI Logo Generator
- VG4D: Vision-Language Model Goes 4D Video Recognition
- Self-Exploring Language Models: Active Preference Elicitation for Online Alignment
- Champagne Color as a Versatile and Timeless Element in Graphic Design
- The Ultimate Guide to Earning Money From Games
- 10 Best AI Logo Generators in 2025: Key Features, Pros, Cons & Pricing
- Top 5 Google Docs Integrations for your Business in 2024