What big mission critical software projects are written in functional programming, Sup Forums?

What big mission critical software projects are written in functional programming, Sup Forums?

Genuine question, I've seen Sup Forums memeing FP and thrashing OOP massively so I wanna learn what's all the fuzz about.

I had never even heard of FP before in nearly 12 years as a software developer, so I have nothing in particular against it tbqh.

Other urls found in this thread:

yegor256.com/2016/11/29/eolang.html
yegor256.com/2015/08/18/multiple-return-statements-in-oop.html
en.wikipedia.org/wiki/Formal_methods)
en.wikipedia.org/wiki/Functional_programming#Efficiency_issues).
myredditnudes.com/
twitter.com/NSFWRedditGif

Literally none.
Typical Sup Forums memeage.

OOP is good and FP is useless garbage OP, stop believing what you read on Sup Forums. Next you'll believe in feminine penis, geez.

>never heard of functional programming

looks like we got another math-retard. this is why pajeet is winning t b h

> 12 years as a software developer
> never even heard of FP
Low quality bait

This, Sup Forums is known to meme worthless shit just to troll gullible unwary folks like you, OP.

This, thread over

Mathfags are the ones pushing the FP crap, you nigger.

It's not bait, in the industry FP really has no relevance whatsoever.

Lots of them might have parts of it written using FP.

The thing is though, that FP in big languages is kind of new. Java only got it in Java 8, and notice how it's there solely to support OOP.

You're not going to have pure FP anywhere, but then again, you don't have pure OOP anywhere either.

You want to see what religiously pure OOP looks like? Read Yegor's blog:
> yegor256.com/2016/11/29/eolang.html

I have never ever seen anything like that. Because it would be fucking insane.

AFAIK some ticket systems for airplanes are written in Prolog.

WhatsApp and some telecommunication software is written in Erlang.

ITA software uses LISP.


Generally FP is just a tool, just like OOP.
Sometimes it's better to pick the wrench, sometimes the screwdriver.

You've obviously never been to /dpt/, you're gonna have so much fun when you do.

I found an even better example:
> yegor256.com/2015/08/18/multiple-return-statements-in-oop.html

public int max(int a, int b) {
return new If(
new GreaterThan(a, b),
a, b
);
}

Disregarding the entire fucking issue of speed, how is this shit more readable?

wtf?
This looks even worse than Java.

Yeah that's why I called you a math retard. Too stupid to understand it you code monkey.

It doesn't, stop damage controlling.

Hey, man. Math is great. And so is functional programming. Shilling against a tool in the toolbox for some kind of personal gain is a fucking kike-esque attitude and you should feel bad.

Your OP was also a complete shitpost. How do you know FP is shit if you've never even heard of it? What kind of closet do you live in where you have never even heard of Ruby et al?

Gov.uk uses Scala

I've been on Sup Forums for years and deliver code examples on a regular basis.

Sup Forums likes to bash everything, this includes
OOP.

>"The stories and information posted here are artistic works of fiction and falsehood. Only a fool would take anything posted here as fact."


>You want to see what religiously pure OOP looks like?

I always found the OOP models of Smalltalk/Ruby (quite similar) and Scheme/LISP/JavaScript (also quite similar) pretty good.


I think Ruby is one of the pures OOP langauges out there.

But yes, I understand what you mean:
Stuff like map/reduce/filter or the for-each-loop are typically functional constructs, yet they are so common that people often forget about that.

Personally I don't think it's a "black or white"-thing, why not use functional enumerators with objects and classes? Best of both worlds.

>inb4 "muh purity"


So basically they are using Java with a bunch of Scala classes for the coolness?

Just kidding, Scala has really a nice approach. I plan on learning it the next year. I'm only afraid that it's pretty tempting to "cheat" and use Java-like style every now and then..

Can you recommend it?

>You're not going to have pure FP anywhere
Elm is pretty much as pure as it gets.
Even 'purer' than haskell, as it enforces complete functions, doesn't have undefined and doesn't have unsafePerformIO.
Not that pureness is any form of measure whether something is good.

