Library tutorials & articles
The Quick & Dirty .NET Guide to C#/VB OOP
Introduction
Everyone, I'm sure, who has allowed for more than a passing perusal of .NET must be excited at the power of its Framework. Those with a pure programming background and earlier knowledge of pre-.NET technologies have found those to be sorely lacking in the solidity and methodology of a pure OOP (Object-Oriented Programming) environment and or language.
All newcomers to .NET are faced with a new challenge - adjust their thinking process in programming and undoing many bad habits they've acquired when working with a non-OOP environment. Developers with prior ASP/VBScript experience certainly fell upon these habits simply because it never promoted such practices. Therefore, when coming to .NET it can be quite challenging having to rethink or relearn all "programmed" mindsets.
What I will aim at achieving in this article is to get all non-OOP programmers up to speed with this whole brave new world of thinking when programming. Making an allowance for terms such as classes, objects, properties, structs, overloading, inheritance, abstraction, and polymorphism can seem unapproachable to non-seasoned programmers with insufficient OOP awareness. Therefore, my intention is to cut to the chase with all these methodologies and terms, and demonstrate how they all fit together.
Although this article won't be an exhaustive OOP treatise, its objective nevertheless is to present in a quick and dirty manner C#/VB Object-Oriented Programming. Moreover, even though this article may be slightly geared more towards C#, all important VB assessments or similarities are addressed and demonstrated. By the way, keep in mind C# is very case sensitive. Incidentally, don't be put off at the length of this article, a lot of it is simply repeated code examples for both languages.
This article was originally published on DotNetJunkies
Related articles
Related discussion
-
Compatibility Issue on Firefox to display on Cursor Location
by ansari.wajid (0 replies)
-
An Introduction to VB.NET and Database Programming
by yen (12 replies)
-
Creating a Windows Service in VB.NET
by codet (102 replies)
-
VB/VB.NET
by surath (7 replies)
-
VB.NET or C#?
by siddeshwar (3 replies)
Related podcasts
-
Looking into the C# Crystal Ball with Charlie Calvert and Bill Wagner
One of the most exciting announcements from PDC was the news about C# 4.0 and Visual Studio 2010. With all the excitement and discussion throughout the event about these new developer tools, we reached out to two experts in the fields. Charlie Calvert and Bill Wagner sat down with Keith and Woody...
Related jobs
-
Microsoft .Net Architect
in AMSTERDAM (€50K-€90K per annum)
Events coming up
-
Dec
6
Developing AJAX Web Applications with Castle Monorail
London, United Kingdom
Monorail is the model-view-controller engine of the Castle Project, bringing many of the best ideas of Ruby on Rails to the .NET world. In this talk, David De Florinier and Gojko Adzic show how Monorail makes it easy to develop .NET based AJAX applications, and how to use the Castle Project to build Web 2.0 applications effectively. Come to this session if you are a .NET web developer. Everyone is welcome!
hello,
I am very impressed by your tutorial as it finally allowed me to grasp the syntax behind OOP programming with .net.
Only what I did not understand is how and where do I complile the .cs to a dll? I cannot do it on the server. Do I do it on my local computer and then upload?
http://www.developerfusion.co.uk/show/4341/5/
Honestly I believe that the basic idea of the OOP was really great, but to be able to use it one really has to have the head as a water melon. There is too much theory, too many therms and the class theory really feels like puting each part of the program into a separate box and then figuring out how to drill a way between them. I started to learn C++ OOP at least 20 time and after a couple of weeks I did not even had an idea what it is about (note: I am not a proffesional programmer)...
I believe that: "The use of a programming language should be as simple as a pie and the algorithm should be the part where people spend the most of their time..."
When I do C# programming I do all public and it works great for me. Simply keep it simple!!!
Is there any web page or book where I could find how to do Non-OOP C# programming?
Sincerely,
Gabor Gorcsos
Though from personal experience I'd say 99.99% of the time, you'd want private member variables and public properties...
Hi Ehx,
That's true, and it's funny that in all my other articles I always write all private variables with public properties. i.e. - Building a Full-Featured Custom DataGrid Control. It's just one of those overlooked things. Oh well.
After reading your article, http://www.developerfusion.com/show/4341/6/
I got realy confused!!
from what I know from the book below, I declare private property, then declare public (get , set )
What you presented in your article is you declared public property,then made the (get,set) private)
I have put this simple comparison code , so please advice your point, What is the logic behind reversing the modifier(public to private and vis versa).
thanks
Ehx
// what is in the book (Begining Asp.Net Database using C# p 321)
private string Country;
public string Country
{
get{return _Country;}
set{Country= value;}
}
// what is in web article ( in your article)
public string Name;
private string _Name
{
get{return Name;}
set{Name= value;}
}
This thread is for discussions of The Quick & Dirty .NET Guide to C#/VB OOP.