. C # insider Technology

Source: Internet
Author: User

C # Introduction
Microsoft recently announced its latest version. Programming Language C #, which is an object-oriented programming language, will be introduced as part of Visual Studio. C # (pronounced "C-sharp") not only maintains the familiar syntax in C ++, but also contains a large amount of efficient Code And object-oriented features. According to Microsoft product manager, the C # language will be based on the flexibility of C/C ++ Program Members bring more efficient rad development methods. It can be used not only for developing Web service programs, but also for developing powerful system-level programs.
Microsoft has not officially announced the new language technology, which will appear in the form of Visual Studio 7 that Microsoft intends to deliver at the Professional Development Conference in middle July. Visual Studio 7 will be officially available at some time next year.
Layman introduced C # To include techniques that make XML programming easier. Microsoft will enable its next generation of tool software, operating systems, and applications to support XML technology.
The new programming language will also contain Virtual Machine devices. Microsoft officials have publicly stated that the C # technology is not associated with the Java competing technology cool developed by the company last year. Microsoft officials declined to answer whether they planned to provide Microsoft-designed Windows version of Java visual J ++ in Visual Studio 7.
C # features
At present, Microsoft continues to refute its competitor Sun's lawsuit against the change in the Java language, while defending against US anti-monopoly allegations, but at the same time, microsoft's talented programmers are also taking technical remedial measures. That is the C # language they have developed. It is a very similar language to Java. Microsoft knows that even some people in the Microsoft camp also like the Java language, therefore, this time C # is used to satisfy their wishes. This is a perfect language, suitable for various operating systems, and closely integrated with windows.
Microsoft said that this new programming language is not for Java, but it will be a C ++ innovation. This is exactly one of the two main goals pursued by Java (another goal is portability of course ). Microsoft has always dreamed of developing a language that can compete with Java on Windows NT. The Automatic Memory Management of C # And the C language syntax used in the same way as Java seem to make this ideal a reality.
Microsoft called C # a programming language derived from C and C ++ that is "simple, popular, object-oriented, and type-safe, C # aims to integrate the efficiency of Visual Basic and the powerful functions of C ++. But is this statement accurate? Because the structure of C # is similar to that of Visual Basic ActiveX, it is directed at rad developers. At the same time, the statement "C # provides powerful functions of C ++" is slightly exaggerated and may become a void check in the future.
For an object interface update, Microsoft calls it "inheritance". Of course, "inheritance" refers to "object. However, although we often encounter the word "object", few really understand its meaning. Microsoft users and even their employees often mix "objects" with "interfaces. So Microsoft simply uses interfaces to define various objects. As a result, "Object-Oriented Programming" (OOP) is messy by Microsoft. Now, Microsoft is making great strides (although it is still very careful). It integrates the "object" built on interfaces into development tools. However, it goes through the header, and it even calls the update to another object interface "inheritance ".
The benefit of this "inheritance" to programmers is language independence-as long as the interface maintains its compatibility, objects written in Visual Basic can also run well in C # And C ++. However, this feature comes at the cost of real OOP Technology and platform portability. Every object is compiled and registered to the Windows subsystem. As long as you can access this subsystem, you can access this object. Come on! Welcome to the world of. NET and ngws! -- The Windows platform has never completely produced such a complete dependency. Of course, their motives will be doubted by people around the world who are biased against Microsoft. Of course, C #, which relies entirely on this technology, is no exception.
In fact, C # will be the perfect product that relies entirely on Windows. Databases that are entangled in Java SDK, MFC, and set have become the past. Anything you want to put in C # (regardless of the language), as long as the windows. Net subsystem is built and packaged, you can use the Windows Runtime Library.
Use msil to enter. net
When people access Usenet or some newsgroups, there may be issues such as new language and platform effectiveness. What time and effort can we solve these problems? Of course, without solid facts and convincing evidence, even the most helpful response will be reserved by the Authority for his assertions. I did not attend this year's professional Developer Conference (PDC), so my findings are based on the feedback from those participants.
The most basic misunderstanding of Microsoft over the past few weeks is that C # is only an improved version of Visual C ++. This is not the case at all. C # has no direct contact with Java. Its feature settings are inspired by Java. Its syntax is the same as that of Java and comes from C and C ++, but its execution is completely new and only relies on the. NET structure.
C # Is Not A bytecode ). Robert Shu, an employee of Microsoft, described in detail: "C # The Compilation Program produces the 'Microsoft intermediate language (msil )...... However, virtual machines or other similar technologies cannot be used to interpret this intermediate language (IL ). On the contrary, whenever an application loads or the JIT compilation program needs to compile it, il will be converted to the cost of code. Once this conversion is completed, the code that can be executed is actually local code ." In essence, although this scheme is a bit like a Java program compiling a program through a jil, the final JIT compilation here is a 100% local code, and the results produced by Java JIT are different.
C # Vulnerabilities
This solution also exposes some interesting vulnerabilities in Microsoft's introduction to C # And. net. Msil is a new feature provided by. Net that allows popular programming languages to be compiled into a separate public language. (. NET supports an astonishing variety of languages ). These languages must follow a framework called Cls. Microsoft calls it "a common language for CLS compatibility between languages and class libraries ".
Compiling all languages to a single public language enables "inheritance" to be truly executed through multiple languages. This easily removes the concept of errors that C # may encounter .. The. NET component uses the idispatch of COM, which only allows interface execution. It is much more acceptable than the previous C # comments rated as an OOP language. It may be object-oriented in programming like Java.
However, unfortunately, CLS, a shared language base including msil, only benefits the rad developers and damages the core hardware developers, some people think that the purpose of creating a new programming language is to make full use of it and serve fine-tuning execution capabilities, which is not possible in the CLS world. To be honest, making full use of acceleration is never the only goal of many languages. The only goal of many languages (like Visual Basic and Java rad) is to accelerate and beautify development and expand capabilities, not just the speed at runtime.
Shu Jing Article The mentioned content does include related and noteworthy comments: You can use C ++ to specify. NET and use all the C ++ features in your code. At the same time, because. Net cannot check whether the C ++ code is secure at runtime, the language does not comply with the CLS specifications, and the programs written in it are also restricted. In response, Microsoft added non-standard management extensions to Visual C ++. Code written with these extensions can comply with CLS specifications.
C # You can see exactly where Microsoft is. Because all project compilation relies only on msil and cls jit to compile the program. In this way, C # or any msil frontend language is faster than Java at any time. Unfortunately, program design and compilation optimization cannot be fully utilized on non-Microsoft platforms. net.
Java is the competitor of C #
Although. Net was created by Microsoft, it is not only available on Windows. Microsoft is ready to provide traditional help to those COM objects (all Ole and ActiveX will become a legacy platform after the next generation of viual studio is launched ). However,. NET will not be built around COM. The new platform will undoubtedly supplement COM and work with it almost seamlessly, but it will not rely on com at all. This indicates that this structure can be expanded on the Macintosh, Unix. beox. In this case, except that the CLS architecture is platform-independent, C # uses the same platform as all Cls-compliant databases. That is to say, they all follow Cls. If a native msil compiler is effective on the platform, they can compile for any structure at runtime. Microsoft also actively strives to be accepted by the ECMA standard, and their previous JavaScript has been accepted. When Visual Studio. NET is launched, the Development Group will certainly have different responses. "Microsoft has developed a new platform", which has been used to scare those who are worried about the dominance of the Microsoft platform. However, the more important thing is that the C # or. NET strategy does not pose too much threat to the original C ++, so it is reasonable to infer that C # And. net will be a strong competitor of Java. On the contrary, Java VM runs applications by translating bytecode. CLS is compiled locally at runtime. The Java platform only supports the Java language .. Net only supports msil, but some unrestricted advanced languages such as C #, Visual Basic, and even Eiffel and COBOL can start msil. Java uses execution transfer to provide real OOP technology. This is also true for msil and C. On the Java platform, the project can be expanded as a product directory by simply moving the level files. It is said that the. NET platform project can also be easily expanded, unlike the project based on registry-happy COM. Perhaps the true advantage of the Java platform lies only in the political correctness-it was not developed by Microsoft and currently has thousands of persistent religious followers.
Author's opinion
Ironically, although I know Java and C # Well, I am still named a senior Visual Basic programmer. People will think that a VB designer like me will be opposed to Microsoft's paranoia. But I also have to face the reality. To be honest, VB is a rad development tool. Don't focus on the beauty, don't remember the real object. Quick results are the top priority. In the business world, pure technologies and results cannot always be consistent. Short-term results tend to outperform long-term productivity. This is unfortunate, but it is true in many companies. These companies are major users of C. Will I use C? Of course! I am using Visual Basic now, but what is the problem of transferring to C? I like the beauty of Java and OOP, but because of all my projects, short-term results have always been better than long-term results, and I have no time to consider replacing Windows. However, from the perspective of pure technology and belief, Java and C ++ programmers have enough reason to pay attention to C #, which is another way Microsoft maintains its monopoly.
Finally, is C # good or not? So, because the "inheritance" here refers to the re-execution of the interface, it is not a real oop. If you are Microsoft, or if you rely on Microsoft technology and are not ready to switch the platform, C # is great, and it will provide a good foundation for vbprogrammers to handle Java and C ++ skills (because the syntax is shared ). However, Microsoft will make every effort to launch C #, so Java and C ++ advocates will certainly design new languages and fight back. At the same time, C # may not be transferred to other platforms, nor can it truly reflect the value of OOP, or even be harmful to beginners of OOP.

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.