<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Amy Haddad</title>
    <description>The latest articles on DEV Community by Amy Haddad (@amymhaddad).</description>
    <link>https://dev.to/amymhaddad</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F559491%2F40299216-02e8-4b31-976d-ab83f41d342f.jpeg</url>
      <title>DEV Community: Amy Haddad</title>
      <link>https://dev.to/amymhaddad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amymhaddad"/>
    <language>en</language>
    <item>
      <title>Level Up your Programming with Programmer’s Pyramid (it’s free!)</title>
      <dc:creator>Amy Haddad</dc:creator>
      <pubDate>Mon, 22 Mar 2021 16:35:55 +0000</pubDate>
      <link>https://dev.to/amymhaddad/level-up-your-programming-with-programmer-s-pyramid-it-s-free-4mp4</link>
      <guid>https://dev.to/amymhaddad/level-up-your-programming-with-programmer-s-pyramid-it-s-free-4mp4</guid>
      <description>&lt;p&gt;You realize that learning technologies, like React and Node, isn’t enough. So you want to enhance your skills and deepen your knowledge by learning the fundamentals of programming.&lt;/p&gt;

&lt;p&gt;But you have some questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What &lt;em&gt;are&lt;/em&gt; the &lt;strong&gt;fundamentals of programming&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;What &lt;strong&gt;topics&lt;/strong&gt; should I focus on first?&lt;/li&gt;
&lt;li&gt;Which &lt;strong&gt;resources&lt;/strong&gt; are best?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You’re not alone. These are some of the questions I’ve repeatedly asked on my own self-taught journey. What I needed most was a &lt;strong&gt;roadmap&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;I didn’t have one, so I created it: &lt;a href="https://programmerspyramid.com/"&gt;Programmer’s Pyramid&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;This &lt;em&gt;free&lt;/em&gt;, self-guided learning tool teaches you the fundamentals of programming. It defines what you need to learn and the sequence to learn it. It also provides the resources you need and explains how to go about learning the material. &lt;/p&gt;

&lt;p&gt;As a result, you’ll &lt;strong&gt;build a solid foundation of knowledge and develop core skills&lt;/strong&gt;, which will enhance your abilities as a programmer and prepare you for more advanced study.&lt;/p&gt;

&lt;p&gt;Finally, there’s a clear and accessible process for learning to program.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H7nZD6Qk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wcdx9jy18o5kjrb151dj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H7nZD6Qk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wcdx9jy18o5kjrb151dj.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  We’re Fighting the Same Fight
&lt;/h2&gt;

&lt;p&gt;Programmer’s Pyramid was created out of a need—my own. &lt;/p&gt;

&lt;p&gt;Learning to program for me felt like a black hole. The more I learned, the more I realized there was to learn. I had a hard time identifying &lt;em&gt;what&lt;/em&gt; to learn first and &lt;em&gt;how&lt;/em&gt; to learn it. &lt;/p&gt;

&lt;p&gt;Given these early roadblocks, I spent a lot of time learning how to learn, vetting resources, and studying great programmers. I knew there had to be a better—more effective—way to learn to program. &lt;/p&gt;

&lt;p&gt;So I began sharing my ideas about &lt;a href="https://amymhaddad.com/"&gt;learning to program effectively on my blog&lt;/a&gt;: learning strategies, useful programming resources, and important programming skills to develop. In the process, I found out that there were a lot of people just like me. We’re fighting the same fight: we want to get better at our craft, and need an effective way to go about it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Programming is a fantastic skill to develop. But the learning process shouldn't be so ambiguous and complex&lt;/strong&gt;. Enter Programmer’s Pyramid. &lt;/p&gt;

&lt;h2&gt;
  
  
  Your Learning System
&lt;/h2&gt;

&lt;p&gt;Getting lost in the details—all of the details—of whatever I was learning about was a mistake I commonly made. This slowed my progress and added to my frustration. Everything seemed important in the moment. But in hindsight it wasn’t.&lt;/p&gt;

&lt;p&gt;While challenging to go through, a critical lesson was learned: the details make a lot more sense once the core structure is in place. &lt;a href="https://bit.ly/3pLkdKD"&gt;Elon Musk&lt;/a&gt; puts it best: &lt;/p&gt;

