How to Think Like a Programmer

Thinking like a programmer primarily means being persistent and meticulous in your attention to details. Jump into programming challenges feet-first, but review your work carefully as you proceed to ensure you don't end up with any bugs in...
Method 1 of 3:

Adopting the Right Ethos

  1. How to Think Like a Programmer Picture 1How to Think Like a Programmer Picture 1
    Be persistent. When you begin a large project, you must steel yourself for what often adds up to hours of work. Besides the initial programming process, you will have to painstakingly examine every dash and apostrophe during your debugging process. Programming can be difficult, but by committing yourself at the outset to seeing your project through to the end, you'll be able to complete it.[1]
    1. Push yourself to get your programming right.
    2. Use short mantras or phrases to encourage yourself. For instance, tell yourself, 'Failure is not an option' or 'I will do what it takes to succeed.'
  2. How to Think Like a Programmer Picture 2How to Think Like a Programmer Picture 2
    Be patient. Programmers engage in time-intensive work. To think like a programmer, avoid losing your patience or giving up in despair. Cultivating patience will help you stick to what you're doing and help you avoid sloppy programming.[2]
    1. For instance, when you're frustrated with your programming or other activity, get up and take a walk. Sometimes getting some fresh air or having even a brief change of scenery can help you decompress and approach your task with renewed energy.
    2. Breathe in and out slowly. Close your eyes and breathe in through your nose for three seconds. Breathe out slowly through your mouth for five seconds.
  3. How to Think Like a Programmer Picture 3How to Think Like a Programmer Picture 3
    Reframe how you think about challenges. Successful programmers will learn to look at a challenging piece of code or a difficult programming project as an opportunity to learn and grow. Instead of allowing yourself to be tortured by a challenge or difficult experience, try to enjoy it.[3] When you're stuck on a programming challenge, try to think about it as a puzzle to be solved, rather than as an impossible, painful chore.[4]
    1. If you've done a great job programming something, pause to congratulate yourself and take pride in your work.
  4. How to Think Like a Programmer Picture 4How to Think Like a Programmer Picture 4
    Keep your eye on the big picture. Programming is always done in the service of some larger goal. Software programming is intended to make great software. Computer programming is meant to create a functional computer. But it can be easy to fall into the trap of trying to make your programming so fluid and beautiful that you only stop when it's perfect, not when it's usable. Always program with high standards for both function and form, but learn to recognize when you've programmed something that is functionally complete.[5]
    1. Thinking like a programmer means getting your task or project done, and not necessarily getting it done in the prettiest possible way.
    2. Don't make great work the enemy of good work.
Method 2 of 3:

Imitating Programmer Methodology

  1. How to Think Like a Programmer Picture 5How to Think Like a Programmer Picture 5
    Start as soon as possible. Programmers think that it's best to jump right into a given programming task immediately, then clean up their work later. If you're not entirely sure how to go about developing your perfect programming plan, that's okay. Just start developing the parts you know how to do and fill in the rest later. To think like a programmer, avoid hesitation and doubt and get to work.[6]
  2. How to Think Like a Programmer Picture 6How to Think Like a Programmer Picture 6
    Break problems into smaller steps. Programmers think in chunks. For instance, instead of seeing a single undifferentiated project or piece of code, they segregate their work into various sections and subsections. To think like a programmer, find a way to subdivide your tasks and develop a step-by-step process to complete each element of the project.[7]
    1. For instance, you might develop a software system by first developing system functions, then developing data entities, then debugging.
  3. How to Think Like a Programmer Picture 7How to Think Like a Programmer Picture 7
    Review your work. Thinking like a programmer means double-checking what you've done. In programmer lingo, this process is known as debugging. Remind yourself upon completion of a task to double-check what you've done for errors or mistakes. Run your code through a debugging program, and if you encounter any snags, re-read your code line by line, scanning for errors until you find what the problem is.[8]
  4. How to Think Like a Programmer Picture 8How to Think Like a Programmer Picture 8
    Use past experience to guide your future work. Don't rush from project to project without thinking about your experiences. After completing one piece of programming, reflect on what you learned and what you struggled with. Look for opportunities to use the solutions you discovered in one programming challenge in other contexts.[9]
    1. Sometimes you can transfer whole chunks of code into other programs or contexts.
    2. Don't just use your past experiences to sharpen your skills. If you're a freelance programmer, use what you learned on one project to decide what sort of programming you're best suited to and what sort of clients you want to work with. You might realize, for instance, that you feel better programming for a nonprofit whose cause you believe in than you do for a random corporation.
Method 3 of 3:

Growing as a Programmer

  1. How to Think Like a Programmer Picture 9How to Think Like a Programmer Picture 9
    Think creatively. Instead of using a standard development tool in a standard way, find ways to experiment and stretch the boundaries of what the programming framework or coding language can do. For instance, instead of coding images to appear as just images, use an image as your web page's background.[10]
    1. You might not be able to flex your creative muscles in your classes or workplace. Work on side projects of your own at home that you can really throw yourself into. This will keep fresh ideas flowing, and prevent you from getting bored.
  2. How to Think Like a Programmer Picture 10How to Think Like a Programmer Picture 10
    Develop a desire to improve your skills. Always aim to level up your abilities. Look for projects that test your skills, or try to develop your own programming projects at home. Spend time learning more programming languages. For instance, if you only know C++, try to learn Java. These new programming languages will not only help make you more marketable to clients, but they will also help you broaden the way you think about programming and the possibilities it holds.[11]
  3. How to Think Like a Programmer Picture 11How to Think Like a Programmer Picture 11
    Ask for help if you need it. When programmers are truly stuck, they look for advice or guidance from others who have been there before. Whether that means talking to a colleague who has more experience with your particular programming problem or consulting a programming forums, never discount the wisdom and assistance of others.[12]
    1. Learn how to ask the right questions, too. In conversation with your colleagues, don't just refer to the problem you're having – refer to the end goal you're trying to accomplish, too. Your fellow programmers might be able to provide an easier way to get your code to do what you want it to.[13]
    2. Check out online programmer communities like Ruby on Rails and Stack Overflow.
5 ★ | 1 Vote