There is one remarkably simple trick you can learn in only a few minutes that will be useful for the rest of your future as a programmer. And there’s a critical reason why this one small trick is so significant that is important to understand.
The 10 Tab Rule:
In programming, you’re going to run into problems, error messages, and situations in which your program isn’t doing what you think it should. How you react to these scenarios will be the difference between being an okay programmer and an amazing one.
The “10 Tab Rule” is a simple process that can solve almost every problem you’ll encounter as a programmer
When problems arise, articulate the problem in a well-thought-out search query, search it using Google (or another popular search engine), and open each of the top 10 results in new tabs. Read or skim each of the tabs, then return to your code.
This simple routine– which will take roughly 10 to 15 minutes– will help you solve almost all of your problems as a developer. The difference between experienced and inexperienced developers is this: experienced developers immediately acknowledge what they don’t know and set out to find the answers, while inexperienced developers often times don’t have the knowledge nor the humility to begin looking for answers.
Before you are able to use the internet to solve your problems, you need to fully understand the problem first. The most important skill that software developers cultivate over time is the ability to solve problems using two specific steps:
First, fully understanding the problem with your code.
And second, looking for the solution to the problem based on your understanding.
It’s far too common to look for the solution to a problem before you fully understand it, and doing so will likely be a frustrating process. If you encounter an error message you’ve never seen before, a quick search for the text of the message can give you a lot of the context around the problem.
It is incredibly common to think your computer program is doing one thing when it’s actually doing something else.
It’s your job as a programmer to make no assumptions about what your program is doing, and use all the tools available to you to verify that each of the many assumptions you have about how your program is working is true. Thinking that a variable is set to one thing when it’s actually something else is very common. Thinking a certain method returns a certain value when it actually returns a different one is common, too. Thinking a function does one thing when it does something different altogether is another common one. They’re all variations of the same problem: thinking your code works one way when it works in a different way.
When this happens, it is your job to put on your detective hat and determine exactly which line of code is doing the wrong thing. In ruby, you can use tools like
puts, bye_bug. In JavaScript, you can use console.log to get the job done. Nearly every programming language has tools built into it to allow you to figure out which line of code isn’t behaving the way you think it should.
A HUGE part of becoming a software developer is understanding the tools at your disposal for understanding why you are having a problem.
Once you identify the disconnect between what you think the code is doing and what the code is actually doing, fixing the problem is usually pretty straightforward. And the ultimate solution: figuring out the line of code you don’t understand, and doing effective searches to research what is actually happening in your code.
As you grow as a developer, the “10 tab rule” will become the “8 tab rule,” and eventually just turn into one or two Google searches that you need to execute to find the solutions to your problems.
But the important lesson to take away is that understanding the problem is usually the hard part. Once you understand the part of your program that isn’t doing what you think it is, finding the solution becomes pretty easy.

No comments:
Post a Comment