C Sharp
| : | |
|---|---|
| : |
: |
| : |
2001 |
| (): | |
| : | |
| : | |
| : | |
| : |
C# ( ) - . 19982001 Microsoft Microsoft .NET Framework ECMA-334 ISO/IEC 23270.
C# C- , C++ Java. , , ( ), , , , , , , , LINQ, , XML.
C++, Java, Delphi, Smalltalk #, , , , , C# ( C++).
|
|
[]
C# CLR , , , , CLR. , , C#, BCL. , CLR. , CLR 1.1 2.0 C#; . ( C# 3.0, , .NET.) CLR C#, .NET- , , «» . , C#, CLR , C# , VB.NET, J# .
[]
« » ( ) , , , .[4] C++, «++» , 1.
( , . .) , ♯ , # .[5] C# ECMA-334.[6] , (, [7]), .
, - « ».
[]
C# ECMA (ECMA-334)[8] ISO (ISO/IEC 23270)[9].
, , C#, :
[]
C# :
| .NET Framework | Visual Studio | |||||
|---|---|---|---|---|---|---|
| ECMA | ISO/IEC | Microsoft | ||||
| C# 1.0 | 2002 | 2003 | 2002 | 2002 | .NET Framework 1.0 | Visual Studio .NET 2002 |
| C# 1.2 | 2003 | 2003 | .NET Framework 1.1 | Visual Studio .NET 2003 | ||
| C# 2.0 | 2006 | 2006 | 2005[10] | 2005 | .NET Framework 2.0 | Visual Studio 2005 |
| C# 3.0 | [11] | 2007 | 2007 | .NET Framework 3.5 | Visual Studio 2008 | |
| C# 4.0 | 2010 | 2010 | .NET Framework 4 | Visual Studio 2010 | ||
| C# 2.0 | C# 3.0 | C# 4.0 | C# 4.5 () | |
|---|---|---|---|---|
|
|
|
[] 1.0
C# 1998 COOL (C-style Object Oriented Language). 1.0 .NET 2000 , -; C# 1.0 Microsoft Visual Studio .NET 2002 .
C# Java 1.4, : , C# ( , ), ( , ), , , foreach, , , (boxing), , (DLL, COM) .
, C# C++, Java: , ( , C++), , , goto ( ). C# , unsafe .
[] 2.0
C# 2.0 Microsoft 2003 ; 2004 - ( Whidbey), C# 2.0 7 2005 Visual Studio 2005 .NET 2.0.
- 2.0
- ( ).
- , (generics). C++, . , , , , , . .[12]
- ,
yield, Python Ruby. - , .
- '??':
return obj1 ?? obj2;( C# 1.0)return obj1!=null ? obj1 : obj2;. - ('nullable') - ( , ,
int? i = null;), -,null. SQL. - , .Net ( C#).
- 64- , , 64- .
[] 3.0
2004 Microsoft C#3.0.[13] 2005 C# 3.0 - C# 3.0, Visual Studio 2005 .NET 2.0. Visual Studio 2008 .NET 3.5.
- 3.0
C# 3.0 :
-
select, from, where, SQL, XML, . . (, , Language Integrated Query, LINQ) - :
-
Customer c = new Customer(); c.Name = "James"; c.Age=30;
-
Customer c = new Customer { Name = "James", Age = 30 };
- -:
-
listOfFoo.Where(delegate(Foo x) { return x.size > 10; });
-
-
listOfFoo.Where(x => x.size > 10);
- :
- - , , C#- (, SQL).
public static class StringExtensions { public static int ToInt32(this string val) { return Int32.Parse(val); } } // ... string s = "10"; int x = s.ToInt32();
- : (private)
public string Name { get; private set; }
C# 3.0 C# 2.0 MSIL-; . , LINQ , List.FindAll List.RemoveAll.
[] 4.0
C# 4.0 2008 , CTP- Visual Studio 2010.
Visual Basic 10.0 C# 4.0 2010 , Visual Studio 2010.
- 4.0[14]
:
dynamic calc = GetCalculator(); int sum = calc.Add(10, 20); //
public void SomeMethod(int x, int y = 5, int z = 7); //
[] «Hello, World!»
«Hello world» C# :
using System; namespace Example { class Program { static void Main() { Console.WriteLine("Hello World!"); // Console.ReadKey(); // } } }
Windows Forms:
using System; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) // label button { label1.Text = "Hello, World!"; } } }
[]
C#:
- C# csc.exe .NET Framework ( .NET Micro Framework, .NET Compact Framework Silverlight Windows Phone 7).
- Rotor (Shared Source Common Language Infrastructure) Microsoft.
- Mono C# .
- DotGNU C# .
- DotNetAnywhere[15] CLR, C# 2.0.
[] .
| - ? |
[]
- « # C++ Java» ( «C# 2010: » («Accelerated C# 2010») .: , 2010. . 592. ISBN 978-5-8459-1638-9; . 17)
- « C# C C++, Java.», : « C# Java . , C C++, . , , , .» ( «C# ». .: . 2003. . 20).
- #. : . . . : "", 2004. 752 . : . . . . ISBN 5-8459-0563-X (.) . 26-27.
- Kovacs, James C#/.NET History Lesson (September 7, 2007). 21 2011. 23 2011.
- Microsoft C# FAQ. Microsoft.( ) 25 2008.( )
- C# Language Specification. 4th. ECMA International, 2006.
- Visual C#.net Standard (JPEG). Microsoft (September 4, 2003). 21 2011. 18 2009.
- Standard ECMA-334 C# Language Specification, 4rd edition (June 2006)
- ISO/IEC 23270:2003, Information technology C# Language Specification
- Microsoft C# 2.0 2.0. 1.2, .
- C# 3.0 4.0 ECMA ISO/IEC .
- Differences Between C++ Templates and C# Generics (C# Programming Guide)
- MSDN News
- C# Future
- Dot Net Anywhere
[]
- . C# 2010 .NET 4.0 = Pro C# 2010 and the .NET 4.0 Platform. 5- . .: , 2010. . 1392. ISBN 978-5-8459-1682-2
- . C# 4.0: = C# 4.0 The Complete Reference. .: «», 2010. . 1056. ISBN 978-5-8459-1684-6
- . C#: , 2- = C# in Depth, 2nd Edition. .: «», 2011. 544 . ISBN 978-5-8459-1555-9
- , . Visual C# 2010: = Beginning Microsoft Visual C# 2010. .: , 2010. ISBN 978-5-8459-1699-0
- . C# 2010: = Accelerated C# 2010. .: , 2010. . 592. ISBN 978-5-8459-1638-9
- , , , , . C# 4: .NET 4 = Professional C# 4 and .NET 4. .: , 2010. . 1440. ISBN 978-5-8459-1656-3
[]
| C# | |
|---|---|
| 1.0 2.0 3.0 4.0 | |
| Visual C# Visual Studio Mono SharpDevelop Turbo C# | |
| Java .NET Framework Sing# | |
| Ecma International | |
|---|---|
| Borland Turbo C Clang GCC LCC Pelles C PCC TCC Visual C++ (C++/CLI C++/CX) Watcom C/C++ compiler | |
| glibc dietlibc uClibc Newlib Eglibc Bionic | |
| C- | |
| C++ C# D Objective-C Alef Limbo Go Vala | |
| C | C C++ ( ) Pascal C C - Java |