• Good e-commerce,Welcome!
Home > Platform EC > Alibaba

Is C# cross-platform?

| 1Person Answer

C#当然已经是一门彻底的跨平台编程语言,最厉害的是C#是目前除了C++之外唯一一门可以开发移动端和PC端的编程语言,C#除了Windows平台的开发,还搞定了iOS/Android的开发,他还不用像C++一样每个平台都要单独开发一次。

从Mono说起、C#似乎不是真正的跨平台

C#并不是一开始就跨平台的,不像Java/Python/JavaScript/PHP这些编程语言一开始就是跨平台,C#并不是这样,C#设计之初并不是跨平台的。

C#之父也是Delphi之父、安德斯海尔斯伯格从设计C#开始,就把它作为了Windows平台专属的编程工具,因此微软官方并没有像Java一样跨平台。

Xamarin公司主持了一个叫做Mono的开源项目,这个项目的目的就是创建一个开源的

.NET

工具,包括C#编译器以及通用语言架构,与微软官方的

.NET

Framework不同的是,Mono项目不仅仅可以在Windows平台上运行,还可以在Linux、Unix、macOS、FreeBSD、Solaris等,甚至在Playstation 3,Wii以及XBox 360等游戏平台Mono也都能够运行。

后来微软收购了Xamarin这家公司,微软正式推进了C#和

.NET

开源,并且微软官方推出了macOS版本的visual studio,其实就是基于xamarin做的,这可以说是微软正式官方支持了整个微软最核心开发体系的跨平台和开源。

C#能够用在下面这些框架当中

.NET

Core(全平台、完全跨平台支持Linux、Windows、macOS),主要用在服务器端开发,Web应用开发,以及企业系统开发,这方面功能是C++/Java/PHP/Python等编程语言最擅长的事情;

Windows桌面程序开发,主要技术是WPF框架,这个层面的技术是C++最擅长的;

Unity游戏引擎的主要脚本语言,可用来开发PC、Sony、Xbox等游戏平台上的各种游戏,Unity是最为成熟的游戏引擎之一,目前除了Unity最强的是Unreal虚幻引擎,虚幻引擎的主要编程语言则是C++,相对来说C#更低的学习门槛,也让Unity迅速发展成为最火的游戏引擎之一;

开发原生移动应用,除了曾经的Windows phone平台,通过Xamarin的技术,微软实现了iOS/Android原生应用开发,并且与此同时还支持了macOS应用开发;

.NET

标准在上述所有应用程序中使用.net标准创建库。

最后总结一下跨平台编程语言的特点:Java是一次编写到处运行,C++是一次编写针对特定的平台进行编译,C#则本质上仅仅是一门编程语言,想要实现跨平台你需要选择不同的技术栈、不同的框架。

本文由EmacserVimer原创出品,未经许可,任何渠道、平台请勿转载,违者必究。

Professional answer

P

奇点说电商

淘宝、京东、拼多多、跨境电商、自媒体抖音快手、短视频直播教程

C# is of course a completely cross-platform programming language. The most amazing thing is that C# is currently the only programming language besides C++ that can develop for mobile and PC terminals. In addition to the development of the Windows platform, C# has also handled the development of iOS/Android. It does not need to develop for each platform separately like C++.

From Mono, C# does not seem to be truly cross-platform

C# was not cross-platform from the beginning. Unlike Java/Python/JavaScript/PHP, these programming languages ​​are cross-platform from the beginning. C# is not like this. C# was not designed to be cross-platform.

Anders Helsberg, the father of C# and also the father of Delphi, designed C# as a programming tool exclusively for the Windows platform. Therefore, Microsoft did not officially make it cross-platform like Java.

Xamarin hosted an open source project called Mono, the purpose of which was to create an open source

.NET

tool, including a C# compiler and a common language architecture. Unlike Microsoft's official

.NET

Framework, the Mono project can run not only on Windows platforms, but also on Linux, Unix, macOS, FreeBSD, Solaris, etc., and even on gaming platforms such as Playstation 3, Wii and XBox 360.

Later, Microsoft acquired Xamarin, and Microsoft officially promoted the open source of C# and

.NET

. Microsoft also officially launched the macOS version of visual studio, which is actually based on Xamarin. This can be said to be Microsoft's official support for the cross-platform and open source of Microsoft's core development system.

C# can be used in the following frameworks

.NET

Core (all platforms, fully cross-platform support for Linux, Windows, macOS), mainly used in server-side development, Web application development, and enterprise system development, which is what C++/Java/PHP/Python and other programming languages ​​are best at;

Windows desktop program development, the main technology is the WPF framework, this level of technology is what C++ is best at;

The main scripting language of the Unity game engine can be used to develop various games on PC, Sony, Xbox and other game platforms. Unity is one of the most mature game engines. At present, the strongest engine besides Unity is the Unreal Unreal Engine, and the main programming language of the Unreal Engine is C++. Relatively speaking, C#'s lower learning threshold has also made Unity quickly develop into one of the most popular game engines;

Develop native mobile applications. In addition to the former Windows phone platform, Microsoft has realized iOS/Android native application development through Xamarin's technology, and at the same time also supports macOS application development;

.NET

Standard uses .net standard to create libraries in all the above applications.

Finally, let's summarize the characteristics of cross-platform programming languages: Java is written once and run everywhere, C++ is written once and compiled for a specific platform, and C# is essentially just a programming language. To achieve cross-platform, you need to choose different technology stacks and different frameworks.

This article is originally produced by EmacserVimer. Please do not reprint it on any channel or platform without permission. Violators will be held accountable.

Similar Q&A

recommend What is the name of Alibaba's artificial intelligence?

    E-c News Continuously pushing e-commerce knowledge to you

    African netizens use China Africa cross-border e-commerce platform for online shopping
    looking at China's modern business history, the word "profiteer" must be familiar to everyone. To put it bluntly, profiteer is a person who earns a pric...
    how is the new seller of cross-border e-commerce doing?
    I believe many treasure mothers have an idea to do their own business and want to increase their income. Go to work, but you can't take care of your chi...
    how can cross-border e-commerce Amazon sell on Amazon platform without goods?
    cross border e-commerce trade entities in different customs territories conduct trade on the Internet, and then complete the whole transaction through cross-...
    Amazon store opening process and cost analysis!
    With the rapid development of cross-border e-commerce, more and more sellers want to enter Amazon. However, many people are still new to Amazon's cross-...
    Amazon plans to expand its pharmacy business on a large scale and will add same day delivery service
    Amazon Pharmacy says its growth strategy relies on the development and launch of “modular” pharmacies of varying sizes. (Amazon)
    It's convenient! Taobao adds WeChat Pay function
    On September 4th, Taobao and Tmall announced that in order to enhance consumers' shopping experience, Taobao plans to add WeChat payment capabilities an...
    China's Taobao working with startup on deliveries by reusable rocket
    SHENZHEN, China (hb2b) - Chinese rocket maker Space Epoch is working with Alibaba's online shopping platform Taobao to make reusable rockets for express...

    Latest Q&A More

    Popular tags