站内搜索: 请输入搜索关键词
当前页面: 图书首页 > NET For Java Developers Migrating To C#

NET For Java Developers Migrating To C#

[ directory ] Previous Section Next Section

3.5 Summary

C# was created to appeal to C, C++, and Visual Basic programmers as well as Java programmers. It is an expressive language, and it has several constructs borrowed from other languages and neatly packaged in one API. Its support for unsafe code, enums, delegates, operator overloading, and deterministic cleanup is an attempt to lure C and C++ programmers. At the same time, its use of indexers, properties, and boxing of primitive types makes it easy for Visual Basic programmers to learn the language. As a result, C# often has multiple constructs to achieve a single task. This usually means more constructs for the programmer to learn. Java, on the other hand, models everything as a class or an interface, and therefore the learning curve for Java is fairly short. Java has sacrificed most of C#'s syntactic sugar for the sake of consistency.

Java, however, makes up for the lack of expressiveness through its ability to be able to write portable, cross-platform code.

    [ directory ] Previous Section Next Section