Home arrow ASP.NET arrow Page 2 - Prerequisites For .NET Programming
ASP.NET

Prerequisites For .NET Programming


The .NET framework and all of its languages are quite large, and can take quite a while to learn in their entirety. If you've never programmed in an object-orientated language before, then you should know a couple of things before jumping into .NET programming. In this article, James will provide you with primers for the object-orientated paradigm, as well as the concept of a namespace.

Author Info:
By: James Yang
Rating: 5 stars5 stars5 stars5 stars5 stars / 20
January 06, 2002
TABLE OF CONTENTS:
  1. · Prerequisites For .NET Programming
  2. · Object-orientated programming
  3. · Namespaces
  4. · Conclusion

print this article
SEARCH DEVARTICLES

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.
blog comments powered by Disqus
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

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials