K
K
kernel02015-10-14 11:39:03
Yii
kernel0, 2015-10-14 11:39:03

Is OOP considered obsolete in high-load projects?

Hello! Having settled down on a new job, he immediately began to conflict with the boss. His position is that YII and other modern php frameworks, design patterns, OOP in general are all obsolete technologies. The project needs to be rewritten anew in the style of functional programming.
Here is a quote from him:
“I read a mountain of information about different approaches to startup architecture, so now the picture is clear for me. Writing in OOP is like writing in .NET and other outdated platforms. You can, of course, but why? Their time has long passed. "
My position is that the man is a degenerate.
Who is right?
EDIT: if you're very interested, here's how this "genius" required me to code cloud.mail.ru

Answer the question

In order to leave comments, you need to log in

19 answer(s)
M
Mikhail Osher, 2015-10-14
@miraage

The man is a degenerate, that's for sure.
// EDIT
Looked at the attached sources. I put holy water in my eyes.
Throw it all away, show him, for example, PHP: The Right Way .
If I were you, I would resign without hesitation.

A
Adamos, 2015-10-14
@Adamos

Balance.
If the project is really highly loaded, but simple as a stool, then the person is right, the less abstractions there are in the code, the less overhead.
But if the project is not only highly loaded, but also complex, you will break your brain making it functional. Functions are good where simple solutions are needed. If you can break down the whole architecture into simple solutions - you don't need OOP. If you cannot, then without it the project will choke in its own complexity.

O
OnYourLips, 2015-10-14
@OnYourLips

Degenerate.
Quit (on a trial period it's easy, you don't need to work out), you don't need to prove anything to him.
And give him a link to this question too.
1. First, he (or you, when retelling) confuses the functional and procedural paradigms. I don't think OP was actually meant.
2. Second , OOP is a great tool for reducing complexity . And it is very important in high-load projects, allowing you to drastically reduce the cost of development and support.
3. Thirdly, he does not know anything about optimization if he tries to preemptively apply it in a place that is not bottleneck. The bottleneck is the architecture.

D
Dmitry Entelis, 2015-10-14
@DmitriyEntelis

The guy is not great in the sense that a completely functional approach is not cool at all, but at the same time, oddly enough, he is right that complex OOP (at least in those highload projects that I saw) was never used.

A
Andrew, 2015-10-14
@allard

I once saw a good comparison on the issue of oop vs procedural programming.
There was something like:
Why in our time wash dishes with your hands if you have a dishwasher nearby. If you need to wash one plate, then you can do it with your hands, and if after the banquet you have a mountain of dishes, then why bother ...
It’s the same with procedural programming, if you need to add some little thing to a project with which you don’t familiar, then why not write one function and insert its call where necessary, this will be a normal option. But if you want to develop a giant project to work with large amounts of different data, then there is no way without OOP.
I think the idea is clear. Just to write something serious on functions, you will drown in your code, new developers will spend a lot of time understanding the structure of the project. Moreover, you will have to write a bunch of bicycles that are already implemented in OOP versions and are successfully used by hundreds of thousands of programmers ...
Yes, the procedural approach outperforms OOP by a couple of percent, well, maybe by five percent in some projects. Simply, it's hard to compare performance, because. not a single serious project is developed in standard php in a procedural style (think yii or laravel on functions). Well, apart from some specific engines like kphp.
Losing a bunch of OOP advantages for the sake of a couple of percent of CPU time makes no sense at all.
Moreover, in our time there are a lot of cloud services, any project can be scaled ...
I would say this, there is no need to return to the dashing 2000s, you need to strive forward. Php develops and develops towards opp, so why lag behind progress?!

R
Rafael™, 2015-10-14
@maxminimus

Get out of
here right away The brain wasn't given to you to be fucked by your boss There's nothing worse in life than being forced to work with idiots
, especially in the office brilliant architects At the same time changing hired slaves regularly Without feeding such people, they will not grow at your expense

B
bromzh, 2015-10-14
@bromzh

Only the Sith make everything absolute. OOP is good for some cases, but not for others. The same is true for any other paradigm. And it is very stupid to choose technologies only on the basis of general fashion.

M
malroc, 2015-10-14
@malroc

Well, when ONE at least somewhat popular framework built on functional programming instead of OOP comes out, then there will be a subject for conversation.
While nothing similar is visible even on the horizon, there is nothing to talk about at all. Is he going to make his own bike? Well, you can sympathize then. Both him and you at the same time. Look for a new job.

