. NET programmer, we should be more professional.

Source: Internet
Author: User
Tags try catch

As we all know, since. NET was born that day, the industry is filled with a derogatory. NET of air. Many companies exclude. Net because. NET inefficiency, plus fear of being kidnapped by Microsoft. Many C + + programmers are biased and despised. NET programmers, who think that those who compare dishes, learn the entry-level language. Java programmers do not see the. NET, we will spring,hibernate wait for a lot of framework, you can not only use the class library what else?

Some of these views are indeed biased, and we can respond forcefully to them. Some of the views are justified and cross-platform. NET is not as good as Java, there is no official multi-platform support, and the operational efficiency is indeed a natural gap with native C + +. But a great part of the responsibility is to blame us. NET programmer.

In fact, each development platform, each programming language has advantages and disadvantages. Do as. NET programmer, we need to be more professional and familiar. NET of the length of the place, the maximization of the use and avoidance.

We should be familiar with the common design patterns, understand dry, shy and other programming principles, professional use of the framework, write professional code. Work for several years, do not let a person see is a rookie.

To have a professional code style, use professional naming. Do not write hundreds of lines of methods, thousands of tens of thousands of rows of the class, which are frequently more than 10 layers of curly braces. More than half of this code I've seen is water.

Be aware that you want to create as few new objects as possible, minimizing IO and reflection operations, especially in loops.

To be aware of validation of customer input, regular expressions are needed to understand how to avoid type conversions as much as possible and to be efficient type conversions.

To understand some basic framework common sense, such as list, dictionary and other collection classes are not thread-safe, know how to ensure thread safety.

Don't write Request.querystring[id]. ToString () and Configurationmanager.appsettings[key]. ToString () Such ridiculous code (I really wonder why more than half people write this), do not go around the superfluous trim and try ... Catch up. When you see this code, connect yourself as a. NET programmer community to feel shame. It's no wonder programmers in other languages despise us and look at us with a rookie eye (see "Doing Java development this year"), because we are.

Actually, originally. NET Although memory consumption is large, but the overall speed is not worse than C + +, which many people have already proved. You can refer to how poor C # performance is, and write efficient C-image processing programs. We want to understand. NET, support for. NET, reflection mechanism and exception handling. NET of advanced features, do not turn them into performance killers for attacks. NET's faction to make knives to send arrows, which in turn cut to. Net. If you are doing an IO and reflection operation over and over again in the loop, hard to int. Parse+try catch to do type conversion, and even lazy to use StringBuilder words, we should really ask, C # unbearable slow, who is the culprit?

I don't know what caused it. NET programmer community is the reason for this situation. I was completely self-taught, and of course I wrote a lot of bad code at the beginning, and now I may be writing it, but at least I'm constantly improving myself. and a lot of. NET programmer, not on the forum, do not read the blog, at most desk put on a 1000-page ". NET Advanced programming (in fact, the low-level programming, the content MSDN All) for reference.

I estimate that not only. Net, most C++/java programmers do not learn and improve all day, everyone needs a variety of life. But at least, in the work can continue to improve it, work for several years to make mistakes of beginners is not justified, can only be attributed to the attitude problem. It could be. NET is much easier to get started than other language platforms, and many of the impetuous beginners have chosen it. Even in some people's eyes, programming is to bread where, as long as the results of the run, the other is not my business. Mediocre programmers can only produce negative productivity (why new people don't program). When I spend a whole day or even longer solving a bug for a maintenance project, I really want to get the developers back and let them dogfood themselves.

Colleagues here, have you ever had a similar feeling? I believe that since you can come to the blog park, you can see this article, should be interested in continuous learning to improve. Everyone is the most hardworking group of programmers, at least from the code style, but also with the daily contact. NET programmer is not a grade. But in reality, a lot of people both pursue professional, and some less professional usage is used to.

For example, today saw an essay on how to write robust code, the students first show a piece of code, and then put forward a lot of improvement ideas, this pursuit of every detail of the practice is worth learning, but the improved code still has a few questions:

If the strictest specification is to be named, the Parsedargs is not changed to _isargsparsed, but the standard camel: argsparsed, and only if the strings are equal or not, you should use equals instead of the CompareTo method The last thing to do is to have a goto statement, which is only a necessity. When the exception is thrown at the end, a specific exception should be thrown and the exception exception should not be thrown under any circumstances.

Here, I strongly recommend to you, if not read, be sure to read the. NET design specification This book, if you have not seen a book before, it should also look at it first. It is the wisdom crystallization of the masters of the design. NET framework, as the development of high quality. NET program, what else is it more authoritative? Reading this book can almost avoid all the usual normative issues, including those presented in the previous paragraph.

There are several people in the garden who write code that is our role model, like Lao Zhao, who assembles his head and so on. Another man had to mention that it was a auspicious day. As a halfway school. NET of old programmers, for ten years, constantly thinking and refactoring the Rights Management system code, you can look at the source of the Dotnet.common namespace description, truly explain the benefits of unified norms. Although people may not like him because of his business behavior, but no one can deny, at least in the professional and professional pursuit, the auspicious on a lucky note.

Finally, I want to the garden. NET programmer colleagues said, also said to themselves, the profession is not from the proof, but from our hearts. We must adhere to their own pursuit, adhere to their own style, to have self-confidence, resolutely and not professional struggle. Positive value of the software, must be from the pursuit of professional developers, we will never write to let the train rear-end scheduling program.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.