[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Why/when do you use functional programming instead of normal

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 29
Thread images: 1

File: g eeee.png (4KB, 400x400px) Image search: [Google]
g eeee.png
4KB, 400x400px
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
Thread posts: 29
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.