&lt;p&gt;&lt;em&gt;“It is important to view knowledge as sort of a semantic tree — make sure you understand the fundamental principles, i.e. the trunk and big branches, before you get into the leaves/details or there is nothing for them to hang on to.”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That’s why &lt;strong&gt;the core comes first&lt;/strong&gt; in Programmer's Pyramid.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bottom-Up Approach to Learning to Program
&lt;/h2&gt;

&lt;p&gt;Programmer’s Pyramid advocates a &lt;a href="https://programmerspyramid.com/approach/"&gt;bottom-up approach&lt;/a&gt; for learning to program. The idea is to build a solid foundation—starting with the fundamentals.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ysKTPyFD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yn83nm586fprvhc71bxw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ysKTPyFD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yn83nm586fprvhc71bxw.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This approach runs counter to a trendy approach today. I call it the top-down approach. It’s when programmers start at the top of the Pyramid and focus almost exclusively on technologies. Programming fundamentals are an afterthought, if they’re addressed at all.&lt;/p&gt;

&lt;p&gt;This is a problem. &lt;/p&gt;

&lt;p&gt;The top-down approach bypasses many important programming topics and skills, and results in a shaky foundation of knowledge.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lay the Foundation: Focus on the Fundamentals
&lt;/h2&gt;

&lt;p&gt;It’s not to say that you don’t need technologies. You do. However, the fundamentals come first for this reason: &lt;strong&gt;the fundamentals are the enabler&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;They &lt;em&gt;enable&lt;/em&gt; us to use technologies better. &lt;/p&gt;

&lt;p&gt;They &lt;em&gt;enable&lt;/em&gt; us to write better—more effective—programs. &lt;/p&gt;

&lt;p&gt;They &lt;em&gt;enable&lt;/em&gt; us to become more versatile and adaptable. &lt;/p&gt;

&lt;p&gt;Above all, the fundamentals enable us to become better programmers.&lt;/p&gt;

&lt;p&gt;Programming is a skill. The way to build a skill of any kind is to break it down and focus on its core parts.&lt;/p&gt;

&lt;p&gt;Experts in many fields have followed this precise recipe. Think of Josh Waitzkin of chess or Kobe Bryant of basketball: both focused relentlessly on the fundamentals. &lt;/p&gt;

&lt;p&gt;And so does Programmer’s Pyramid. It clearly delineates &lt;strong&gt;what&lt;/strong&gt; the fundamentals of programming are, and equally important, &lt;strong&gt;when&lt;/strong&gt; and &lt;strong&gt;how&lt;/strong&gt; to learn them. The pyramid shape gives learning its structure: start at the base and work your way up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Crush the Content
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;What&lt;/em&gt; you need to focus on—the fundamentals of programming—is only half of the battle. The other is &lt;em&gt;how&lt;/em&gt; to learn them.&lt;/p&gt;

&lt;p&gt;Programmer’s Pyramid advocates an active approach to learning, a method that I call &lt;a href="https://amymhaddad.com/apply-first"&gt;apply first, study second&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;The idea is to &lt;em&gt;try&lt;/em&gt; solving the problem or writing the program first. You don't have to get the correct solution. Rather, it’s all about the attempt: see how far you get before you get stuck. In other words, find the roadblock. &lt;em&gt;If&lt;/em&gt; you get stuck, then reference a book or course and focus on that specific roadblock.&lt;/p&gt;

&lt;p&gt;There are several reasons why this approach works. First, it brings awareness to something specific that you're having trouble with. &lt;/p&gt;

&lt;p&gt;Say you start a problem and get stuck using a &lt;strong&gt;while loop&lt;/strong&gt; (why won’t it terminate?!). By trying the problem first, you’ll use the resource with &lt;em&gt;purpose&lt;/em&gt;. Rather than mechanically cycling through lectures, only focus on the ones that will get you unstuck. So in this example, you'd zone in on while loops, and infinite loops in particular.&lt;/p&gt;

&lt;p&gt;Consequently, your learning process will be much more efficient. We often sit through video lectures listening to content that we already know. Or we inundate ourselves with details—ones that aren’t relevant to us now. &lt;strong&gt;Instead of focusing on everything, with the apply first, study second approach you focus on one thing and nail it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Learning is also much more meaningful with this approach, at least in my experience. That’s because when you watch a lecture or read a book you'll have a specific situation in mind to tie the information back to.&lt;/p&gt;

