Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is C# platform neutral?

Today I purchased C# 3.0 Pocket Reference (O'Reilly Publishers).

In that book in the first para of the first page it is given that "The C# language is platform neutral, but it was written to work well with Microsoft .Net platform"

If I am not wrong, Platform Neutral mean that the softwares made from that language should run in all the OS(e.g.Mac, Windows,Linux etc.).

I know that this characteristic is being satisfied by Java but .Net has not yet been able to do that(Though MONO has made some progress in Linux).

Then what is the significance of that word "PLATFORM NEUTRAL" so far c# is concern?

Thanks in advance

like image 756
deeps_rule Avatar asked Dec 13 '09 06:12

deeps_rule


People also ask

What is this C language?

C is an imperative procedural language supporting structured programming, lexical variable scope, and recursion, with a static type system. It was designed to be compiled to provide low-level access to memory and language constructs that map efficiently to machine instructions, all with minimal runtime support.

What is '~' in C language?

In mathematics, the tilde often represents approximation, especially when used in duplicate, and is sometimes called the "equivalency sign." In regular expressions, the tilde is used as an operator in pattern matching, and in C programming, it is used as a bitwise operator representing a unary negation (i.e., "bitwise ...

Is C and C+ Same?

C++ was developed by Bjarne Stroustrup in 1979. C does no support polymorphism, encapsulation, and inheritance which means that C does not support object oriented programming. C++ supports polymorphism, encapsulation, and inheritance because it is an object oriented programming language. C is a subset of C++.

Is C or C+ Better?

Compared to C, C++ has significantly more libraries and functions to use. If you're working with complex software, C++ is a better fit because you have more libraries to rely on. Thinking practically, having knowledge of C++ is often a requirement for a variety of programming roles.


1 Answers

The C#-language itself is platform neutral like C and C++ are - you can implement a compiler et al for it on any platform.

The .Net platform and its associated libraries however, which it was designed to work well with, are not platform neutral in design - they are designed to work on windows, although Mono does compensate somewhat for that.

If you would write a C# program without using any features of any .Net-library it is guaranteed to be platform-independent - you can be sure it will run on any platform that has tools for C#... you just won't have a particularly useful program though ;)

like image 179
Georg Fritzsche Avatar answered Oct 06 '22 01:10

Georg Fritzsche