Can anyone explain why functional > oop is better to someone who only knows high level programming as a secondary skill?My experience with it is from using React, which turns into a huge mess after a while. When React projects scale, problems emerge that require universally accepted solutions that do things that its 'functional' style of coding initially set out to avoid, making the project and rules unnecessarily complicated, hard to refactor, etc. Sort of like 'okay you can break the rules, but only when functional programming proves to be shitty'.
>>107265810>'okay you can break the rules, but only when functional programming proves to be shitty'oops has the same problem. it makes sense for the data from a table to be represented as an object. but then people try to make everything into an object and interfaces and everything is inheriting each other then you have to make a code change and its impossible to figure out whats doing what and what the relationships are. it depends what you are doing too, if you are a solo dev building something its very easy to stay organized. but if you are part of a team at a bloated company where they arbitrarily split things into stories and the business people keep changing their minds then of course everything will be a mess, add jeets and its a dumpster fire
>>107265872ok so both have issues in the long term, but functional is a pain in the arse in the short term, because there are more rules to follow. do you feel differently or disagree?
>>107265956i dont even think thats true. you usually have to set up a lot of useless boiler plate for object oriented programming. and then has you build upon it you are constantly making wrappers and interfaces and delegates and glueing things together and taking them apart. functional programming usually forces effective programming practices where you have immutable variables and functions that are named after what they literally do and you can piece together the functions like steps. with oop you have factory classes that create managers that have functions that get overridden with polymorphism and sprawling if statements. its like if you have a small vocabulary and you are trying to describe a concept and it takes you 20 words, but if you have a wide vocabulary and you know the exact word then you can just use that word, then you can build your words together to create even more complex concepts. the higher vocabular is "harder" to use and learn at first but its far more effective at describing concepts that are impossible to get to without it
>>107265810the thing about functional language is that the word functional literally means useful, practical. so its sort of a ironic joke. functional language is invented by maths people who don't understand procedural constructs and can only think in nested functions. which is fine. until you want to do anything useful.you can prove this quite simply: functional programming is using functions only, and can be implemented in procedural languages, therefore is a subset. anyone who drives a manual car can drive an automatic, they just find themselves reaching for the clutch every so often. the reverse is not true however.oop is fine people just are retarded about it. not everything needs to be an object. not every object has to inherit from some other object. every object in your project doesn't need to be related. some of the loudest programmers are west coast america and retarded hippies stoned and brains addled with aids. so the things they come up with, came up with, are mostly absurd nonsense. like model view controller, or osi model. ocassionally some of the things they come up with can be abused to suit some constructive purpose which is what oop is. they woul dhave you believe everything is an object and related. similarly in functional, that you should do everything in function only. that is brain on drugs thinking. but inheriting can save you a lot of boiler plate if you have a lot of similar constructs.the entire idea behind functional programming is that data and function are interchangable. who the fuck cares about that? is it important? just because you CAN do something, doesn't mean you should limit yourself to doing just that for the rest of your life. but these are the same guys that put their dicks in metal cages and shove dildos up their asshole so who fucking knows man.
Every programming paradigm has useful ideas that make a lot of sense in certain contexts, but they also turn to complete shit if you treat them like a religion that requires 100% purity and devotion.
>>107266141Function just means the same input will always produce the same output.
>>107266360that's what it means in math. in programming we have functions that output random values.
>>107266420Thats why another term was created "pure function" for functions that are actual functions. At least the OOP people started calling the bad functions they were making a "method".
react is hardly functional programming. if you want to get a taste of what functional programming actually is, try haskell.
>>107265810React is really "functional" only insofar as the web/js are sort of functional. "Functional components" werent really meaningfully different from "class components" nor were hooks. Hooks are pretty trivially translatable to just a struct that holds state with some methods, and indeed thats what theyre used for the majority of the time.Half the point of react is that it makes managing frontend state easy, thats why you have useState useReducer, reusable hooks that can be stateful, etc.>When React projects scaleThis is not a react problem, when any software 10x in size like a lot of "just add one more feature!" web apps do they will become spaghetti, that will be true in any domain. The only difference is that in some domains this doesnt happen (you can't really "just add one more feature!" to say your TCP implementation in the same way). Web, however, is the worst for mgmt telling you to add random shit at lightspeed. I worked with react for 4-5 years and didnt really have this issue, we knew itd be a larger application from the start though and said no a lot. Web/browser idiosyncracies will waste 999x more time and cause 999x more headaches than react.>>107265956You just cant really generalize effectively like this. They are two different semantic paradigms that model onto different things more or less easily. Most languages also overlap hugely between the two. It is not some midwit clear-cut thing like "X is simply better for big projects!". Parsing might be easier to reason about when your tool is pure-functions, a database row may be easier to reason about when your tool is and object with typed fields.>>107266141This was not worth reading
>>107265810This is like asking if anyone can explain why a screwdriver is better than a hammer. Which tool is better depends on the job and personal tastes. Use whatever suits you.
>>107267218Functional works for everything, OOP just makes compile work in legacy mode. Never compromise true optimization
>>107265810OOP has its uses but collapses under its own decentralized weight. It's easier to support in the long run but not everybody has the enterprise in mind from the very beginning.
>>107265810Whatever the paradigm, if you try to fit every problems in it you will suffer and your code will be shit, just use what maps the best to a problem, sometime it's functional, sometime it's dop or ecs, sometime it's oop like.If you use polymorphism you should rope yourself though.
>>107267332>tripfag in 2025 saying something stupidwho knew
>>107267588Namefag, asshole. I never, NEVER use a tripcode. ANY time you see my name with a trip, report is as a spam bot.
>>107267679ah my apologies
>>107265810functional and oop are two different things that aren't mutually exclusive. one is a computing model, the other is a data abstraction technique. this is literally PLT entry course.
>>107265872>>107266134typical babble of someone filtered by oop