Question:
the point of object oriented programming?
Hancock7886
2009-07-28 09:14:04 UTC
im learning to use classes in c++ and i understand the syntax but not the concept. i want be able to comprehend this stuff before i go looking for internships in software engineering. could sum 1 plz give an example what type of program i would use classes for? dont give any code, but in the fashion of, "if i were told to write a program that does________. "

also how hard was it for u to learn a programming language and get an internship?
Five answers:
2009-07-28 10:06:20 UTC
You can use OO design (which is more what you are alluding to) for anything. It is just more applicable in some cases. OOP is just a way to code up an application - without a good design behind it the result can be very poor.



The point of OO is to break a problem down into it's constituent parts that makes it easier to understand, design, implement and maintain. HOPEFULLY. I've seen a number of bad solutions in my time.





The theory is that if you can encapsulate the behaviour of something in the system into an object that hides how it does something, but not what it does then you get the benefits of OO. The development of the object is easier because it is wholly contained and protected. It doesn't care what the rest of the system does. It hides how it works so no one is dependent on that implementation.



Development of the program is easier because you are not worried about understanding the details within an object. You just look at what it can do for you.



It is best applied to programs where clear definitions of things that maintain state and have behaviour exist. For example, programming an ATM could have classes for users, transactions, the hardware in the system. A simple backup program could have classes for storage media (tape, vs. disk, vs. off line systems), and files (to read, to archive, to restore).



Good reusable and extensible (can I modify it to do more) OO takes a lot of practices and a lot of thought. Not something that should be taken lightly.





It takes many people a while to truly understand the concept and how best to apply it. Using the programming language is the easy part. Creating something practical and usable takes more time.
?
2009-07-28 09:20:07 UTC
The concept of classes in OOP is core and central to it as a whole. Classes allow you to encapsulate and package functions and objects for later use. This is so you don't have to reinvent the wheel and rewrite commonly used code.



Any program written in OOP or C++ will most likely use some sort of classes. It doesn't really take a special program.



For example, I want to write a program for driving a car. Well the actual forward progression driving movement could be its own class. This way whenever I need to move the car it doesn't matter whether the car is going in reverse or if its turning - after I adjust the direction I can use the driving class to actually move the car rather than rewriting the driving code each and every time the car's direction changes.
icefyre
2009-07-28 09:24:34 UTC
Well, learning programming wasn't that difficult. It is learning how to write code well and spotting bugs that was difficult. The most difficult thing was to learn how to think like a programmer and break down the program into the correct subparts.



As for OOP. You usually use OOP on projects where the objects can be used for other projects. When you write functions you write them so that you won't have to repeat code in your project, similarly when you write objects you are writing them so you won't have to repeat the code in other programming projects. Also, other programmers don't have to know how your object does what it does, they just have to know what it is capable of doing and how to call the methods inside of the object.

The two concepts you need to understand are abstraction and encapsulation (you can look them up on wikipedia or in dictionary.com)



It is not hard to find an internship as a software engineer, at least it wasn't a couple of years ago when I was doing it. Just learn your stuff and look up programming interview questions so that you have ready answers. You have to know data structures as well normally (e.g. binary trees and linked lists...) and algorithms (e.g. sorting algos like quicksort and mergsort). The interviews are usually not too difficult, though there are exceptions such as Microsoft (I found their interviews very difficult) and probably Google and Yahoo will also require you to know a lot more than you would normally learn from college.

The most important thing to know is that you need to read and learn independently, what you learn from college is only an introduction and you need to program a lot independently because the practice you get at school is just not enough.



Hope this helps!
Rich J
2009-07-28 09:19:02 UTC
The point is that using OOP makes your code more reusable for future use, as well as makes you reduce large problems into smaller more manageable steps. a google search for benefits of oop can give you a big long list, but those are the 2 big reasons i always like it.



if you're taking classes, it will take a couple years before you master c++. you can probably get an internship closer toward getting your degree, once you can theorize and write code on your own.
?
2016-05-29 17:55:33 UTC
which language u r using ? OOP doesnt allow data to flow freely . it partitions the memory area into objects and create a copy of each data into these memories and uses the member functions to manipulate these data for each object ....


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...