Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the reasons why learning open source can improve programmers' programming skills?

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the reasons why learning open source can improve programmers 'programming skills. The introduction in the article is very detailed and has certain reference value. Interested friends must read it!

Reading code can make you better.

Understand early in your programming career that the more code you read, the better it gets. When I have to maintain someone else's code, simple and clean code is almost always better than fancy or complex code--even with comments. On the other hand, when I spend enough time understanding complex code, I can often learn new skills. Either way, I can improve.

This has led me to push again and again in places where there is no code review. And when I don't have enough time to formally perform a "code review," I browse the repository and read the code myself.

Beyond grammar

When you have to grapple with the syntax of any programming language, that's when you learn how to make the most of it. The syntax of a language tends to be very static, and if you make a mistake, your compiler will complain to you. A deeper lesson deals with what languages are best suited to what problems ("the right tools do the right job") and how to write code in that language so that it is efficient and maintainable.

There are many ways to learn a new language: courses, tutorials, tutors, books, and so on. I usually combine these options to learn a new language. These methods are often very similar when it comes to non-syntax elements.

Reading actual deployment code from others will get you more. Not just regular structured learning, you also need to learn patterns and practices. The "right" way of doing things in language is not always the best way to do things. You will experience edge situations, one-off transactions, and unexpected integrations. You will find solutions to these problems, both good and bad, but if you think about it seriously, then this is where the "recommended practices" come out.

Third, open source is everywhere

As the open source movement grew, the amount of code available to read and learn grew dramatically. Sites like Gitlab, GitHub, and BitBucket allow us to get full-featured apps that we can not only read code but also play with. There are very few things I want to learn that are not available in open source code.

I used to learn new programming languages and focus on simple things like directory structure and naming conventions. But, for now, I'll look at a few different open source projects, and then I can start piecing together common approaches. I don't emphasize that much anymore.

There are so many codes available, but the quality varies. When we want to learn, we often don't know which is good or bad. Keep reading the code, and you'll learn how to tell the difference. Reading "bad" code can help you understand why it's "bad." The key is not to be afraid to try anything that seems right to you, and to admit mistakes when you go wrong, correct them, and move on.

Bad code is bad, isn't it?

Some people say,"Bad code is more obvious than good code."

When I look at the code I wrote before, my first thought is how could I write such rubbish? That actually means I'm still learning. If I look at my old code and think it looks great, then I haven't improved.

So how can we learn from bad code?

The more bad code you read, the better you will be at spotting bad code.

As you study and search for examples, you will find and use a lot of code that doesn't work. Remember, just because it doesn't fit your situation doesn't mean it's bad code. Learning how to make it work can make you better.

How do you know it's bad code?

People love criticism. Read the reviews, if you see a lot of "WTF" then probably what you see is bad code, try to point out why it's bad. Don't just leave comments like "this code sucks." Don't act like you know all the requirements of bad code; know that there's always a good reason why it's written the way it is. If you know why it's bad code, leave a constructive comment.

7. Make it a good code

Put a pull request that makes the code better. Correcting syntax, using better methods, adding comments or modifying indentation: these are great ways to improve code. Add an explanation of why you recommend changing the code.

I find that I learn more when I help others learn. If I think I understand a new topic, I find someone to try to explain it to, which allows me to understand and remember it more deeply, and allows me to quickly discover if I wrote bad code.

VIII. Return

Remember that open source works best when you're involved. Code changes are welcome on most projects, but there are many ways to contribute.

Test open source code and file bug reports; help complete documentation sets; write tutorials and how-to examples; participate in conversations--or just help spread the word. Everything can make a difference, and the more people involved, the better!

The above is "What are the reasons why learning open source can improve programmers 'programming skills?" All the contents of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report