Editor’s recommendation:

Hi, I’m your friend Pongo.

I probably gave up and picked up about four times before I decided to go all the way with programming, and I’m not the only one I’ve observed with data science students.

The slow and tedious learning process, and the frustration that comes with it, are all reasons to fall by the wayside. So I started thinking about how to eliminate the unnecessary barriers that do keep people from becoming qualified programmers. Learning will be difficult, but we should at least reduce unnecessary barriers.

Here are 10 tips to help you get over obstacles faster and feel more accomplished. If you’ve been writing code for years, many of these tips might not seem very useful, but they’re a different story for novices. And even if you’re an experienced programmer, you might see a time-saving tip or two.

10 Tips

Split screen

In most cases, I recommend splitting the screen into two side-by-side panels when learning programming — one for your Jupyter Notebook and one for your browser, which is used to view documents, Stack Overflow, and some tutorials. If you have a small screen, get a larger one if you can afford it. In the United States, you can buy a 25-inch monitor on Amazon for more than $100. As you get more proficient, you’ll want to focus on one task — use keyboard shortcuts to switch between split and full screen. On Mac, I like to use BetterSnapTool, but if you’re running Windows, check out this article (excelcampus.com/tips/sp).

Shielding interference

Silence your computer and phone. Put the phone away if you can. If you’re in a noisy place, put on some quiet, pure music or use noise-canceling headphones. The more you can concentrate, the faster you will learn.

Write the sample code yourself

You can’t read a tutorial and remember it. There’s no real value in copying and pasting. You have to write it yourself, then figure out how to expand it, and then type it from memory. “In theory, there is no difference between theory and practice. But in practice there is.” — Benjamin Brewster (not yogi Berra who said it first)

View of

After learning a new concept, test yourself again in a few days. Research shows that when it comes to remembering something over the long term, repeating it every once in a while is more effective than simply memorizing it.

Learn by teaching others

If you can teach others, you know everything. Explaining a concept clearly to others (oral or written) forces you to understand the essence of the concept, establish relationships, and create analogies that cement connections in your mind. This technique is part of Feynman’s learning technique.

Make a good language base and then adjust the library

Understand a programming language well before using a well-written library. Learning variable types can be boring, and calling classes with properties and methods seems more advanced. But once you have a good understanding of the language, the library is much easier to use. This can reduce errors and save a lot of time.

Learn one thing at a time

Don’t try to study two things at once and you won’t just study twice, you’ll study tenfold. For the same reason, don’t get distracted by the glitter. Find a place to save alluring urls that don’t relate to what you’re learning. Chrome’s One Tab plugin works great.

Sleep, exercise, and maintain resilience

Keep your brain in tip-top shape and keep neural connections active. If you want to learn more about techniques that can help you stay in shape, take a look at the book Memorable Python.

Speed up typing

The more times you type special symbols, the faster you will type. However, there is just one small thing you can do to speed up the process in a big way — learn good touch typing. This website (speedcoder.net/lessons/) is a SpeedCoder exercise.

Learn to use shortcut keys

Here are three shortcuts to use:

  • Chrome: support.google.com/chro)

  • Mac :support.apple.com/en-us

  • Windows :support.microsoft.com/e

If you’re a data scientist or analyst, I’ve cleaned up the Jupyter Lab shortcuts on Github (gist.github.com/discdiv). You can create a shortcut for Mac or Linux terminals by adding ~/. Bash_profile :alias gs=”git status” to the Bash configuration file of ~/. Then restart your terminal, and you’ll need to type two keys instead of two words.

Benefits: How to quickly fix bugs in your code

This topic is so big and so underappreciated that I’m wondering if I need to write about it. This part is a bonus: “a five-step quick fix for mistakes.”

Every programmer will encounter many mistakes. When you’re experienced, you probably shrug your shoulders when you make mistakes, because you can fix them in a minute.

But for beginners, an error can take 20 times or more to fix. For starters, mistakes can make you feel ankle-deep in mud.

These five steps will help you solve 95% of your errors quickly.

See if there’s a code typo

There may be missing parentheses or misspelled variables or functions. So be sure to type in software that provides code highlighting to avoid errors or to quickly fix indentation, parentheses, and the like. There are many good code editors to choose from. If you’re new, I recommend VSCode — it has the largest market share, is free, and has a lot of convenient features.

Read the beginning and end of the error message first

The middle part of the error message is less useful than the beginning and end. Then look at your code and see if you can follow the prompts in the error message to figure out what the problem is. If you can’t decode the error message quickly, copy and paste the last line of the message into Google (if you’re using Python), other languages may have error messages before this as well). The biggest rookie mistake is not googling the error information as quickly as possible.

Sift through the web resources to distinguish the good from the bad

Here are some inspirational ways to quickly find quality resources. Stack Overflow, Medium, Reddit, Hacker News, Dev, and other online communities have feedback mechanisms (likes, etc.) to show which answers are of high quality. These methods aren’t perfect, but they usually work well. Most of the solutions are found in the Issues section of Stack Overflow, Towards Data Science, and GitHub.

In Google’s search results, the quality of a blog is the key to success or failure. If you use Python, I can recommend some good sites based on my experience:

  • Real Python (realpython.com/)

  • Data School (dataschool.io/)

  • Dataquest Blog (dataquest.io/blog/)

  • DataCamp Blog (datacamp.com/community/)

  • Practical Business Python (pbpython.com/)

  • Chris Albon (chrisalbon.com/#)

Filtering old resources

For most problems, you need resources from the last few years. So when you search For a wrong solution on Google, you can filter out old results by, for example, setting a time limit in your search criteria, or visually filtering out results by scanning through snippets of results.

For example, if you’re new to Python, Python 2 in 2009 probably won’t help you.

Apis evolve, and methods used in the past often don’t work today. You’re more likely to find an answer that works in relatively recent results.

Read error messages

This site (inventwithpython.com/bl) documents what common error messages mean in Python, and this site (pythonForbiologists.com) can help you resolve common Python errors.

There are many common errors if you use Python’s pandas library for data processing. Here (gist.github.com/discdiv) is a list of common mistakes I’ve sorted out with Jupyter Notebook and their solutions.

conclusion

With the right mindset, some guidance, and a lot of practice, anyone can learn to program. The process may not be quick or easy, but hopefully this article will make it a little less frustrating.

Medium by Jeff Hale. Compiled by Heart of the Machine. Participation: Wang Zijia, Mayo. Source: link.zhihu.com/?target=htt…