Good online explanation of OOP?

In summary, in OOP, variables are called attributes and are embedded within objects. Public set and get methods are just needed to make these attributes accessible to other objects, because it's considered a good practice to put attributes as private.
  • #1
aychamo
375
0
Hey guys

Does anyone know of an excellent online source that can explain the basics of OOP? I grew up not using OOP, just using the normal style of programming (and its' name escapes me now). You know, just line by line, ahh, yes, sequential.

I understand the very extreme basics, like a child class inside of a class can inherit properties from it's parent class. And I think methods are like procedures/functions. ..

I ask because I downloaded SharpDevelop and I'd like to start messing around in C#. I'm going to try a simple program just to get used to things. I see all these get and put methods, and it seems there are no variables anymore? I dunno.

Any links? Thank you kindly.
 
Computer science news on Phys.org
  • #3
The Object Oriented Analysis and Design book from Booch is almost the best guide to object orientation. But since you want sources from the www you can find this article very useful
http://www.toa.com/pub/OOBasics.pdf

There's another excellent source for those who got used to other programming paradigms such as structured programming, and want to transit to OOP. Indeed this is the article which my supervisors had suggested years ago to me to read and the one from which I learned OO concepts and their justification. I suggest you to read it all because it is also very entertaining.
http://web.engr.oregonstate.edu/~budd/Books/oopintro2e/info/chap01.pdf

I see all these get and put methods, and it seems there are no variables anymore? I dunno.
Yes, there exist variables in OOP but they are called attributes and are embedded within objects. Public set and get methods are just needed to make these attributes accessible to other objects, because it's considered a good practice to put attributes as private. You can have intermediate variables also inside methods. In hybrid languages like C++ you can have them in main() or global outside main().
 
Last edited by a moderator:

1. What is OOP and why is it important?

OOP stands for Object-Oriented Programming and it is a programming paradigm that focuses on creating objects that have properties and behaviors. It is important because it allows for efficient and organized code, easier maintenance and updates, and the ability to reuse code.

2. What are the main principles of OOP?

The main principles of OOP are abstraction, encapsulation, inheritance, and polymorphism. Abstraction refers to the ability to hide complex details and only show relevant information. Encapsulation is the practice of keeping data and code together within an object. Inheritance allows for the creation of new classes based on existing classes, inheriting properties and behaviors. Polymorphism allows objects to take on different forms and behave differently depending on the situation.

3. How is OOP different from other programming paradigms?

OOP differs from other programming paradigms such as procedural programming or functional programming in that it focuses on objects and their interactions rather than just a series of instructions. It allows for a more modular and organized approach to programming.

4. What are the key concepts of OOP?

The key concepts of OOP are classes, objects, methods, attributes, and inheritance. Classes are templates for creating objects, which are instances of a class. Methods are functions that can be called on objects to perform specific actions. Attributes are the properties of an object. Inheritance allows for the sharing of properties and behaviors between classes.

5. What are some real-world applications of OOP?

OOP has many real-world applications, some of which include web development, game development, and software development. It is also commonly used in creating user interfaces, databases, and mobile applications. Essentially, any project that requires organized and efficient code can benefit from using OOP principles.

Similar threads

  • Programming and Computer Science
Replies
10
Views
2K
  • Programming and Computer Science
Replies
24
Views
3K
  • Programming and Computer Science
Replies
32
Views
5K
  • Programming and Computer Science
Replies
5
Views
774
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
2
Replies
43
Views
2K
  • Special and General Relativity
Replies
13
Views
1K
  • Computing and Technology
Replies
2
Views
2K
  • Programming and Computer Science
Replies
5
Views
5K
Replies
6
Views
1K
Back
Top