Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is OOP abused in universities? [closed]

I started my college two years ago, and since then I keep hearing "design your classes first". I really ask myself sometimes, should my solution to be a bunch of objects in the first place! Some say that you don't see its benefits because your codebase is very small - university projects. The project size excuse just don't go down my throat. If the solution goes well with the project, I believe it should be the right one also with the macro-version of that project.

I am not saying OOP is bad, I just feel it is abused in classrooms where students like me are told day and night that OOP is the right way.

IMHO, the proper answer shouldn't come from a professor, I prefer to hear it from real engineers in the field.

Is OOP the right approach always?

When is OOP the best approach?

When is OOP a bad approach?

This is a very general question. I am not asking for definite answers, just some real design experience from the field.

I don't care about performance. I am asking about design. I know it is engineering in real life.

==================================================================================

Thankful for all contributions. I chose Nosredna answer, because she addressed my questions in general and convinced me that I was wrong about the following : If the solution goes well with the project, I believe it should be the right one also with the macro-version of that project.

like image 797
Khaled Alshaya Avatar asked Jul 21 '09 21:07

Khaled Alshaya


People also ask

Is object-oriented programming dying?

Object-oriented programming has fulfilled many of its promises. Software systems today are longer-lived and more amenable to change and extension than ever. Nevertheless we observe that object orientation is slowly dying, with the introduction of ever more complex and heterogeneous systems.

Is OOP difficult to maintain?

Initially, it's frustrating and takes a ton of trial-and-error. As a beginner, OOP is also more difficult to read for several non-code related reasons. First, it's near impossible to understand why a piece of code exists if you're unfamiliar with the domain being modeled with classes.

What is OOP good for?

Benefits of OOP OOP language allows to break the program into the bit-sized problems that can be solved easily (one object at a time). The new technology promises greater programmer productivity, better quality of software and lesser maintenance cost. OOP systems can be easily upgraded from small to large systems.


1 Answers

The professors have the disadvantage that they can't put you on huge, nasty programs that go on for years, being worked on by many different programmers. They have to use rather unconvincing toy examples and try to trick you into seeing the bigger picture.

Essentially, they have to scare you into believing that when an HO gauge model train hits you, it'll tear your leg clean off. Only the most convincing profs can do it.


"If the solution goes well with the project, I believe it should be the right one also with the macro-version of that project."

That's where I disagree. A small project fits into your brain. The large version of it might not. To me, the benefit of OO is hiding enough of the details so that the big picture can still be crammed into my head. If you lack OO, you can still manage, but it means finding other ways to hide the complexity.

Keep your eye on the real goal--producing reliable code. OO works well in large programs because it helps you manage complexity. It also can aid in reusability.

But OO isn't the goal. Good code is the goal. If a procedural approach works and never gets complex, you win!

like image 151
Nosredna Avatar answered Oct 02 '22 19:10

Nosredna