&lt;p&gt;When you need more details, then get the details at that time. Otherwise, there’s a good chance you’ll forget them. “In very short order we lose something like 70 percent of what we’ve just heard or read,” explain the authors of the book, &lt;em&gt;Make It Stick&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;This gets at another reason why apply first, study second works: you’re bound to retain the information better because the learning process is active, not passive. Even if you don’t solve the problem on your first attempt, you’ll probably remember the process. That’s because we often remember the times we struggle. &lt;/p&gt;

&lt;p&gt;For example, I vividly recall my first half-marathon. I struggled through it because I didn’t train for it properly. Although it was difficult to endure in the moment, I learned so much from that race—key lessons that I still hold with me today. I didn’t learn from passively watching a lecture on how to run a race. Instead—and this is the important point—I learned by taking action: I showed up on race day and ran the race. &lt;/p&gt;

&lt;p&gt;For these reasons, Programmer’s Pyramid champions the apply first, study second approach. Each topic within the Pyramid contains two parts: “Reference” and “Apply It”. Try a problem from the “Apply It” section first. Then, consult a course, book, or article in the “Reference” section if you get stuck. &lt;/p&gt;

&lt;p&gt;My mission is to help programmers learn to program effectively. Yes, there’s a lot of programming information to learn. But when you have the &lt;em&gt;what&lt;/em&gt; and &lt;em&gt;how&lt;/em&gt; in place, your journey becomes a lot smoother. It starts with a solid foundation and effective learning habits. That’s what &lt;a href="https://programmerspyramid.com/"&gt;Programmer’s Pyramid&lt;/a&gt; aims to deliver.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Programmer and writer: &lt;a href="https://amymhaddad.com/"&gt;amymhaddad.com&lt;/a&gt; | &lt;a href="https://programmerspyramid.com/"&gt;programmerspyramid.com&lt;/a&gt; | I tweet about programming, learning, and productivity &lt;a href="https://twitter.com/amymhaddad"&gt;@amymhaddad&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://amymhaddad.com/level-up-your-programming-with-programmers-pyramid"&gt;amymhaddad.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>productivity</category>
      <category>learning</category>
      <category>coding</category>
    </item>
    <item>
      <title>Why Reading Code Matters (and how to get better at it)</title>
      <dc:creator>Amy Haddad</dc:creator>
      <pubDate>Mon, 01 Mar 2021 17:02:28 +0000</pubDate>
      <link>https://dev.to/amymhaddad/why-reading-code-matters-and-how-to-get-better-at-it-2kan</link>
      <guid>https://dev.to/amymhaddad/why-reading-code-matters-and-how-to-get-better-at-it-2kan</guid>
      <description>&lt;p&gt;It strikes me as odd. We’ve heard the same messages: Write clean code. Write readable code. Write meaningful code.&lt;/p&gt;

&lt;p&gt;I agree with these sentiments. But all the talk about &lt;em&gt;writing&lt;/em&gt; code overshadows another critical skill: the ability to &lt;em&gt;read&lt;/em&gt; it.&lt;/p&gt;

&lt;p&gt;This is odd to me because so much of our time as programmers is spent reading code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;debugging your code or someone else’s,&lt;/li&gt;
&lt;li&gt;picking up a project mid-stream, or &lt;/li&gt;
&lt;li&gt;receiving some starter code for a project or problem to complete.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;More to the point, reading code can help you become a better writer of it.&lt;/p&gt;

&lt;h1&gt;
  
  
  An Important Skill
&lt;/h1&gt;

&lt;p&gt;When I began writing articles, I repeatedly got the same advice for self-improvement: write a lot and read a lot. That’s right, &lt;em&gt;read&lt;/em&gt; a lot. &lt;/p&gt;

&lt;p&gt;So that’s what I did (and still do). I read—a lot. I read to learn. I read to better understand grammar. I read to understand how to structure and design a sentence, paragraph, and article.  &lt;/p&gt;

&lt;p&gt;Now, as a programmer, I read code for similar reasons. I read code to enhance my  programming knowledge and learn how to design better programs.&lt;/p&gt;

&lt;p&gt;As I see it, in both cases, reading is just part of the job. You need to continually read in order to continually improve your skills as a writer of prose or code. &lt;/p&gt;

&lt;h2&gt;
  
  
  Reading vs Doing
