The agony of millions of programmers-choose vb.net or C #
Source: Internet
Author: User
Program | Programmers over the past year, the various discussion areas on the Internet, or emails, have discussed the advantages of Microsoft's vb.net and C #. The main question around these discussions is, which one should I learn first, VB. NET or C #?
The purpose of my writing this article is to help you solve this problem. I'm not trying to shake you. What kind of language do you prefer to solve some of the basic issues of doubt, so that everyone can make their own decisions, choose a language that they feel most comfortable to use. I will try to avoid discussing some grammatical ambiguities, like "C # has too many parentheses," "VB." NET sentence is too verbose, "or" I hate C # (or vb.net) because it can (or cannot) be case-sensitive. "Sort of thing. Commenting on the grammar is a matter of your personal taste. Instead, I will focus on some of the technical aspects of the two languages that I have seen in the discussion.
In the C # aspect
As the latest language of Microsoft, and because it is a small replica of the Java language, C # has aroused widespread concern.
People seem to like a language just because it's up to date, and program developers always like to work with the latest tools. Some other reasons for using C # are more specific.
The things that lead the trend are always impeccable.
"If I am going to learn a new language, I should still learn C #." "That's probably what you hear often," he said. That reasoning always goes something like this: "The change of VB6 to vb.net is so great that it's basically a new language." If I'm going to learn a new language anyway, I'd like to learn C #, because it's especially for. NET class is designed for libraries. ”
This is the most pale argument I've ever heard about both. You can also confidently say that if I am going to learn a new language anyway, I would like to learn vb.net, after all, it is also a new language. Also, let's think about why vb.net has evolved so violently from its pioneers: it has been redesigned to accommodate the library of. NET classes.
Compare managed and not managed code
"C # allows me to write unmanaged code that runs outside of CLS memory control, and I can access the memory directly and use pointers." Allowing code to run freely, including the use of storage management, can be more efficient. There are 3 questions to consider: first, we should not discuss performance issues in the beta version of the development environment. For example: in. NET Beta1 and BETA2 versions have a significant improvement in the running speed of the management code. Second, we can't quantify the benefits of unmanaged code over admin code and whether it's worth taking risks for these benefits. Check out this article on MSDN by Eric Gunnerson. Third, although vb.net cannot establish unmanaged code, it can access and work with unmanaged memory through the use of System.Runtime.InteropServices namespaces.
C # has a built-in XML file builder
The C # compiler includes an XML file builder that is directly embedded into the source code. If I use C #, I write the code and compile the file at the same time. "People who have used Javadoc know how useful it is to add your documentation to your source code," he said. Source code and documentation can be updated at the same time, so your document will never be obsolete in theory at least. However, in my experience, a relatively small number of Java developers are still using Javadoc. So the question becomes, "Will you use it?" If your answer to this question is yes, you have enough reason to try C #.
And what about vb.net?
In the view of many real developers, VB is like a toy language, from a certain point of view, it is true. So far, VB is far more than the two or three weaknesses we know. But VB.net is really as powerful as C #. NET development language. Some people say it's more powerful.
Vb. NET has built-in (insert feature) support;
"VB. NET built a lot of things like string manipulation (Mid, INSTR, etc.) and type conversions (e.g. CInt). C # lacks these built-in support, so what I need is hard to find in C #.
If you catch these you should mid or CInt function, and ultimately think that this is vb.net stronger than C # evidence, you'd better go to see Microsoft.VisualBasic namespace. You will find most vb.net internal commands and application functions there. Once these features have been saved in namespace, any CLS-compliant language can use them, as shown in listing a. These examples weaken our argument, don't they?
Better bundled support is not supported
"VB. NET and COM entity bundle support is better. "I just saw a little bit of it, and I decided not to have any reason to support it again." From what I have observed so far, this is not true. C # and vb.net must use runtime callable packaging and equivalent source code to execute an earlier entity. Similarly, executing a late entity requires the same amount of code.
Vb. NET uses background compilation in the IDE
If you can't find another example of a good development environment in VB, you have to at least admit that its source code editing is very characteristic. You can literally exclude errors from your code while typing. Trouble is, those are retarded. Compile error message boxes always bounce, and if you turn your horn too loud, the beep may scare you.
Visual Studio.NET avoids this scare until you have modified it and handled some negative errors, prompting the system to go through Microsoft's improvements: He would underline the error statements below.
Vb. NET background compiler/Syntax checker is very complex and very polite to point out your mistakes. In some ways, it can tell you more accurately how to modify your source code errors. When C # has its own grammar checker, and can detect parentheses matching, calculate the number of parentheses, show the missing semicolon, but it still can not be used as simple as vb.net. It would really annoy me to continue discussing the superiority of both languages, but Microsoft's words are indeed a truth, and that is all. NET languages are all created on an equal footing. Those who argue that C # is superior to vb.net (and vice versa) are just as wrong as those who are comparing wages.
I would like to stress that visionary technology companies are no longer looking for programmers with some kind of development language experience, but rather looking for those who have. NET class Library development experience programmer. So I advise you not to worry too much about what your choice is: Just find a language that you feel interested in learning, and carefully learn his frame structure.
If you end up thinking I'm wrong and the market doesn't require you to choose a language, just laugh at me.
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