1. 程式人生 > >How to start learning to code

How to start learning to code

Theory & Concepts

I t’s really important to understand the basic programming concepts and build the foundation first. If you are at college now, you’ll be good! Colleges are great in teaching basic concepts and theories. If you’re pursuing a Computer Science degree, you’ll probably have Algorithms and Data Structures classes. But if you are not at college, the internet is here to help you out!

When I started I learned with 2 great online courses: Codecademy & CS50 at Harvard.

That time, I learned the basics with Python on Codecademy and C in CS50. But my opinion is: you just need to start. Choose one programming language and start understanding the basic concepts (variables, if-else, loop

, data structures).

Be language agnostic. Language is just a tool. It’s valuable to know a language deeply, but it’s also valuable to be learning new things. The best developers tend not to identify as a ____ developer. — Gayle Laakmann McDowell

Probably, when you choose a course, they will teach you with a specific programming language. But don’t worry! Focus on the basic concepts (and maybe fall in love with the programming language as I did with

Python and Ruby).

Why did I choose these courses?

As I was searching for something to start, I wanted to deeply understand the concepts and be practical about it. CS50 seemed the best resource to build a solid foundation. David J. Malan is definitely one of the best professors I had. And Codecademy helped a lot about being practical. Train myself to code everything I was learning. Code code code. Remember the tip #5? Find ways to learn the concepts and practice it.

Other resources with great content are:

Introduction to Computer Science by Udacity. It covers pretty much everything you need to start understanding programming. Udacity courses always have “practice time” after each theory and concept you learn.

MIT Introduction to Algorithms. It will teach the algorithmic thinking. Understand algorithms and how it works is the most important thing you should learn when starting your coding journey. Other great resources are algorithms books like Introduction to Algorithm by CLRS, Algorithms by Robert Sedwick.

Here you’ll start overwhelming yourself with the tons of resources we have on the internet. But try not to overwhelm yourself. You don’t need to do every single course, focus on one, learn, practice, build confidence. Remember: it’s a journey. One code at a time :)

Training, Practicing, Coding, Building

Practice Practice Practice. I can’t say enough how practicality is so important when you start learning to code.

Code. A lot… The best way to be a great coder is to just practice — a lot. — Gayle Laakmann McDowell

Practice not only make you a better programmer but also you gain a lot of confidence through this. Impostor Syndrome is a real thing!

As I said at the beginning of this article, I will try to write actionable items for you. Options you can do in your learning journey to be more practical.

As I did, you can start with Codecademy. It has really good content and a great experience to code everything you are learning.

Another great site is Hacker Rank. The website has a lot of programming language options to choose. But not only this, you can also do other domain exercises. I really like Hacker Rank’s problem-solving exercises. You receive a lot of inputs and your algorithm need to pass in all tests.

All Hacker Rank Track

Another thing I’m really passionate about is Competitive Programming. I did it for 2 years at College on competitions like ACM ICPC. Basically, you have a bunch of problems, and you need to implement an algorithm to pass each one. Doing it I gained a lot of confidence in my coding skills, and I feel like I’m a stronger developer after my heavy training and participating in competitions. (Here is my repo on GitHub — I solved a lot of problems).

I’m a heavy user on Quora, and someday I read a great answer by Veni Johanna about “Does competitive programming really help in improving your knowledge and skill set as a developer?”. I’ll write down some skills we gain learning competitive programming:

  1. You have developed habit to convert / model specific problem to an abstract one.
  2. You are used to registering patterns, and matching patterns against your pattern bank.
  3. You know how to concentrate and perform under pressure.
  4. You have awareness and confidence of your own ability and shortcomings as a coder.
  5. You have learned to manage time, especially in terms of your thinking and coding habits.
  6. You are used to well-defined problems.
  7. You are used to having one objective in mind.
  8. You can be stuck in ‘problem solving’ mode.

I loved her comments and agree 100% with each one. Take a look at the full answer. You should. It’s great!

My intention here is to give you the most actionable advice as possible, so I’ll list some great websites for you to start learning and training from day 0.

  • Codeforces: it is a really good website to train and learn. It has tons of great problem sets. Editorial is a plus here (*Editorial: The problem author writes how you should approach and solve the problem — which algorithm or data structure to use).
  • Topcoder: this website is very similar to Codeforces in terms of problems quality and editorial. It is also well known for its tutorials. Each “tutorial” teaches some technique, algorithm, or data structure.
  • Hacker Rank: as I said above, Hacker Rank has a lot of different domains like Algorithms, Data Structures, Mathematics, Programming Languages, etc. The website UI and UX is a plus for Hacker Rank, it is beautiful and very easy to use. I used a lot the Python Domain to build a good foundation on my Python skills.

Now you can choose a website and start practicing :)