FACTOID # 19: Cheap sloppy joes: Looking for reduced-price lunches for schoolchildren? Head for Oklahoma!
 
 Home   Encyclopedia   Statistics   States A-Z   Flags   Maps   FAQ   About 
   
 
WHAT'S NEW
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > C Sharp programming language

C# (pronounced see-sharp) is an object-oriented programming language developed by Microsoft as part of their .NET initiative. Microsoft based C# on C++ and Java. C# was designed to balance power (the C++ influence) with rapid development (the Visual Basic, Delphi programming language, and Java influences). In computer science, Object-oriented programming, OOP for short, is a computer programming style that emphasizes the following concepts: Objects - Packaging data and functionality together into units within a running computer program; objects are the basis of modularity and structure in an object-oriented computer program. ... A programming language or computer language is a standardized communication technique for expressing instructions to a computer. ... Microsoft Corporation, (NASDAQ: MSFT) headquartered in Redmond, Washington, USA, was founded in 1975 by Bill Gates and Paul Allen. ... This article needs to be re-written. ... C++ (pronounced see plus plus) is a general-purpose computer programming language. ... Java is an object-oriented programming language developed initially by James Gosling and colleagues at Sun Microsystems. ... Rapid application development (RAD), is a software programming technique that allows quick development of software applications. ... Visual Basic (VB) is an event driven programming language and associated development environment, created by Microsoft. ... Delphi is a programming language and software development environment. ...

Contents

Language features

C# is, in some sense, the programming language which most directly reflects the underlying .NET Framework on which all .NET programs run, and it depends strongly on this framework; there is no such thing as an unmanaged C# program. Its primitive datatypes are objects of the corresponding .NET types, it is garbage-collected, and many of its abstractions, such as its classes, interfaces, delegates, exceptions, and so on, expose explicit features of the .NET runtime. In computing, garbage collection is a system of automatic memory management which seeks to reclaim memory used by objects which will never be referenced in the future. ...


Compared to C and C++, the language is restricted or enhanced in a number of ways, including but not limited to the following:

  • Raw pointers and unchecked arithmetic can only be used in a special unsafe mode. Most object access is done through safe references, which cannot be made invalid, and most arithmetic is checked for overflow.
  • Objects cannot be explicitly freed, but instead are garbage collected when no more references to them exist (although deallocation can be encouraged by destroying references). This prevents dangling references.
  • Destructors (see object lifetime) are not available. The closest equivalent is the Disposable interface, which, together with the using block construct, can enforce that an object's resources are promptly deallocated. Finalizers are also provided, but as in Java, these are not prompt.
  • As in Java, only single inheritance is available, but a class can implement any number of abstract interfaces. This functions mainly to simplify the runtime's implementation.
  • C# is more typesafe than C++. The only implicit conversions by default are safe conversions, such as widening of integers and conversion from a derived type to a base type. There are no implicit conversions between booleans and integers, between enumeration members and integers, no void pointers (although references to Object are similar), and any user-defined implicit conversion must be explicitly marked as such, unlike C++'s copy constructors.
  • Syntax for array declaration is different ("int[] a = new int[5]" instead of "int a[5]").
  • Enumeration members are placed in their own namespace.
  • C# has no templates, but C# 2.0 has generics.
  • Properties are available, which enable methods to be called using syntax that resembles data member access.
  • Full reflection is available.

Although C# is often considered similar to Java, there are also a number of notable differences with this language as well, including the following: In computer science, the object lifetime (or life cycle) of an object in object-oriented programming is the time between an objects creation (also known as instantiation or construction) till the object is no longer used, and is destructed or freed. ... This article may be too technical for most readers to understand. ... In computer science, the object lifetime (or life cycle) of an object in object-oriented programming is the time between an objects creation (also known as instantiation or construction) till the object is no longer used, and is destructed or freed. ... In linguistics, syntax is the study of the rules, or patterned relations, that govern the way the words in a sentence come together. ... In computer science, reflection is the ability of a program to examine and possibly modify its high level structure at runtime. ...

  • Java does not have properties or operator overloading
  • Java does not have an unsafe mode permitting native pointer manipulation and unchecked arithmetic.
  • Java has checked exceptions, while C# exceptions are unchecked, as in C++.
  • C# has a goto control flow construct not found in Java.
  • Java uses Javadoc-syntax comments to automatically generate documentation from source files. C# uses XML-based comments for this purpose.
  • C# supports indexers and delegates.

