How To Think Like a Programmer
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% DebuggingProfessional 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 SolvingKarl 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 PracticeDo 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 DayThe 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 ReadingAwesome! 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!
- Best Online Websites Like Ruble
- Best Video Editing Tools for Professionals and Amateurs in 2024
- The Best Google Font Combinations to Try in 2024
- How to integrate HubSpot CRM and Appy Pie’s Connect to Win More Customers
- The Power of Business Storytelling and 10 Expert Ideas
Most Popular App Categories 2021 *Top Mobile Application Categories
- How to DM on Instagram to Engage Leads
- AI in App Development [An Ultimate Guide to Creating Apps using AI]
- Importance of Workflow Automation for Businesses in 2023
- Top 10 Real-world Applications of Large Language Models
Most Popular Posts
- Land Your Marketing Emailers Directly In The Gmail Primary Tab
- 15 Best Event Management Software or Platforms in 2024
- The Art of Writing Persuasive Business Emails [Common Mistakes to Avoid]
- How To Use Apple’s Developer Documentation for Fun and Profit
- How to Create Movie Streaming Websites with Download Feature?