How to learn a programming language or framework

Preface

Just after the New Year’s Eve, I believe that many students have looked at their belly and habitually began to make a New Year’s exercise plan. If you still read this article at this time, it means that you love learning (work is not saturated). It’s not the right time to look at dry goods when you’re full of greasy belly. So this time I’ll translate a soft article that guides you how to learn programming languages ​​or frameworks, as a lubricant to open the door for everyone to learn in the New Year.

Since the original text is not written for the front-end, and the readers may be from the front-end background, I have modified and expanded some materials and descriptions to make it easier to understand. Below is the translation.

text

Many new programming languages ​​are born every day, such as Dart, Go, Kotlin, and Elixir, etc. The front-end frameworks are changing with each passing day. Learning a new programming language or framework is not easy, but there are some methods and tricks that can help you master them faster and better.Insert picture description here

Language first, frame second

Take the front-end as an example. Many students who are getting started now come up with React or Vue, and they don't know much about JavaScript itself. The foundation of language is not stable, so when learning and using the framework, it is naturally faltering and difficult. If you don’t know the native JS event mechanism, don’t know the event proxy, capture, and bubbling, you must not be able to master the React event mechanism; if you don’t know the classic this point in JS, then when binding event handling functions to React components , There may be inexplicable errors. There are too many examples like the above, so students should first master the language itself, lay a good foundation, and then learn the framework of the corresponding language. On the one hand, it can better understand the framework, and at the same time, it can avoid the situation of impediment.

Multi-brush programming questions

There are many such websites where you can do various programming language questions (some of them often have programming competitions). By doing these topics, you can learn a lot in grammar, class library and logic. At the same time, this might also be a good way to prepare for an interview.

Shop more on StackOverflow

In the process of programming, you will always encounter problems that you cannot solve by yourself. At this time, remember to go to StackOverflow to ask for help and see if others have encountered similar problems. In addition, there is a dedicated Code Review community on StackOverflow. As long as you post your own code, experts in the corresponding language will review your code and make suggestions for improvement.

For those students who may not be able to open StackOverflow, you can also go to SegmentFault to ask.

Read more code

GitHub is essential in your learning path. Here, you can find many open source projects built with the programming language or framework you are currently learning. You can see how others use these languages ​​and frameworks in production environments and large projects. Moreover, if you are confident and technical, you can also contribute code to open source projects.

Make a project

Generally speaking, when we learn a programming language or framework, we all want to use it to do a project, such as building a blog website, todo application or Baidu Baike website. By actually writing a project, you will improve your abilities in all aspects. There is also a classic website called ToDoMVC. There are todo applications based on various frameworks, which can be described as a must for getting started with frameworks.

Install a lint tool

Nowadays lint tools are getting more and more powerful. Taking ESLint as an example, it can not only check the code format and common errors, but also give many best practice suggestions. Using the lint tool when coding allows you to find possible bugs in the code earlier, and also makes your code look more elegant.

Write authentic code

When I was learning JS, I took the programming knowledge of C# language to JS for granted. This is a good way to learn a new language. However, this method also prevents you from mastering the new language to a certain extent, because it prevents you from learning the most authentic way to write programs in the new language. For example: to convert each value in the matrix into a floating point number, the code is as follows:

const matrixOfFloats = matrixOfAny => {
    
    
  const l = matrixOfAny.length;
  const li = matrixOfAny[0].length;
  const newMatrixOfFloats = [];
  for (let i = 0; i < l; i++) {
    
    
    const row = [];
    for (let j = 0; j < li; j++) {
    
    
      row.push(parseFloat(matrixOfAny[i][j]));
    }
    newMatrixOfFloats.push(row);
  }
};

The more authentic JS writing is like this:

const matrixOfFloat = matrixOfAny => matrixOfAny.map(row =>
  row.map(anything => parseFloat(anything))
);

Don't give up, don't give up

Some languages ​​and frameworks have a steep learning curve and you need time and energy to overcome them. When you encounter a bottleneck, don't give up, because you may not be far from proficient. Please use the resources mentioned above to seek help.

while(true) => study()

I know a programmer who has studied C# for more than 20 years and is still exploring new things in C# and .NET. This person is Antonio Maniero-the most influential Portuguese on StackOverflow. In fact, we can never master all of a programming language, which makes us have to continue to learn. One day, you may be good at certain fields and become a benchmark in that field, but you will find that there is always more to learn.

Insert picture description here

postscript

Most of the methods mentioned by the original author are focused on practical aspects, but we know that learning one thing is just as important as theory. Therefore, I suggest that students read more official documents and more articles and notes of great gods and predecessors when studying. In this way, only theory can guide practice and use practice to verify theory. Finally, I will give you a famous quote.

Zero foundation, learn Java, welcome to join the personal Java learning field .

Guess you like

Origin blog.csdn.net/weixin_49794051/article/details/111476020