Why/when do you use functional programming instead of normal programming?

Why/when do you use functional programming instead of normal programming?

Because concise code is happy code.

I don't

I don't

I don't

I don't

I don't

I don't

I don't

I don't

I don't

I don't

I don't

I do.

I do

When mentally masturbating to SICP. Other than that, you don't.

>when do you use functional programming instead of normal programming
Never.
There is never a case where using functional programming would make sense over traditional programming languages. It is purely a preference, a useless one at that.

this, fucking meme programming.

When I want to program a function

When autism strikes again.

>Traditional
Wtf are you talking about? Imperative? Object Oriented? Declaritive?

most likely declarative

Sometimes even if you plan to write something in an imperaitve way if you have a clusterfuck of sphagetti code it makes it more clear when you rewrite it to gain immutability and then rewrite ita gain to put the mutability back in.

As soon as you make it immutable you have guaranteed that it is threadsafe which fixes alot of types of bugs automatically.

THIS
(define (meme e n d le ss parameters) (code))

when you do data analytics

Always, unless there's a particular reason why you need side effects or to mutate state.

This goes even if you're programming in a mainly imperative language like Java. Make all your objects immutable unless you have a good reason to make them mutable.

When it's convenient. Nuggets of functional programming can be sprinkled into a primarily procedural or OO program without any problem.

If you want to map, reduce or filter then your intention is always clearer if you just write map, reduce or filter.

As for purely functional code, I suppose that's just for mathematicians.

AI waifus and data learning

when i want to get nothing done