nominative typing[*][[nominative typing (major class of type system, in which compatibility and equivalence of data types is determined by explicit declarations and/or the name of the types)|]] inference typing[*][[inference typing (automatic detection of the data type of an expression in a programming language)|]] dynamic typing[*][[dynamic typing (type system paradigm in which objects' types are enforced at runtime)|]]
C# este un limbaj de programare orientat-obiect conceput de Microsoft la sfârșitul anilor 90. A fost conceput ca un concurent pentru limbajul Java. Ca și acesta, C# este un derivat al limbajului de programare C++.
C# și programarea
C# simplifică mult scrierea de programe pentru sistemul de operare Windows, iOS, Android etc. Este un limbaj de programare cross-platform.
Exemplu de program simplu Windows scris în Managed C++ ( C++/CLI) și C#:
Cod scris în Managed C++ ( C++/CLI):
public:
int main(array<System::String ^> ^args)
{
// Activarea efectelor vizuale Windows XP înainte de crearea oricărui control
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// Crearea și rularea ferestrei principale
Application::Run(gcnew Form1());
return 0;
}
Cod scris în C#:
public static void Main()
{
Form1 form1 = new Form1();
form1.Show();
Application.Run(form1);
}
^ abNaugler, David (mai 2007). „C# 2.0 for C++ and Java programmer: conference workshop”. Journal of Computing Sciences in Colleges. 22 (5). Although C# has been strongly influenced by Java it has also been strongly influenced by C++ and is best viewed as a descendant of both C++ and Java.
^Hamilton, Naomi (). „The A-Z of Programming Languages: C#”. Computerworld. Arhivat din original la . Accesat în . We all stand on the shoulders of giants here and every language builds on what went before it so we owe a lot to C, C++, Java, Delphi, all of these other things that came before us. (Anders Hejlsberg)
^Lattner, Chris (). „Chris Lattner's Homepage”. Chris Lattner. Accesat în . The Swift language is the product of tireless effort from a team of language experts, documentation gurus, compiler optimization ninjas, and an incredibly important internal dogfooding group who provided feedback to help refine and battle-test ideas. Of course, it also greatly benefited from the experiences hard-won by many other languages in the field, drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list.