Friday, January 8, 2010

Can anyone please describe the difference between object oriented programming and non-object oriented program?

The difference is in the whole approach. As is the case with most emerging technologies, things start out simple, and then the demands become more and more complex. The first computer could fill an entire building and was little more than a scientific calculator. Needless to say programs were simple, and linear. Non-object oriented just means that the program is sequentially designed much like that of a function. This doesn't mean that a sequential language like C, can't be used to create object oriented programs, it just means it's not designed for that and will be hard to do. And that's precisely the point. By the time computer technology got to where programs were getting larger and more distributed, it became evident that we needed to be able to write programs that could handle the needs of modern environments. Essentially that means:





-Expandability


-Modularity


-Security/Type Safety


-More built-in memory manipulation/optimized hashes





This was the basics of Bjarn Stroustrup's invention of C++ which is just the object oriented upgrade to C. C++ (which is the definitive object oriented language), can be used to write programs that are millions of lines of code, without the need for every single engineer to know what all those other lines are doing. That is modularity. Modularity means you define an interface and as long as you know what that interface does, you don't need to know exactly how it does it, so you can concentrate on your own code. C++'s design is also expandable, meaning you can write code that is easily upgraded to handle larger and more complex versions of the same basic idea. For example you could write a program that is designed to basically do some processing on some simple data. But then let's say your program becomes popular and you need to upgrade it. If you designed it properly, C++'s capabilities enable you to use your generic program as a foundation for many other different and more complex programs which all utilize the same basic concept you originally envisioned.





Aside from this general description, there's lots of other advantages to object-oriented programming, however, that doesn't mean it's always the best design solution for your needs. Sometimes you just need a simple sequential program, and writing a complex object-oriented architecture doesn't make any sense.

No comments:

Post a Comment