&lt;/h2&gt;

&lt;p&gt;Writing code and reading it are two different skill sets. Athletes make the distinction clear. &lt;/p&gt;

&lt;p&gt;You’ll often hear about athletes who watch their game films. At first it seems like a basketball player isn’t getting any better when glued to the television watching last night’s game. After all, they’re &lt;em&gt;watching&lt;/em&gt; the game, not &lt;em&gt;playing&lt;/em&gt; it. &lt;/p&gt;

&lt;p&gt;However, there's a good reason why they do it: to get better at &lt;em&gt;reading&lt;/em&gt; the game. As a result, they start seeing patterns. &lt;/p&gt;

&lt;p&gt;They see the opening to take the three-point shot, which they passed up at the end of the quarter. They pick up tricks from the all-star point-guard on the opposing team. In short, they evaluate their own performance and see room for improvement. &lt;/p&gt;

&lt;p&gt;The “reading” informs the “doing.” So when the next practice or game rolls around, they’ll apply what they learned from “reading” the films. &lt;/p&gt;

&lt;h2&gt;
  
  
  Reading Informs Writing
&lt;/h2&gt;

&lt;p&gt;Reading code is like an athlete who watches their game films. There’s a lot to gain when you become a vast reader.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. See patterns.&lt;/strong&gt; Train your mind and eye to spot situations to use a particular algorithm, function, or data structure. If you encounter a problem that uses reduce(), there’s a good chance that you’ll encounter another problem that’ll use it.&lt;/p&gt;

&lt;p&gt;When you read code, you familiarize yourself with such situations. So when you work on a related problem in the future, you’ll recognize the pattern and know what to reach for.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Learn new strategies to solve the same problem.&lt;/strong&gt; I solved one problem using a list of dictionaries. Then I read the code of another programmer who solved the same problem, but he used &lt;a href="https://docs.python.org/3.6/library/collections.html#collections.defaultdict"&gt;defaultdict&lt;/a&gt;. It turned out to be a much better approach. Same problem, new trick. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Improve code design.&lt;/strong&gt; It’s been said that easy reading is hard writing. That’s true for writing both prose and code. &lt;/p&gt;

&lt;p&gt;When you read code written by a great programmer, see how easy it is to read. Variables are well named. Each function has its purpose. It’s effortless reading in part because it’s a well-designed program. It’s something to strive for.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Spot bugs better.&lt;/strong&gt; We’ve got to find a bug before we can fix it, which can be tricky. And here’s where reading code comes in: the more efficiently you can read and understand code, the more quickly you can find and correct the errors.&lt;/p&gt;

&lt;p&gt;That’s because, as a vast reader of code, you anticipate what each line of code should do and what it should return. You’re familiar with the errors that can occur and can read and understand them, too. This helps you zero in and find what’s causing your issue.  &lt;/p&gt;

&lt;h1&gt;
  
  
  Become a Better Reader
&lt;/h1&gt;

&lt;p&gt;Consider using these three ways to get better at reading code. &lt;/p&gt;

&lt;h2&gt;
  
  
  Follow Ben Franklin’s Lead
&lt;/h2&gt;

&lt;p&gt;I’ve &lt;a href="https://amymhaddad.com/how-ben-franklin-can-help-you-become-a-better-programmer.mdx"&gt;written before&lt;/a&gt; on a learning tactic that Ben Franklin used to become a better writer. I’ve modified it and use it to become a better programmer.&lt;/p&gt;

&lt;p&gt;It’s a favorite of mine because it emphasizes reading, studying, and emulating quality code. Here’s how it works.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Solve a problem&lt;/strong&gt;. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Find a programmer&lt;/strong&gt; who’s better than you and who's solved the same problem. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Study their solution&lt;/strong&gt;. This is a crucial step: read each line of code and type a comment in your editor to explain it. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Re-solve the same program after some time has passed&lt;/strong&gt;. Use the comments you typed out as hints to guide you along the way.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compare your program&lt;/strong&gt; to the one you studied.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The benefits of this practice are many. You’ll expand your programming knowledge. You’ll see good code design. You’ll train your eye to see patterns to use certain algorithms for a given type of problem or when it makes sense to use one data structure over another. &lt;/p&gt;

&lt;p&gt;In short, expose yourself to good habits. You’ll learn a ton and your programming skills will grow. &lt;/p&gt;

