>mfw functional programmers just keep spreading memes how OOP is bad instead of elaboraing and proving their claims
OOP is bad, everyone knows it in their heart.
>liking OOP
pajeet detected
You just have it on your CV to impress MBA Chads who want to use you to create their next social media idea.
>>57735195
yeah, becauseknowing( get_everyone(), "bad", "OOP", heart)
is soooooo much better thaneveryone.heart.knowledge.add("OOP").is("bad")
OOP isn't bad inherently.
It's just the only paradigm that CS101 "coders" know so they churn out garbage spaghetti and apply it to every situation, when most of the time it isn't needed at all.
> ITT: My better syntax sugar is better than yours
>>57735154
Yeah. OOP is best. We are number 1 programming.
>>57735154
OOP isn't bad.
Neither is functional programming.
Both have their good points and are better for different stuff and nothing stops you from programming in an hybrid way.
You wouldn't use a screwdriver to nail a nail and you wouldn't use a hammer to screw a screw.
Also, english is a funny language.
College java-drone here.
I don't known the difference between functional and OOP, what is it?
>>57735404
Syntax does not mean it's functional. Go look up the definition.
>>57735859
OOP has state inside each object. An object may have a private counter that you don't know of, so the state changes along the execution, which leads to side effects and unwanted behaviour.
Functional means there's no state, every method always works the exact same way and returns the exact same thing for the exact same input.
However this thread seems to be about syntatic sugar, not wether it's functional or not. /g/ has really fallen.
>>57735154
OOP is usually better for larger projects
>>57735404
is the first example functional?
>>57735404
I will let this here:--source: haskell data analysis cookbook
import Text.CSV
-- Parses a CSV file
main :: IO ()
main = do
let fileName = "input.csv"
input <- readFile fileName
let csv = parseCSV fileName input
either handleError doWork csv
handleError csv = putStrLn "not a CSV"
doWork csv = (print.findOldest.tail) (filter (\x -> length x == 2) csv)
-- Finds oldest person.
findOldest :: [Record] -> Record
findOldest [] = []
findOldest items = foldl1 (\a x -> if age x > age a then x else a) items
age [a,b] = toInt b
toInt :: String -> Int
toInt = readimport pandas
table = pandas.read_csv("input.csv")
print table[table.age == max(table.age)]
>>57736147
What's special about the code?
>>57735913
>>57736021
I wanted to highlight the fact that almost universally human brains think about objects first and their interactions second. Therefore, in applications where information hierarchy and organization is the problem, it makes sense to use languages which have features to express such ideas in the easiest way possible.
Functional is only used for screwing around.
If you want a job, you learn oop. oop is more versatile than functional programming.
>>57735309
>implying