OOP or functional? (or other)


(Benjamin Philippe) #1

Ever since I learned OOP and functional programming, I’ve used them together in JavaScript, so I think that both paradigms should be used when they’re useful. Looking at the recent war in some places (looking at you, Medium), I wanted to know what you people thought.

(Bas Kuipers) #2

OOP is nice but for some things functional programming is just much easier to get started with and wrap your head around the actual flow of the application.

(Benjamin Philippe) #3

Really? I thought OOP was simpler.

(Miguel Piedrafita) #4

Depends on what I’m doing. OOP for building webapps, but normally spaghetti codefunctional in JS.

(Benjamin Philippe) #5

Wait till you see functional C++.

(William Oldham) #6

I love OOP cause it makes for… forced structure :stuck_out_tongue: Plus the fact I like the idea of inheritance :stuck_out_tongue:

(Bas Kuipers) #7

I love spaghetti

(MH Xion) #8

Just use whichever you need. If you’re not sure(in most cases), you can get the right answer by doing an extra work, write your code in both ways, run a benchmark test or you can just realize by yourself, which one gives you the faster, the lighter and the easier scalable result? Cause at the end if the day, performance matters most at the client side rather than your expertise of writing code!

@Camto what does Medium say?? curious.

(Benjamin Philippe) #9

I don’t know if it’s just my feed, but everywhere on Medium I see articles like “Functional Programmers are Better Programmers”, " So You Want to be a Functional Programmer (Part 1)", and “Functional Programming should be your #1 priority for 2015” that argue that functional is better for absolutely everything.

(Filip Samuel) #11

Here’s a snippet from a small project of mine:

(Benjamin Philippe) #12


(Filip Samuel) #13

Found new wallpaper