magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 2001 > 05 > Programming Feature  

C with a Lot More Class: C#

By John Pearson

It's no secret that because Java and HTML have become the default languages of the Internet, Microsoft needed to come up with something comparable. Thus far, Sun has squabbled with Microsoft over Java licensing and attacked Microsoft's Java offerings in court. Now rumor has it that C# (pronounced "C-Sharp") has been conceived as Microsoft's Java-killer. This new language is clearly a descendant of C++, and it closely resembles Java. In fact, it's enough like both that programmers from either camp should feel somewhat at home with it.

A Closer Look

Will C and C++ programmers have a built-in comfort level with C#? Yes, in the same way that Quick Basic programmers recognize features of Visual Basic. The languages are similar, but C# adds many sophisticated features that C and C++ don't have. For example, see the C# version of the traditional "Hello, World!" program in Example 1.

While the main entry point for a C# program is always a method called Main, the Main method isn't really the "main" one—it's a static method within a class. Like Java, every program is ultimately a class. (Classes can also easily become Web services, as Brian Jepson illustrates in "Applying .Net Web Services.")

The first line of the "Hello, World!" program has a comment that uses the same syntax as C++ (and Java), and the second line indicates that this program uses a namespace called System.<>




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2