&lt;h2&gt;
  
  
  Solve Problems on LeetCode
&lt;/h2&gt;

&lt;p&gt;Solving problems on the website LeetCode offers an important benefit: it provides in-depth solutions to problems. Oftentimes there are multiple solutions with explanations.&lt;/p&gt;

&lt;p&gt;This is hugely beneficial when it comes to reading code.&lt;/p&gt;

&lt;p&gt;For one, you’ll see multiple ways to solve the same problem. That way, when you come across a related problem (and you will), you’ll be armed with several different approaches. &lt;/p&gt;

&lt;p&gt;The solutions may be written in a language you don’t know, and that’s okay. Try to figure it out.&lt;/p&gt;

&lt;p&gt;Reading code in a language that you don’t know can be a benefit, not a detriment. It’s a practice dealing with ambiguity, which is what we do each day as programmers. Reading code in a foreign tongue gives you that practice. &lt;/p&gt;

&lt;h2&gt;
  
  
  Recycle Your Own Problems
&lt;/h2&gt;

&lt;p&gt;There have been times when I’ve been confused by my own code. (Did I really write that?!)  &lt;/p&gt;

&lt;p&gt;I use it as a learning opportunity. Here's what this practice looks like.&lt;/p&gt;

&lt;p&gt;Solve a problem, and make a note in your calendar to re-solve in a few days or weeks. Then re-solve it and compare your solutions. &lt;/p&gt;

&lt;p&gt;Just like tennis players re-watch their matches to study their serve, you’re studying the solutions you wrote. &lt;/p&gt;

&lt;p&gt;Read both solutions carefully. What were you trying to do originally? What did you do better this second time around, and why? What changed? What would you do differently if you were to solve the problem yet again?&lt;/p&gt;

&lt;p&gt;The goal here is self-improvement: read your solutions to understand what is better and why. &lt;/p&gt;

&lt;h1&gt;
  
  
  Be a Better Programmer
&lt;/h1&gt;

&lt;p&gt;A programmer does a lot of things. Writing code is one of them. So is reading it.&lt;/p&gt;

&lt;p&gt;In the end, being able to read code can help you to write it. It’s circular. Reading code matters and we ought to strive to get better at it. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Programmer and writer: &lt;a href="https://amymhaddad.com/"&gt;amymhaddad.com&lt;/a&gt; | &lt;a href="https://programmerspyramid.com/"&gt;programmerspyramid.com&lt;/a&gt; | I tweet about programming, learning, and productivity &lt;a href="https://twitter.com/amymhaddad"&gt;@amymhaddad&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://amymhaddad.com/why-reading-code-matters"&gt;amymhaddad.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Get Better at Solving Programming Problems</title>
      <dc:creator>Amy Haddad</dc:creator>
      <pubDate>Tue, 16 Feb 2021 15:08:43 +0000</pubDate>
      <link>https://dev.to/amymhaddad/how-to-get-better-at-solving-programming-problems-23j5</link>
      <guid>https://dev.to/amymhaddad/how-to-get-better-at-solving-programming-problems-23j5</guid>
      <description>&lt;p&gt;Most of us have been given the same advice: to become a better problem solver, you need to solve more problems. But this advice is too simplistic. Getting good at anything requires more than just reps. It’s also &lt;em&gt;how&lt;/em&gt; you go about it.&lt;/p&gt;

&lt;p&gt;Besides, when programmers hear the advice “solve more problems,” they often think that “more” means faster. It’s a mistake I made when starting out. &lt;/p&gt;

&lt;p&gt;The problem-solving treadmill can be detrimental to learning and improving. Early on I’d speed through one problem and head to the next. But the reality of that approach soon set in. By focusing on quantity, I compromised quality and missed key learnings along the way.   &lt;/p&gt;

&lt;p&gt;It’s not to say that repetition doesn’t matter; it does. However, repetition alone doesn’t get to the heart of the matter. The process does.&lt;/p&gt;

&lt;p&gt;I have a vested interest in this topic: I want to get better at solving problems in order to improve as a programmer. So here I offer my plan of attack. It involves reps to be sure—and a whole lot more.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Solve a Variety of Problems on a Variety of Platforms
&lt;/h2&gt;