>What big mission critical software projects are written in functional programming, Sup Forums?
People use the best from both worlds, OP. There's a reason why virtually all modern programming languages and frameworks use concepts both from object-oriented design as well as functional programming.

>I had never even heard of FP before in nearly 12 years as a software developer,
Then you are most likely a completely shit developer to be quite honest. Even self-taught programmers get exposed to functional concepts just by using existing frameworks and being moderately interested in the field of software engineering.

Amazon
Netflix
Australian Post
Capital One
Database Labs
Deutsche Bank
eBay
LG
Oracle
Spotify
Soundcloud
Aviso...

And many more are using Clojure.

FP programing is all over the place in critical back-ends, and big data situations. It's just never made a big splash outside of that because it's not easy or accessible as things like python. And the lack of documentation and tutorials puts casuals off. It's there, but out of sight out of mind. If it was not half the shit you use every day would not be working.

>Here are the things I think do not belong in a pure object-oriented language:
>flow control (for, while, if, etc.)
wut

Why not?
If you want to be 100% pure, everything has to be an object.
Having flow control statements would mean it's a procedural language with OO on top.

It's kinda like lisp, where everything is a list

you ditch your FOR loops and only use something like object.forEach(procedure())

It kind of sucks.

I personally think a "pragmatic" approach is better, and not just with OOP having procedural stuff but also having functional bits and declarative too.

If you've seen C# lately you would understand:

>WPF displaced winforms for the Views. Declarative > OOP here

>LINQ is FP and replaces procedural+OOP Database Queries.

Isn't flow control a necessary subset of every turing complete language though?

This is flow control. It's just hidden behind an abstraction.
A pretty shitty abstraction if you ask me, but someone obviously thought this is a good idea.

>It's just hidden
Meh
Python is best language, followed closely by C.

>you ditch your FOR loops and only use something like object.forEach(procedure())
>It kind of sucks

I think it's way more elegant to use functional iterators.

Let's write a short function that uses an array, replaces some values, concats them and prints as output.
I will write it in Ruby two times, but the first time I try to be as "old schoold" as possible, then second time I use an functional approach.


Here is a traditional/procedural/OOP way of doing it, similar to C, Java or Go:

some_array = ["op", "is", "a", "faggot"]
result_string = ""
i = 0
while i < some_array.length
if (some_array[i] == "a")
some_array[i].replace("always a")
end

if (i%2==0 && i 96 && some_array[i][j].ord < 123)
some_string += (some_array[i][j].ord - 32).chr
else
some_string = some_string + some_array[i][j]
end
j += 1
end
some_array[i] = some_string
end

result_string = result_string + " " + some_array[i]
i += 1
end
result_string = result_string + "!!"
puts(result_string)

Now the same thing in a "functional way" like you would do it langauges like Ruby, Python or Haskell:

p ["op", "is", "a", "faggot"]
.map {|x| x=="a" ? "always a" : x}
.map.with_index {|x,i| (i.even? and i

>C is pretty shitty for processing strings
This is news to literally nobody.
Also your code is shit it puts a leading space at the start of the output.

None.

Most mission critical is first modelled using formal methods (See en.wikipedia.org/wiki/Formal_methods) to test that your model is complaint to the domain and range of your problem.

The problem with that is that (AFAIK) there are no tools to help you turn your tested automaton into a compilable language that can go into whatever you're making (e.g. a minimal system) so you will have to translate the model into a real programming language, this is where mistakes are made.

Where as FP is nice for enforcing a model, you will find that there are not many people using because they're not very memory efficient (en.wikipedia.org/wiki/Functional_programming#Efficiency_issues). On the other hand, modern languages are adding support to FP so this might improve in the future, but I still think is unlikely that people will switch from one paradigm to another and/or using in mission critical software.

> if (i%2==0 && i

>i==1
err, 0

>half the shit you use every day would not be working
It would, just in another language.