Message Turncoat in a DM to get moderator attention

Users Online(? lurkers):
2 posts
0 votes

OOP is total shit


Posts: 2320

Anyone that says otherwise has not done Functional Programming.

Prove me wrong

 

Posted Image

 

 

FEAR! FEAR! FEAR! FEAR! FEAR! FEAR!
Posts: 2283
0 votes RE: OOP is total shit

As someone who started with C in high school and who worked in Haskell,Elixir (erlang fork), javascript, C#, PHP etc in his working career, my thoughts on FP are:

It is more inefficient because the machines you program it on are imperative by nature. The stack frame at least on Intel machines is large and not using this has performance penalties (this is different in ARM processors as there is a small stack frame and a huge register file instead). Assembly language is imperative and thus you can only get worse as you go higher and higher into the functional abstraction. Functional programming is good not because of it's efficiency.

Also, recursion is horrible for performance, as it saves stack frame, goes into new function, reloads etc while compilers optimize small loops into a serial program which improves performance by removing the condition checking on each iteration that is unnecesarry.

What I have seen is that both Ocaml and React (Javascript Framework) strike a balance by adding FP features like lazy loading, memos, composition etc. on top of a language which has both OOP and FP features. Right now React has eaten almost all of the market share of other frameworks because of it's functional nature and performance.

As a programming style yes, I love FP, I use hooks and functions instead of classes in React in my work for example, and I find myself writing lambda functions and stateless formula-style functions in general (as I find them to be more elegant), but I would never write an operating system or a performance critical app on it.

consumed by avarice
last edit on 5/2/2021 11:12:54 AM
2 posts
This site contains NSFW material. To view and use this site, you must be 18+ years of age.