&lt;p&gt;“I was obsessed with HackerRank when I began learning to code,” said an instructor of a Python course I was taking. Although it’s fine to have a favorite platform, don’t limit yourself to a single one. Here’s why: you need to be ready for anything.&lt;/p&gt;

&lt;p&gt;One goal of mine is to toggle smoothly among different problem types and across different platforms. The problems on Interview Cake are different than those in Reuven Lerner’s book, &lt;em&gt;Python Workout&lt;/em&gt;. Likewise I find the problem statements in Lerner’s Weekly Python Exercise different from those on HackerRank.&lt;/p&gt;

&lt;p&gt;I have my preferences, to be sure. However, I need to be able to solve problems of all types. So I’m using a variety of platforms and resources to get practice.&lt;/p&gt;

&lt;p&gt;Here are some examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;LeetCode&lt;/li&gt;
&lt;li&gt;Interview Cake&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Cracking the Coding Interview&lt;/em&gt; by Gayle Laakmann McDowell&lt;/li&gt;
&lt;li&gt;Exercism&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Python Workout&lt;/em&gt; by Reuven Lerner&lt;/li&gt;
&lt;li&gt;Weekly Python Exercise by Reuven Lerner&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On Sundays, when I make &lt;a href="https://amymhaddad.com/working-in-blocks-of-time"&gt;my plan&lt;/a&gt; for the week ahead, I select a few problems from the above resources. I’m deliberate about it. For example, I’ll pick a problem that focuses on binary search from LeetCode. Then, one that focuses on data structures from one of Reuven Lerner’s sources. &lt;/p&gt;

&lt;p&gt;This practice prevents me from getting too comfortable. I can’t rely on the same data structure or technique. I need to be able to pick the best tool for the job. I’ve got to be able to pivot. &lt;/p&gt;

&lt;p&gt;It also challenges me. That’s because I select problems that push me to the edge of my limits, a feature of what psychologist Anders Ericsson calls “deliberate practice.”&lt;/p&gt;

&lt;p&gt;Deliberate practice is all about skill development. It’s a fully-focused, conscious effort that takes you out of your “comfort zone,” centers on a specific goal, and “demands near-maximal effort,” Ericsson explains in his excellent book, &lt;em&gt;Peak&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;In other words, you’re not going through the motions doing something that comes easy or natural. “The hallmark of . . . deliberate practice,” Ericsson writes, “is that you try to do something you cannot do.”&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Cross-Train Your Programming Brain
&lt;/h2&gt;

&lt;p&gt;You often hear about athletes who incorporate cross-training into their routine. For example, a runner completes a bike workout or two each week. It makes a lot of sense: by cross-training athletes push their cardiovascular fitness from a different angle.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://amymhaddad.com/why-you-should-cross-train-your-programming-brain"&gt;Cross-training for programmers&lt;/a&gt; is a topic I’ve written about before. Yet, more needs to be said about the benefits of this approach. Just like an athlete cross-trains to improve their cardiovascular fitness, I’m incorporating cross-training to improve my mental fitness. &lt;/p&gt;

&lt;p&gt;My cross-training involves solving math problems. I apply the same tactics I’d use to solve a programming problem but in mathematics. Same process, different context. &lt;/p&gt;

&lt;p&gt;My current math book provides the cross-training benefits mentioned above. But it’s doing something more: it’s helping me build my intuition for solving problems. &lt;/p&gt;

&lt;p&gt;That’s an important point. I don’t want to memorize a math equation or process. I want to intuitively know when to use it. The same is true when solving programming problems.  &lt;/p&gt;

&lt;h2&gt;
  
  
  3. Learn from Your Solutions
&lt;/h2&gt;

&lt;p&gt;All of us get stuck and all of us get errors while problem-solving. We use these failures to help us figure out what to do differently. &lt;/p&gt;

&lt;p&gt;Oftentimes that’s where the learning stops. Once we’ve solved the problem we’re anxious to move along. But don’t. &lt;/p&gt;

&lt;p&gt;Mathematician Richard Hamming suggests that’s when the learning should begin. &lt;/p&gt;