Code libraries

Unlike most other programming languages, no C# implementation currently includes any distinct set of class or function libraries. Instead, C# is tied closely to the .NET Framework, from which C# obtains its runtime functions and classes. The .NET Framework is a class library which can be used from a .NET language to perform tasks from simple data representation and string manipulation to generating dynamic web pages (ASP.NET), XML parsing and reflection. The code is organized into a set of namespaces which group together classes with a similar function, e.g. System.Drawing for graphics, System.Collections for data structures and System.Windows.Forms for the Windows Forms system. In object-oriented programming, a class consists of encapsulated instance variables and subprograms, the methods mentioned below. ... Dynamic HTML or DHTML designates a technique of creating interactive web sites by using a combination of the static markup language HTML, a client-side scripting language (such as JavaScript) and the style definition language Cascading Style Sheets. ... The Extensible Markup Language (XML) is a W3C-recommended general-purpose markup language for creating special-purpose markup languages. ... In computer science, reflection is the ability of a program to examine and possibly modify its high level structure at runtime. ... In many programming languages, a namespace is a context for identifiers. ...


A further level of organisation is provided by the concept of an assembly. An assembly can be a single file or multiple files linked together (through al.exe) which may contain many namespaces and objects. Programs needing classes to perform a particular function might reference assemblies such as System.Drawing.dll and System.Windows.Forms.dll as well as the core library (known as mscorlib.dll in Microsoft's implementation).


Hello world example

Here is a very simple C# program:

 public class ExampleClass { public static void Main() { System.Console.WriteLine("Hello world!"); } } 

The effect is to write the text Hello world! to the output console. Let's break down each element:

 public class ExampleClass 

This is a class definition. It is public, meaning objects in other projects can freely use this class. All the information between the following braces describes this class.

 public static void Main() 

This is the entry point where the program begins execution. It could be called from other code using the syntax ExampleClass.Main(). Don't worry about the public static void part for now.

 System.Console.WriteLine("Hello world!"); 

Here's where the action happens. Console is a system object, representing a command-line console where a program can input and output text. We are calling the Console method WriteLine, which causes the string passed to it to be displayed on the console.


Standardization

Microsoft has submitted C# to the ECMA for formal standardization. In December 2001, ECMA released ECMA-334 C# Language Specification. C# became an ISO standard in 2003 (ISO/IEC 23270). There are independent implementations being worked on, including: Ecma International - European association for standardising information and communication systems came into existence in 1994, when the European Computer Manufacturers Association (ECMA) changed its name in order to reflect the international activities of the organisation (the long form of ECMA was dropped then, and capitalization changed to reflect this). ... Standardization, in the context related to technologies and industries, is the process of establishing a technical standard among competing entities in a market, where this will bring benefits without hurting competition. ... 2001 is a common year starting on Monday of the Gregorian calendar. ... Iso (iso-) is a prefix indicating similarity or equality. ...

More recently, Microsoft has added support in beta releases of Visual Studio 2005 for generics (similar to C++ templates), partial types and some other new features. ECMA/ISO standardization of these new features has been proposed, but they are not currently part of the standard language definition. Mono is the name of an open source project led by Novell (formerly by Ximian) to create an ECMA Standard compliant (Ecma-334 and Ecma-335), .NET compatible set of tools, including a C# compiler, a Common Language Runtime and more. ... Ximian was a company that provided open source desktop applications for Linux and UNIX based on the GNOME platform. ... Open source refers to projects that are open to the public and which draw on other projects that are freely available to the general public. ... DotGNU is a GNU-sponsored project for devising web services, software componentry and the like. ... Portable. ... Free Software Foundation (FSF) is a non-profit organisation founded in 1985 by Richard Stallman to support the free software movement (free as in freedom), and in particular the GNU project. ... Microsoft Corporation, (NASDAQ: MSFT) headquartered in Redmond, Washington, USA, was founded in 1975 by Bill Gates and Paul Allen. ... In computer science, generics is a technique that allows one value to take different datatypes (so-called polymorphism) as long as certain contracts such as subtypes and signature are kept. ... In computer science, generics is a technique that allows one value to take different datatypes (so-called polymorphism) as long as certain contracts such as subtypes and signature are kept. ... In computing, a partial type is a data type definition which spans multiple source code files. ...


Politics

Many of Microsoft’s products and initiatives generate political attention, and C# is no exception. Due to C#’s close relationship with a commercial institution, political discussions continue regarding the legitimacy of C# standardization, its Java similarities, its future as a general-purpose language, and other various debates. Some security experts express skepticism as to the efficacy of the CLR's security mechanisms, and criticise their complexity.


Unlike proprietary languages such as Visual Basic or Java, Microsoft chose to open C# up to the standardization process. However, Microsoft is still a primary force driving changes and innovation in the language. Additionally, Microsoft has made it clear that C#, as well as the other .NET languages, is an important part of its software strategy for both internal use and external consumption. Microsoft takes an active role in marketing the language as part of its overall business strategy.


See also

Wikibooks has more about this subject:

File links The following pages link to this file: Amphibian Animal Abstract algebra Ada programming language Applied mathematics Algebra A Plus Cuisine of the United States Arthropod Active Server Pages Biology Bird Biochemistry Bicycle Bubble tea Botany Battery (electricity) Cell (biology) Bear Bubble and squeak Bash Bat Chordate Chess Cryptography... Wikibooks, previously called Wikimedia Free Textbook Project and Wikimedia-Textbooks, is a sister project to Wikipedia and is part of the Wikimedia foundation, begun on July 10, 2003. ... Mono is the name of an open source project led by Novell (formerly by Ximian) to create an ECMA Standard compliant (Ecma-334 and Ecma-335), .NET compatible set of tools, including a C# compiler, a Common Language Runtime and more. ... The title given to this article is incorrect due to technical limitations. ... Cω (pronounced C Omega) is a free extension to the C# programming language, developed by Microsoft Research in the UK. Cω attempts to mix traditional coding structures and methodology with data storage mediums such as databases and XML documents. ... Nemerle is a hybrid functional, object oriented and imperative programming language for Microsoft . ... Boo is a new, object oriented, statically typed, programming language for the Common Language Infrastructure with a Python-inspired syntax and a special focus on language and compiler extensibility. ... Python is an interpreted, interactive programming language created by Guido van Rossum in 1990. ... The title given to this article is incorrect due to technical limitations. ... This is a comparison of the C# programming language to the Java programming language. ... In computing, Common Language Runtime (CLR) is a runtime environment enabling the exact same code called Common Intermediate Language to run on various computers such as Windows PCs, Unix machines and Macintoshes. ... Anders Hejlsberg is an influential Danish software engineer. ...

External links

Major programming languages (more) (edit (http://en.wikipedia.org/w/index.php?title=Template:Major_programming_languages_small&action=edit))

Industrial: ABAP | Ada | AWK | C | C++ | C# | COBOL | Delphi | Fortran | Java | JavaScript | Lisp | Objective-C | Perl | PHP | PL/SQL | Python | Ruby | SAS | sh | Visual Basic The list of programming langauges is comprised of all notable programming languages in existence, currently or since the dawn of computing. ... ABAP (Advanced Business Application Programming) is a programming language created by the German software company SAP. It is currently positioned as the language for programming SAPs Web Application Server, part of its NetWeaver platform for building business applications. ... Ada is a structured, statically typed programming language, designed by Jean Ichbiah of CII Honeywell Bull in the 1970s. ... AWK is a general purpose computer language that is designed for processing text based data, either in files or data streams. ... The C Programming Language, Brian Kernighan and Dennis Ritchie, the original edition that served for many years as an informal specification of the language The C programming language is a low-level standardized programming language developed in the early 1970s by Ken Thompson and Dennis Ritchie for use on the... C++ (pronounced see plus plus) is a general-purpose computer programming language. ... COBOL is a third-generation programming language. ... Delphi is a programming language and software development environment. ... Fortran (also FORTRAN) is a statically typed, compiled programming language originally developed in the 1950s and still heavily used for scientific computing and numerical computation half a century later. ... Java is an object-oriented programming language developed initially by James Gosling and colleagues at Sun Microsystems. ... JavaScript, in its more modern form, is an object-based scripting programming language based on the concept of prototypes. ... Lisp is a functional programming language family with a long history. ... Objective-C, often referred to as ObjC or more seldomly as Objective C or Obj-C, is an object oriented programming language implemented as an extension to C. It is used primarily on Mac OS X and GNUstep, two environments based on the OpenStep standard, and is the primary language... Programming Republic of Perl logo Perl, also Practical Extraction and Report Language (a backronym, see below), is an interpreted procedural programming language designed by Larry Wall. ... PHP logo PHP is a popular open-source programming language used primarily for developing server-side applications and dynamic web content, and more recently, other software. ... PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporations proprietary server-based extension to the SQL database language, and emulates the Ada programming language. ... Python is an interpreted, interactive programming language created by Guido van Rossum in 1990. ... Ruby is an object-oriented programming language. ... Overview The SAS System is an integrated system of software products (provided by the SAS Institute) that enables the programmer to perform: data entry, retrieval, and management report writing and graphics statistical and mathematical analysis business planning, forecasting, and decision support operations research and project management quality improvement applications development. ... The Bourne shell, or sh, was the default Unix shell of Unix Version 7, and replaced the Thompson shell, whose executable file had the same name, sh. ... Visual Basic (VB) is an event driven programming language and associated development environment, created by Microsoft. ...

Academic: Eiffel | Haskell | Logo | ML | Pascal | Prolog | Scheme | Smalltalk Eiffel is an object-oriented programming language which emphasizes the production of robust software. ... Haskell is a standardized functional programming language with non-strict semantics, named after the logician Haskell Curry. ... The Logo programming language is an adaptation by Wally Feurzeig and Seymour Papert of the Lisp programming language that is easier to read. ... ML is a general-purpose functional programming language developed by Robin Milner and others in the late 1970s at Edinburgh University, whose syntax is inspired by ISWIM. Historically, ML stands for metalanguage as it was conceived to develop proof tactics in the LCF theorem prover (the language of which ML... Pascal is one of the landmark computer programming languages on which generations of students cut their teeth and variants of which are still widely used today. ... Prolog is a logic programming language. ... Scheme is a functional programming language and a dialect of Lisp. ... Smalltalk is a dynamically typed object oriented programming language designed at Xerox PARC by Alan Kay, Dan Ingalls, Ted Kaehler, Adele Goldberg, and others during the 1970s. ...

Historical: ALGOL | APL | BASIC | Clipper | MUMPS | PL/I | Simula ALGOL (short for ALGOrithmic Language) is a programming language originally developed in the mid 1950s which became the de facto standard way to report algorithms in print for almost the next 30 years. ... APL (for A Programming Language, or sometimes Array Processing Language) is an array programming language invented in 1962 by Kenneth E. Iverson while at Harvard University. ... BASIC is a family of high-level programming languages. ... Clipper is a computer programming language that is used to create software programs that originally operated primarily under DOS. Although it is a powerful general-purpose programming language, it was used to create primarily database/business programs. ... PL/I (Programming Language One, pronounced pee el one) is a computer programming language designed for scientific, engineering, and business applications. ... Simula introduced the object-oriented programming paradigm and thus can be considered the first object-oriented programming language and a predecessor to Smalltalk, C++, Java, and all modern class-based object-oriented languages. ...


  Results from FactBites:
 
Programming Language C Sharp Introduction (306 words)
C# has its roots in the C family of languages and will be immediately familiar to C, C++, and Java programmers.
Many programming languages pay little attention to this issue, and, as a result, programs written in those languages break more often than necessary when newer versions of dependent libraries are introduced.
Aspects of C#'s design that were directly influenced by versioning considerations include the separate virtual and override modifiers, the rules for method overload resolution, and support for explicit interface member declarations.
C Sharp programming language (328 words)
C# (pronounced "see sharp") is an object-oriented programming language developed by Microsoft Corporation as part of their.NET initiative.
Unlike languages such as C and C++, C# does not compile to binary code, which can be executed directly by the target computer.
When the program is executed, the.NET framework JITs the intermediate code into machine language as it is run.
  More results at FactBites »

 
 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments

Want to know more?
Search encyclopedia, statistics and forums:

 


Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms, 1022, m