Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is Object Oriented Programming (OOP)?

object OOP Oriented Programming
0
Posted

What is Object Oriented Programming (OOP)?

0

Traditional programming languages (C, COBOL, FORTRAN…) follow a structured programming model. In this model, data is separately stored and procedural code processes data. For example, in C, data is stored in structures and processing is done by functions. When used on large projects, this type of programming revealed several weaknesses: 1. Not modular: Any of the data is accessible from any piece of code. This made it difficult to demarcate the areas for different teams working on a large project. 2. Not easy to fix: When we go back and make a change in one part of the program, it is difficult to foresee and contain its impact from other parts of the program. 3. Not enough code reuse: Even though function and subroutine libraries were built to promote reuse of code, it was obvious that a way was needed to reuse larger chunks of code. OOP came in to solve some of the above problems. OOP bundles data and the processes which act on that data into a single unit called an object. Objects

0

Quite often I see a question in a newsgroup or forum along the lines of: What is this thing called ‘OOP’? What is so special about it? Why should I use it? How do I use it?. The person asking this type of question usually has experience of non-OO programming and wants to know the benefits of making the switch. Unfortunately most of the replies I have seen have been long on words but short on substance, full of airy-fairy, wishy-washy, meaningless phrases which are absolutely no use at all to man or beast. Having created 1000’s of programs using non-OO languages, and another 500+ using the OO features of PHP I feel more than qualified to add my own contribution to the melting pot. According to some OO ‘purists’ I am not qualified at all as I was not taught to do things ‘their’ way and I refuse to follow ‘their’ methods. My response to that accusation is that there is no such thing as ‘only one true way’ with OOP just as there is no such thing as ‘only one true way’ with religion. People

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.