ASP.NET
  Home arrow ASP.NET arrow Page 2 - Prerequisites For .NET Programming
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Prerequisites For .NET Programming
By: James Yang
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 11
    2002-01-06

    Table of Contents:
  • Prerequisites For .NET Programming
  • Object-orientated programming
  • Namespaces
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Prerequisites For .NET Programming - Object-orientated programming


    (Page 2 of 4 )

    Back in the seventies when programming languages such as Assembly, C and Pascal reigned supreme, the procedural programming paradigm was the most popular way to create a complete application. Procedural programs were executed from start to finish in sequence. Functions and methods could be created and called, however both events and objects were unavailable, making it impossible benefit from object-orientated features such as code reuse, object creation and event handling.

    During the eighties, object-orientated programming methods began to replace procedural ones. As the name suggests, object-orientated programming is based around the creation of objects. An object is an instantiation of a pre-created class, which can expose methods and member variables that can be manipulated and passed around in an orderly fashion.

    To compare procedural programming with object-orientated programming, take a look at the following C and C++ code:

    Procedural C Code:

    #include <stdio.h>

    int main()

    {

    char name[] = "John Doe";

    printf("Your name is %s", name);

    return 0;

    }


    Object-Orientated C++ Code:

    #include <iostream>

    class myClass

    {

    public:

    int x;

    };

    int main()

    {

    myClass mc;

    mc.x = 10;

    cout << mc.x;

    return 0;

    }


    In the first example (procedural programming), our C application runs from top to bottom, without instantiating any objects or responding to any events. In the second example, we have created a new object named mc, which is an instantiation of the myClass class. The "x" attribute of the new object has its value set to 10, and is output to the screen using the operator <<() method of the cout stream (which pipes data directly to the stdout stream).

    As you can see, our object-orientated code contains a complete class declaration, which is easily instantiated by one command. Object-orientated programming follows a logical layout convention and is cleanly structured.

    In terms of current programming languages, both C++ and Java are good examples of object-orientated programming languages. Visual Basic contains some object-orientated features, however it isn’t a truly object-orientated language due to its clumsiness and clutterness.

    Both VB.NET and C# are true object-orientated programming languages. Microsoft used one simple rule when upgrading VB.NET and creating C# from scratch: If one programming language has a feature that the other doesn't, then include that feature in the language that doesn't, so that both languages are up to par with each other.

    This rule has had some beneficial consequences for both languages. Visual Basic developers can now enjoy the true object-orientated style of programming: creating objects, responding to events and code reuse strategies can now be used, and benefit the programmer in many ways. C# is based on the language foundation and structure of C, C++ and Java. C# allows us to create new forms and add controls to those forms using simple drag-and-drop methods. On the other side of the scale, C# is extremely powerful, and can take advantage of classes, respond to events, and promotes strong code reuse habits.

    When developing .NET applications, you will notice just how heavily the object-orientated paradigm is really used. The Object-orientated programming style is complemented by namespaces. Let’s talk about namespaces now.

    More ASP.NET Articles
    More By James Yang


     

    ASP.NET ARTICLES

    - How Caching Means More Ca-ching, Part 2
    - How Caching Means More Ca-ching, Part 1
    - Reading a Delimited File Using ASP.Net and V...
    - What is .Net and Where is ASP.NET?
    - An Object Driven Interface with .Net
    - Create Your Own Guestbook In ASP.NET
    - HTTP File Download Without User Interaction ...
    - Dynamically Using Methods in ASP.NET
    - Changing the Page Size Interactively in a Da...
    - XML Serialization in ASP.NET
    - Using Objects in ASP.NET: Part 1/2
    - IE Web Controls in VB.NET
    - Class Frameworks in VB .NET
    - Cryptographic Objects in C#: Part 1
    - Sample Chapter: Pure ASP.Net







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    Stay green...Green IT