&lt;p&gt;“I regard the study of successes as being basically more important than the study of failures...there are so many ways of being wrong and so few of being right, studying successes is more efficient,” Hamming writes in his book, &lt;em&gt;The Art of Doing Science and Engineering&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This idea of "looking back" and studying your successes is a topic I've &lt;a href="https://www.freecodecamp.org/news/when-are-you-done-with-a-programming-problem/"&gt;written about previously&lt;/a&gt;, and it's worth noting again.&lt;br&gt;
You always hear about how we need to "learn from our failures." But Hamming is right: there's so much to learn from our successes.&lt;/p&gt;

&lt;p&gt;So one of the biggest changes I’ve made to my problem-solving process is putting Hamming’s words to practice. I vividly recall solving my first problem that involved a linked list, a data structure that was new to me at the time. After I solved the problem, I studied it intently. I copied my solution into a Google Doc file and used comments to explain the code to myself. &lt;/p&gt;

&lt;p&gt;I wanted to ensure I clearly understood &lt;em&gt;what&lt;/em&gt; I did and &lt;em&gt;why&lt;/em&gt; for this critical reason: so I could do it again. &lt;/p&gt;

&lt;h2&gt;
  
  
  4. Get Feedback
&lt;/h2&gt;

&lt;p&gt;Awareness can be a wonderful teacher. &lt;/p&gt;

&lt;p&gt;Don’t assume your solutions are great. Find out for yourself by getting feedback. Feedback is a critical factor when it comes to getting better. It’s also a component of deliberate practice.&lt;/p&gt;

&lt;p&gt;There are two ways I’m getting feedback.&lt;/p&gt;

&lt;p&gt;First, after I complete a problem, I study the solutions of others. Sometimes resources, like LeetCode and &lt;em&gt;Cracking the Coding Interview&lt;/em&gt;, provide the solution. Other times I find the solution of a programmer who’s solved the same problem. Sometimes use both.&lt;/p&gt;

&lt;p&gt;Either way, the next step is the same: I start at the top of the solution and explain each line in my own words. I speculate &lt;em&gt;why&lt;/em&gt; the programmer chose this particular data structure, for example. Then, I write a short summary of the program to solidify the core concepts or new approaches that I just learned about.&lt;/p&gt;

&lt;p&gt;Putting something complicated, like a line of code, into your own words is a great test to see if you really understand it. Plus, you get practice at another core skill: &lt;a href="https://amymhaddad.com/why-reading-code-matters"&gt;reading code&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If there’s something that’s new to me, I research it. I compare their code to my own. I study. I evaluate. I learn. It’s an arduous process, but I get so much from it.&lt;/p&gt;

&lt;p&gt;The second way to get feedback is to simply ask another programmer for it. Video calls are helpful to step through code line by line in real time. Although, pull requests are useful, too.&lt;/p&gt;

&lt;p&gt;There’s a point to the feedback: apply it! Put your learnings into practice.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Be Consistent
&lt;/h2&gt;

&lt;p&gt;Now let’s talk about repetition. Problem-solving is a skill. Like any skill, it takes time to build. It simply doesn’t happen overnight or over a weekend. That’s why I devote time each day to problem-solving. &lt;/p&gt;

&lt;p&gt;There’s a common reaction to this daily practice: “There’s too much to learn. I can’t spend time each day problem-solving.”&lt;/p&gt;

&lt;p&gt;My response is two-fold. First, there’s always going to be something more to learn, &lt;em&gt;always&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;Second, in large part programming &lt;em&gt;is&lt;/em&gt; problem-solving. It's fundamental to our craft. It’s worthy of your time and attention each day. Here’s the caveat: make your daily practice intentional. &lt;/p&gt;

&lt;h2&gt;
  
  
  It’s an Art
&lt;/h2&gt;

&lt;p&gt;Many people regard problem-solving as an art. I happen to agree with that sentiment. The same can be said for the process itself. &lt;/p&gt;

&lt;p&gt;The ideas outlined in this article are my approach for getting better at problem-solving. Your approach may look very different. The point is this: be intentional about your practice. Quality matters; make each problem count.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Programmer and writer: &lt;a href="https://amymhaddad.com/"&gt;amymhaddad.com&lt;/a&gt; | &lt;a href="https://programmerspyramid.com/"&gt;programmerspyramid.com&lt;/a&gt; | I tweet about programming, learning, and productivity &lt;a href="https://twitter.com/amymhaddad"&gt;@amymhaddad&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://amymhaddad.com/how-to-get-better-at-solving-programming-problems"&gt;amymhaddad.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>productivity</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