I
index0h, 2015-10-15
@index0h

A common demonstration of the Dunning-Kruger effect .

S
Saboteur, 2015-10-14
@saboteur_kiev

If the project will be written by 1-2 people for up to a month, then functional programming is also possible.
OOP was invented so that a complex and large project could be competently and conveniently divided into parts that work as independently as possible from each other, and which are developed and maintained by people who have almost no contact with each other.
The OOP approach - just provides the architecture that reduces the likelihood of a fakap from inconsistency in actions.
In functional programming, if you need to contribute some little thing, then most likely you need to familiarize yourself with the whole project, and not just one object, which makes it inexpressibly difficult to maintain and introduce new people to the project.
All.
As for the speed of work, the approaches have nothing to do with it, the approaches affect the speed and convenience of development and support, and the work of the product directly in production depends on the curvature.

A
Anton Tikhomirov, 2015-10-22
@Acuna

Above, everything has already been explained in great detail on the fingers why all this is pure nonsense. Personally, I will not tell you that you need to quit, I will only say that completely rewriting a large project is extremely difficult and simply humiliating. If only because there is nothing worse than realizing that you are wasting all your time on meaningless things, that is, re-creating what is already functioning well and so. Your hands will drop already in the second month of such "work", mark me at the word. I just gave you an idea to think about, think about it at your leisure.

I
Ilya Bobkov, 2015-10-14
@heksen

OOP is faster.

M
MetaDone, 2015-10-14
@MetaDone

Everything has its place
habrahabr.ru/company/vkontakte/blog/214877 - I don’t know how things are going with OOP now
But rewriting again if the site successfully copes with what it has is unreasonable, and your boss, apparently, is not particularly in the subject

S
Stanislav Gorovoy, 2015-10-14
@Cnfc19932

It is quite possible that the man is right. Everything is too specific. It is very upsetting sometimes to see articles like "using functional python", as if this is something unusual, many developers have already muddled their brains with abstractions so much that they do not see simple solutions.

D
Dmitry, 2015-10-14
@mytmid

There is an assumption that your boss has read a lot about KPHP (VKontakte).
Also, he obviously does not realize what problems it will cost him.
For a company, not using a framework is tantamount to suicide.
Perhaps you should try to explain to your boss all the advantages of using OOP, frameworks in a form that is intelligible to a non-programmer.
PS "I use only functional approach" or "I use only OOP and OOP frameworks" - these are two extremes, each of which has its own application. If a person wants to do without OOP, let him write in C, there is no such good there :)

U
unclechu, 2015-10-22
@unclechu

In general, you can draw an evolutionary chain:
The procedural approach is the worst of the list in terms of maintaining the code in the long run, the complexity grows exponentially, in a large project it's hell.
OOP - Better than procedural.
Functionality is better than OOP, and even more so than procedural.
This is if it is clumsy and represent the world as black or white.
But in general, judging by the described picture, the man read a lot of buzzwords from books and clichés that they say here is a silver bullet for you, everything else is the bottom. Technology is certainly too early to declare obsolete, rather, the fashion for functionality is innovative (though by no means new). Although the idea is good in my opinion, but with such an approach it will not lead to good, especially without zeal and understanding on your part.
In addition, FYP does not cancel frameworks.

J
jaxel, 2015-10-14
@jaxel

Neighing from the code. It doesn't even smell like procedural programming. Why does he need PHP at all, the same thing can be written on bare HTML and it will generally fly :)
PS: I think it's worth throwing a link to this discussion to the boss.

R
Ruslan, 2015-10-22
@mitrm

EDIT: if you're very interested, here's how this "genius" required me to code cloud.mail.ru

I wrote code like this when I just started to study web technologies on my own using Popov's "courses".

K
Kirill Levunin, 2017-08-12
@klevunin

In high-loaded projects, fronted should be as simple as possible and be performed as much as possible on the client side, processing an array of data from the cache. And if there is no cache, then go to a primitive backend, which receives an array of data from anywhere in one request. It is clear that this is not even PHP. Well, the cache needs to be warmed up and not wait for someone to request something.
All new data, or analysis and preparation of data, is processed by queues. Here you already need to think about the code that can be normally maintained. And OOP will be there because without it there will be pain in the ass.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question