developer.com
Search EarthWeb
CodeGuru | Gamelan | Jars | Wireless | Discussions
Navigate developer.com
Architecture & Design  
Database  
Java
Languages & Tools
Microsoft & .NET
Open Source  
Project Management  
Security  
Techniques  
Voice  
Web Services  
Wireless/Mobile
XML  
Technology Jobs  

   Developer.com Webcasts:
  The Impact of Coding Standards and Code Reviews

  Project Management for the Developer

  Defining Your Own Software Development Methodology

  more Webcasts...




See the Winners!


Developer Jobs

Be a Commerce Partner
Free Business Cards
KVM over IP
Corporate Awards
Domain registration
GPS Devices
Online Shopping
Data Center Solutions
Cell Phones
KVM Switches
Rackmount LCD Monitor
Dental Insurance
Promote Your Website
KVM Switch over IP
PDA Phones & Cases

 

Search
The Business Internet


Download these IBM resources today!
e-Kit: IBM Rational Systems Development Solution
With systems teams under so much pressure to develop products faster, reduce production costs, and react to changing business needs quickly, communication and collaboration seem to get lost. Now, theres a way to improve product quality and communication.

Webcast: Asset Reuse Strategies for Success--Innovate Don't Duplicate!
Searching for, identifying, updating, using and deploying software assets can be a difficult challenge.

eKit: Rational Build Forge Express
Access valuable resources to help you increase staff productivity, compress development cycles and deliver better software, fast.

Download: IBM Data Studio v1.1
Effectively design, develop, deploy and manage your data, databases, and database applications throughout the data management life.

eKit: Rational Asset Manager
Learn how to do more with your reusable assets, learn how Rational Asset Manager tracks and audits your assets in order to utilize them for reuse.
Developer News -
SpringSource's Spring Cleaning For Java    May 1, 2008
Can HP Broaden SOA's Appeal?    April 30, 2008
Sony Ericsson Adds Flash Support to Mobile Java    April 30, 2008
AOL to Open VoIP APIs    April 29, 2008
Free Tech Newsletter -

Project Management Guide: Developing a Web Site. Best Practices, Tips and Strategies. Download Exclusive eBook Now.

.NET Under the Hood: a Little ILDASM
By Kate Gregory

Go to page: 1  2  Next  

From Kate Gregory's Codeguru column, "Using Visual C++ .NET".

One of the really exciting things about working with .NET is the idea of a ".NET language"—a language that emits managed code and conforms to the Common Language Specification. And (at least in theory, anyway) if you write code in two or more of these languages, they will compile to the same intermediate language, or IL.

So, is C++ part of the in-crowd? Does a simple C++ application compile to the same IL as the equivalent Vb or C# application? Let's see.

Three Little Apps...

Here's a little C++ console application:

int _tmain(void)
{
    System::Int32 i;
    for (i=0; i<10; i++)
    {
        Console::WriteLine(__box(i));
    }
    return 0;
}

Here's the equivalent in C#:

static void Main(string[] args)
{
    System.Int32 i;
    for (i=0;i<10;i++)
    {
       Console.WriteLine(i);
    }
}

And the same thing in VB:

Sub Main()
    Dim i As System.Int32
    For i = 0 To 9
        Console.WriteLine(i)
    Next
End Sub

It's an interesting aside to see how names are assigned. I created a blank solution and added projects to it:

  • I named the C++ project SimpleC++, so I got a file called SimpleC++.cpp with a function called _tmain(). There was no namespace or class created.
  • I named the C# project SimpleCSharp (file names can't have the # symbol), so I got a file called Class1.cs. It defines the namespace SimpleCSharp, containing a class called Class1 with a function called Main().
  • I named the VB project SimpleVB, so I got a file called Module 1.vb. It defines the namespace SimpleVB, containing a module called Module1 with a Sub called Main().

All of these console applications do the same thing: print the numbers 0 to 9, one per line, on the console.

Go to page: 1  2  Next  


Tools:
Add www.developer.com to your favorites
Add www.developer.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed


Visual C# Archives

Work With InterSystems. Not Separate Systems. Rapidly develop and deploy connectable applications.
Developing Intelligent Communications? Visit the Avaya DevConnect Center on DevX.
Flash Demo: Learn how IBM Information Server Blade is easy to manage, highly scalable and efficient.
Learn about expanding business opportunities for the reseller channel. Visit IT Channel Planet.
Generate Complete .NET Web Apps in Minutes . Download Iron Speed Designer today.



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Microsoft Article: 7.0, Microsoft's Lucky Version?
Microsoft Article: Hyper-V--The Killer Feature in Windows Server 2008
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Windows Server 2008
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES