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
>>59511120
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.
>>59511498
this, fucking meme programming.
>>59511120
When I want to program a function
>>59511120
When autism strikes again.
>Traditional
Wtf are you talking about? Imperative? Object Oriented? Declaritive?
>>59512084
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.
>>59511824
THIS
(define (meme e n d le ss parameters) (code))
when you do data analytics
>>59511120
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.
>>59511120
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.
>>59511120
AI waifus and data learning
when i want to get nothing done