News for hackers. Stuff that matters.
Re:Why functional programming matters by zinxq on Tuesday April 18, 2017 @09:29AM (#14138620)
My apprehension comes from lack of seeing it in the wild (i.e. scaled businesses).

Google primarily uses C++/Java. Facebook: Hack. Twitter tried Scala and as far as I know, abandon it and went to Java. LinkedIn definitely tried Scala, failed, and went to Java. Square is Ruby/Java.

I'd like to have something to point to as a success story of a company at scale with functional programming. Anyone know of one?

Re:Why functional programming matters by random314 on Tuesday April 18, 2017 @09:59AM (#14138840)
> Twitter tried Scala and as far as I know, abandon it and went to Java.

This is incorrect. One of the former VPs said he would not use Scala. Twitter uses Scala massively and has published and continues to maintain several open source Scala projects.

> LinkedIn definitely tried Scala, failed, and went to Java

This is incorrect. A newly hired VP insisted on moving the front end from Scala to Java. In the offline backend stack Scala is used extensively. Check Kafka, Samza from LinkedIn or better yet ask current LinkedIn employees.

Apart from these Spotify, Foursquare, ebay, several banks use Scala. FP is huge in financial institutions, check K/KDB+. Jane Street etc. Thats where most FP programmers work. Also verizon, jet.com and walmart.com. There are several dozen large companies using FP.

FP is mainstream now. Traditionally, it was financial institutions using some flavor of ML/Haskell. With Scala/Clojure on the JVM, Si Valley has moved into FP in a big way.

Re:Why functional programming matters by philpee2 on Tuesday April 18, 2017 @10:42AM (#14139183)
Airbnb also uses Scala for financial reporting https://medium.com/airbnb-engineering/tracking-the-money-sca...
Re:Why functional programming matters by TSiege on Tuesday April 18, 2017 @10:25AM (#14139037)
Not sure what you mean by LinkedIn's front end, but they are 100% an ember app on the front end. At most they're using typescript for it.
Re:Why functional programming matters by singlow on Tuesday April 18, 2017 @10:37AM (#14139133)
Since I don't think he means Scala transpiled to javascript, I assume he means the services/apis that are used by the front end. This is distinguished from applications which do not talk directly to the browser. Front end and back end have different meanings depending on perspective.
Re:Why functional programming matters by jorgeleo on Tuesday April 18, 2017 @09:56AM (#14138814)
The reason why you see this pattern is not because in functional programming vs. OOP, functional losses.

The reason for this pattern is because companies look for easily replaceable developers.

To get into functional you need to be good at abstracting the business domain, this requires seniority which is hard to find. Most of the time, when you are working using functional programming you are implementing the business vocabulary. Entry level developers are not good/interested in this. Their worries are in how they can use Angular 2 in this project, or why we need to still use SQL Server instead of converting to {insert the newest database technology}.

It is easy to find (and replace) junior developers that are happy because they created something with the latest technology and it provides the immediate value intended. It sounds good, but it misses the point.

Software development in a company happens to support/enhance the business. This means that it has to stand the test of time, not only in reliability but also in adaptability. The only constant in software is that it will change. Here is where building a vocabulary that represents the business subjects pays off. Change now is a definition-change and, unless the business is pivoting, definitions rarely change; instead, they have constant adjustments. Functional shines in creating a vocabulary and having this adaptability.

Of course, you can adapt using OOP, but the question is not if adaptability is possible, it is instead how to make changes at the lowest risk.

Re:Why functional programming matters by r2dnb on Tuesday April 18, 2017 @01:28PM (#14140853)
>Most of the time, when you are working using functional programming you are implementing the business vocabulary.

>Here is where building a vocabulary that represents the business subjects pays off. Change now is a definition-change and, unless the business is pivoting, definitions rarely change; instead, they have constant adjustments. Functional shines in creating a vocabulary and having this adaptability.

I tend to use the same arguments to make the case against FP for business modelling.

I tend to say that FP is good at adding new operations to existing things, while OOP is good at adding new things to existing operations. However when Software Development is used to model a business - as it should be for reasons you accurately explained - the reality it meets is the one of the business world in which business needs evolve and requirements get added. You start by supporting local groceries and then you grow to support global supermarket chains. OOP is more suited to model business because you can naturally extend existing types and apply existing operations to them (ie. pass a supermarket everywhere a shop was expected + things such as polymorphism). In FP, every time you add a type, you need to add switch cases to your existing operations (at best), or redefine them create / new ones (at worse), since the ubiquitous assumption of FP development is immutability and known types.

I'd be curious to know how you approach this conflict in a way that makes FP work in real world business modelling which needs to be extension-oriented. It seems to me that the more operations using a type you have, the more you will be screwed when you want to extend this type. The only reason I can see this wouldn't be the case would be to say that I approach FP with the wrong philosophy and that there is no such things as extending types in FP. But in this case I'd question if FP modelling really is the best tool to model real world business for which it is natural to define things as extensions of other things.

Re:Why functional programming matters by nonabelion on Tuesday April 18, 2017 @02:02PM (#14141235)
>I tend to say that FP is good at adding new operations to existing things, while OOP is good at adding new things to existing operations.

What you described is exactly the _expression problem_. And it has some solution.

See https://oleksandrmanzyuk.wordpress.com/2014/06/18/from-objec...

Re:Why functional programming matters by r2dnb on Tuesday April 18, 2017 @04:16PM (#14142488)
Thanks for the reference, this is indeed all about it. The solutions mentioned are unnatural patches to the respective shortcomings of FP and OOP. It's ok to patch corner cases to complete the last 15% of a job for which the tool was a perfect fit for the first 85%, however the first patch should be to use the right tool for the right job.

The functional and strongly typed value proposition of FP is very appealing on paper but only shines when you have a level of certainty and knowledge on requirements that you typically do not have in real world software development. OOP by design embraces this uncertainty (but as a trade off is less assertive on correctness than FP).

That being said, certain businesses do not have a high level of uncertainty in their developments while correctness is a big deal for them (banks, scientific researchers, etc...). It makes sense for them to reinvest this slack in correctness. However, for those iterating consumer facing products (which represents the majority of developments), OOP modelling usually is the way to go. Because of the expression problem (which should probably be called the expression dilemma to better highlight the fact that the assessment should be continuous and situational rather than ideological and/or philosophical)

Re:Why functional programming matters by jorgeleo on Tuesday April 18, 2017 @05:39PM (#14143193)
What you are mentioning is one of the hardest things to do when moving into FP.

"OOP is more suited to model business because you can naturally extend existing types and apply existing operations to them (ie. pass a supermarket everywhere a shop was expected + things such as polymorphism)"

The reason why you feel is more suited is because you are thinking in an object oriented way. It is not a bad thing, but it is not functional.

"... extend existing types and apply existing operations to them". This means you have things, and you do things to them. This is the OOP way, not the FP way.

In FP the things are immutable, so you don't do things to them because they cannot change; instead, you create new things out of what you have.

In OOP this is what you have, this is what it can do, and you put all the gears (or objects) together and you get your engine.

In FP you have pipes, this is what I have and if I put it through this pipe it becomes something else.

When a local shop there is a sale, there is a function that takes a bunch of arguments and produces something called a sale, Maybe is the total, maybe is a tuple with the different pieces of the sale.

When you move that to a supermarket, then the question is: how what the shop owner calls a sale in the local shop is different from what the supermarket owner calls a sale? How my vocabulary changed? for a lot of things, you will see that the meaning is the same, just over more data; and also, there are new words that didn't exist in the smaller context. A sale is in both cases the sum of the quantity multiplied by the price of the groceries, apply the tax, spit out the result. But maybe the meaning of Tax changed, instead of been a fixed percent, it needs to be the lookup in a table depending on where the supermarket is.

If you need to constantly add switch cases, then probably you are using a functional language using an OOP mentality.

The way that I have introducing FP to people is using Excel. Think on this syntax:

A1: 1 B1: 2 C1: A1 + B2

You don't need new cells, C1 does not mean the same thing and the formula have to change... the formula or is it the function?

When you model the real world, you can focus on the objects, map them to types, and go from there. Or you can focus on the meaning of the words, then you need just a few types, see how those meanings compound, and go from there.

"But in this case I'd question if FP modelling really is the best tool to model real world business for which it is natural to define things as extensions of other things."

I agree, FP is bad at extending things... but it is not FP fault that you see the world as things that need to be extended.

A middle step between what you are saying and FP will be Flow Programming (https://en.wikipedia.org/wiki/Flow-based_programming). It is not FP, nor OOP, but somewhere in between.

Re:Why functional programming matters by r2dnb on Tuesday April 18, 2017 @06:25PM (#14143577)
Many thanks for taking the time to explain this, I can see that you have a point.

>Or you can focus on the meaning of the words, then you need just a few types, see how those meanings compound, and go from there.

>I agree, FP is bad at extending things... but it is not FP fault that you see the world as things that need to be extended.

I should probably give another look to FP and continue to study the subject, I have likely been approaching it with a OOP mindset as you suggest. One last question though, what about code duplication ? If you focus on the meaning of words and compounding these meanings to create new things, wouldn't it most of the time create lot of duplicate code ? For example in the case of the local shop and the supermarket, wouldn't you have two functions (or a switch case) containing exactly the same code to calculate the quantity multiplied by the price of the groceries ? One would take a local shop as parameter, and the other one would take a supermarket.

Splitting the sale processing function in two parts - one summing up the groceries and the other one calculating the taxes - so that you can reuse the first function implies knowing in advance the existence of the supermarket structure (which you will only know many years after putting your product in production). Not doing it in advance either means duplicate code or refactoring every time you add an operation. The extension mindset initially comes from the need to avoid code duplication which is known to make maintenance difficult.

Now maybe the strongly-typed experience of FP and its compile-time checks are so convenient in practice that they make the maintenance of this kind of code easily manageable ? Maybe it's not even really duplicate code since what would be a basic number in OOP would be two different types here in FP ? Or maybe it's still thinking about FP from an OOP perspective ?

Re:Why functional programming matters by jorgeleo on Tuesday April 18, 2017 @07:22PM (#14143984)
Very good example.

What goes through the sale function pipe is not the store and its size, it really does not matter for the meaning of sale were the sale happened. What matter for the sale is the cart. The cart might be more or less sofisticated because the size of the store, but is still a cart.

So the sale function is a pipe that eats a cart and spits out a receipt.

Or if you want to put it in another way, a sale is something that might happen to a cart over time. Functions are the clock on the system. In a functional system, times does not pass until a function is executed (does it sounds like lazy evaluation?)

In functional programming, we avoid duplication of code by appliying functions to the data so it spits what the next function needs. If you have a function sale that can eat a simple cart, but now you have a complex cart, one solution is to create a function that converts the complex cart into the simple one that the sale function needs; another way is to make the complex cart having the same data as the simpler cart. What you choose to do is proportional to how different the meaning of cart is, or maybe the cart remains the same. In general terms, this type of thinking tend to produce less lines of code needed per similar acomplishment.

So in OOP your are using objects to put together the store, while in FP your are descriving what happens in the store by connecting pipes betweem the different data. It is not about what can happen to the data, but what makes the data travel. It is not about what steps makes it work, but the fluidity of the data life span.

Re:Why functional programming matters by r2dnb on Wednesday April 19, 2017 @03:42AM (#14146145)
Many thanks jorgeleo ! I wasn't clear on how FP handles complexity management and the unknown. You've beautifully connected the dots and helped me shift my thinking, this is all clear now.

In particular your demonstration was very convincing from a DDD perspective. I can see that FP is not less natural than OOP for domain modelling while it approaches things from a very different angle. However FP brings to the table rich domain semantics, high correctness guarantees, and I feel productivity gains too. And with the mindset you've presented, it is also clear that the unknown seems to be accounted for in FP too. As an architect, this last point was the grey area and the deal breaker for me. However now I see no reason not to invest in heavily leveraging FP moving forward. Thanks again jorgeleo.

Re:Why functional programming matters by BeetleB on Tuesday April 18, 2017 @09:58AM (#14138829)
>The reason for this pattern is because companies look for easily replaceable developers.

Which is definitely part of the "company at scale" equation the GP referred to.

Re:Why functional programming matters by matwood on Tuesday April 18, 2017 @09:52AM (#14138775)
I think the end result is going to be companies adopting functional concepts. I can't find the article right now, but Carmack wrote about how even though he was not sure if he would write a whole game engine in something like Haskell, just learning to think functionally improved his C coding.

Java has had lambdas and streams for awhile now. A pretty common design pattern has also become anemic domain models operated on by groups of functions, which fits in the spirit of functional programming. Modern java can, and is used in a functional style.

On the JS side, functional concepts are everywhere. Given how heavily FB and Twitter are invested in JS, I don't think they have abandoned functional programming at all.

Finally, IMO Scala is actually a pretty poor example of a language that can be used at scale. Without a highly enforced set of rules it can quickly become a write once/read never language. I'm sure there are exceptions, but given the choice between scala and java 8+, I would go with java. Clojure may be an option though.

Re:Why functional programming matters by tjalfi on Tuesday April 18, 2017 @10:26AM (#14139046)
Re:Why functional programming matters by matwood on Tuesday April 18, 2017 @10:28AM (#14139064)
Yes, thanks!
Re:Why functional programming matters by 0x445442 on Tuesday April 18, 2017 @10:32AM (#14139099)
Yeah, my Java code pretty consists of two categories of class types now days.

Pojo's which are just data structures or a glorified HashMaps for holding data. And, if allowed, using Lombok to get rid of all the getter/setter cruft.

The second category of class types are just Service classes. These classes hold no state and are a logical grouping of methods that typically operate on a given data type. However, the class is based more on a specific role it performs than the type(s) it operates on. Also, there's considerable thought given to reuse of the Service classes outside the given context at hand.

Re:Why functional programming matters by peterkelly on Tuesday April 18, 2017 @11:06AM (#14139415)
MapReduce, which Google built for indexing the entire web, along with many other big data tasks, is an example of something that could only have been invented by someone familiar with the principles of functional programming:

https://static.googleusercontent.com/media/research.google.c...

Imperative/object oriented languages are often more practical for real-world use (MapReduce itself I believe is written in C++), however it's the ideas of functional programming that matter most. Those with experience working in functional languages are at an advantage over developers who've never had that exposure, because they have a wider range of mental tools at hand with which to solve problems.

Re:Why functional programming matters by rhaps0dy on Tuesday April 18, 2017 @09:36AM (#14138665)
Jane Street use OCaml https://www.janestreet.com/technology/

Erlang was developed for Ericsson phone switches with a large proportion of uptime.

Whatsapp also use Erlang.

Re:Why functional programming matters by mpweiher on Tuesday April 18, 2017 @09:41AM (#14138700)
Of course Erlang is functional in the small and OO in the large..
Re:Why functional programming matters by hota_mazi on Tuesday April 18, 2017 @10:12AM (#14138940)
Erlang has pretty much zero features usually associated with OO, which is not surprising since Erlang's creator once wrote "Why OO sucks"[1].

[1] http://harmful.cat-v.org/software/OO_programming/why_oo_suck...

Re:Why functional programming matters by mpweiher on Tuesday April 18, 2017 @10:26AM (#14139048)
"Joe Armstrong: Smalltalk got a lot of the things right. So if your question is about what I think about object oriented programming, I sort of changed my mind over that. I wrote a an article, a blog thing, years ago - Why object oriented programming is silly. I mainly wanted to provoke people with it. They had a quite interesting response to that and I managed to annoy a lot of people, which was part of the intention actually. I started wondering about what object oriented programming was and I thought Erlang wasn't object oriented, it was a functional programming language.

Then, my thesis supervisor said "But you're wrong, Erlang is extremely object oriented". He said object oriented languages aren't object oriented. I might think, though I'm not quite sure if I believe this or not, but Erlang might be the only object oriented language because the 3 tenets of object oriented programming are that it's based on message passing, that you have isolation between objects and have polymorphism.

..."

Read the rest. It's good.

https://www.infoq.com/interviews/johnson-armstrong-oop/

Re:Why functional programming matters by Jtsummers on Tuesday April 18, 2017 @10:25AM (#14139038)
If you look at early concepts for OO where objects were simulations of things (Smalltalk, Simula) and communicated via message passing, erlang's process and message passing model actually fits well within the OO-framework of thought at least with regards to application design. What it's missing are syntax/semantics based on class hierarchies and such from OO languages like Java and C++, which isn't a bad thing.
Re:Why functional programming matters by maze-le on Tuesday April 18, 2017 @10:19AM (#14138989)
I once heared a speech from Joe Armstrong, where he considered erlang the only true object oriented language... This was of course a little quip to the OOP community, but it has a certain truth in it. He argued, that the actor model is basically object orientation like it should have been done.
Re:Why functional programming matters by rdtsc on Tuesday April 18, 2017 @12:25PM (#14140155)
Well if you want to go that way ;-) jokingly Erlang is the only true OO language implementing Alan Kay's idea of what "Object Oriented" means -- passing messages between isolated components.

I've heard of inheritance as a corrupting influence which has taken over and corrupted OO for years/ Funny enough, even most OO folks eventually realized that and moved to banish inheritance as a viable pattern.

Re:Why functional programming matters by erk__ on Tuesday April 18, 2017 @11:49AM (#14139826)
Facebook also use OCaml for messenger.
Re:Why functional programming matters by pmarreck on Tuesday April 18, 2017 @01:31PM (#14140892)
Bleacher Report went from 150 servers to just five (yes, that is not a typo, that is a 1/30 reduction) moving from Ruby on Rails to Phoenix on Elixir (née Erlang, but we should just call it "BEAM" at this point): http://www.techworld.com/apps/how-elixir-helped-bleacher-rep... They also handle 8x as much traffic. With 1/30 the number of servers.

Ruby is OOP. Elixir/Erlang is purely functional (although dynamically-typed... some will prefer typed... but the results speak for themselves).

If you are a long-time developer like me and are just coming across this, this news should strike you somewhere between "astonishing" and "pure fucking magic."

Here's the deal- Paradigm shifts, most people only see them AFTER they've finished. If you want to be ahead of the curve on this one and you want to reap the benefits, go functional (Haskell, Clojure, OCaml, F#, Elm, Erlang/Elixir). Today. That is my #1 piece of advice right now. (Well, that, and to avoid Scala and Go. Scala is just too overly complicated to keep your cognitive load down as a developer, and Go... Well, the name even says it: "Go!" As in, "don't stay!" ;) Go will suffer the same long term problems that all OOP/procedural langs share, compounded by its idiotic take on error handling /opinion)

Elixir: http://elixir-lang.org/

Phoenix: http://www.phoenixframework.org/

Re:Why functional programming matters by pkroll on Thursday April 20, 2017 @03:38AM (#14154695)
If you're a long-time developer and just coming across this, it should be... old news. The Techempower benchmarks [1] have consistently shown Ruby on Rails results can be in the range of 1/30 to 1/40th speed of C, C++, Scala, Java and Go, depending on the kind of task. The first thing I thought of actually was an article from 2013, on replacing Ruby with Go [2]. I'm surprised there aren't more of these sort of articles, really: Replacing Ruby on Rails with Rust|Scala|Java|Insert Here.

There are a lot of interesting aspects of functional programming, but there's no particular miracle here: Ruby, particular Ruby on Rails, is slow.

[1] https://www.techempower.com/benchmarks/#section=data-r13&hw=...

[2] https://www.iron.io/how-we-went-from-30-servers-to-2-go/

Re:Why functional programming matters by dentemple on Tuesday April 18, 2017 @10:39AM (#14139153)
Functional Programming, as the article points out, can be universal to many languages. You don't have to use an "FP" language to enjoy "FP" benefits.

JavaScript, for example, is ubiquitous in the industry, and, especially with the advent of ES6, can be written quite functionally. ReactJS is also widespread and can also enjoy an FP approach.

Re:Why functional programming matters by rdtsc on Tuesday April 18, 2017 @12:22PM (#14140116)
Erlang is used at WhatsApp. One of the interesting things there is that for the amount of users and messages handled they had a very small backend team. They have credited Erlang and its features as one of the keys to their success. It means less code (mostly related to minimal impedance mismatch from language to problem domain), debug-ability, reliability, fault tolerance, less ops overload and so on.

I personally find it much easier to navigate and fix bugs in an Erlang code base than in the equivalent C++/Java/C# one. It mainly boils down to how state is updated. When I see NewState = update(Value, State) it is clear what is happening. In OO code, I usually need to remember what object inherits from, what are is the instance state so far (what other members have been called) and how it got there. I find that much harder to handle, for example.

Re:Why functional programming matters by BaronSamedi on Tuesday April 18, 2017 @11:37AM (#14139742)
Or even better, how about empirical research to back up the claim that functional programming is "better"? Does the use of functional language result in fewer bugs at less cost? Compared to what (C, Java, Ada, Lisp)? I don't have an opinion on it but I would like to see the bold claims backed up by actual evidence instead of assertions.
Re:Why functional programming matters by jaredklewis on Tuesday April 18, 2017 @12:21PM (#14140109)
It would be nice, but is a rather tall order. Total cost of maintenance and development of software is not usually public, often unknown even to the developing company, and not actually a very useful metric without context of how much value was generated by that cost. And again that generated value is generally not public and usually unknown even to the companies themselves.

Another approach is to run experiments but they are universally terrible. Their methods have so little relation to the way real software is developed, that it is hard to take any conclusions seriously.

I would also like some hard data, but don't hold your breath. Technology decisions will probably need to made based on other factors for the foreseeable future.

Re:Why functional programming matters by BaronSamedi on Tuesday April 18, 2017 @04:53PM (#14142802)
I agree that hard data is difficult to come by. Without it though, people should not be claiming that X style of programming is better than Y. As much as I like the functional style, it could be that Pascal-style structured programming is actually the best. Who knows?

There was a recent post here on HN about empirical language design and I thought that was a refreshing change. I'd like to see a change in software culture towards an evidence based approach. It's long overdue. Alan Kay called the software world "pop culture" and I think he is right. Software is more fashion driven than Vogue magazine.

Academic research could be a vehicle for a more empirical approach. Research in the hard sciences embraces empiricism. Sadly, the academic research in software doesn't, generally, adhere to the same level of rigor.

Re:Why functional programming matters by plinkplonk on Tuesday April 18, 2017 @09:33AM (#14138654)
jet.com https://tech.jet.com/blog/2016/02-05-jet-engine-built-2015/ . F# on Azure. Acquired by Walmart for 3 billion in cash.

From the article "in this case for massive distributed systems Functional Languages are the right tool ...

Immutability at scale is really important because it allows you to go from 30k members to a staggering 2.5 Million+ and not even feel blip within 3 months, like we did here at Jet from the end of July to October. That’s powerful!"

Re:Why functional programming matters by Slackwise on Tuesday April 18, 2017 @10:40AM (#14139160)
Do you guys do anything with the Clojure devs at Walmart Labs?
Re:Why functional programming matters by plinkplonk on Wednesday April 19, 2017 @01:50AM (#14145743)
Who is 'you guys'? :-) I personally know some of the Clojure devs at WL who came in via the Runa acquisition from my ThoughtWorks days.
Re:Why functional programming matters by noelwelsh on Tuesday April 18, 2017 @09:59AM (#14138842)
Twitter use Scala. They have a representative on the Scala Centre board (Stu Hood. See https://scala.epfl.ch/minutes/2017/02/28/february-28-2017.ht...) which indicates they are strongly invested in the language.
Re:Why functional programming matters by hacker_9 on Tuesday April 18, 2017 @10:30AM (#14139082)
Wings3d.com is written in Erlang, a functional programming language. Additionally any business that scales will be using functional constructs, because they parallelise trivially. Google uses MapReduce for instance. Visual Studio rewrote their compiler to use immutable constructs, and so on.
Re:Why functional programming matters by illuminati1911 on Tuesday April 18, 2017 @09:47AM (#14138738)
You can do functional programming in many languages. Using functional programming or having a "success story" with it doesn't mean you need to use "functional only" -language or Scala.

For example: I've been developing for the last 3 years for the iOS and we been using FP and FRP almost everywhere with different teams and companies. Compared to the standard OO or Apple -way of doing things we have been able to make much better tests, stability/maintainability of the apps has increased etc.

Re:Why functional programming matters by maze-le on Tuesday April 18, 2017 @10:13AM (#14138946)
Facebook/WhatsApp is using erlang for their messaging backend. Erlang itself was invented at ericsson labs, they are one of the biggest suppliers of telco backend equipment.
Re:Why functional programming matters by andrzejsz on Tuesday April 18, 2017 @09:48AM (#14138755)
What is wrong with Scala that some companies seem to abandon it in favour of Java?
Re:Why functional programming matters by hota_mazi on Tuesday April 18, 2017 @10:10AM (#14138926)
It's basically the C++ of the 21st century.

Designed to replace and address flaws of an older language but ends up being huge and unmaintainable, with very questionable design decisions and a tool chain that's simply not up to standards in the 21st century (slow compiler, poor IDE integration that keeps breaking version after version, etc...).

In C++, some of these design decisions were driven by legacy pressure but in Scala, a lot of design decisions were driven by the pressure on the team to write research papers. Either way, both languages end up being monsters that implement all known programming language features known on Earth.

Re:Why functional programming matters by pkolaczk on Tuesday April 18, 2017 @11:19AM (#14139532)
Quite the opposite. Scala is a language designed around a very small core of very powerful, and sometimes hard-to-grasp features like implicits or higher-kinded types. It is a different language than Java and was not designed to replace Java or to be a better-Java.

Your C++ to C analogy doesn't hold, because C++ is an (almost) superset of C, while Scala is not a superset of Java at all. Modern C++ compiler can compile most of C code with at most minor, cosmetic changes.

As for the toolchain - I'm working in it daily and so far it has been great. Ok, compiler is not as fast as Java (point taken), but this doesn't matter as long as I can compile my code fast enough. IDE support is stellar compared to most other popular languages, particularly dynamic ones like Python or PHP.

Re:Why functional programming matters by Phil987 on Tuesday April 18, 2017 @11:56AM (#14139877)
He wasn't saying it's the same as C++ to C. He was saying it's like C++ in that it has way more features than it should.
Re:Why functional programming matters by pkolaczk on Tuesday April 18, 2017 @04:06PM (#14142392)
Oh, so "Scala / C++ is too complex" again. Many people say that, but most can't name even a single thing that should be removed.
Re:Why functional programming matters by hota_mazi on Tuesday April 18, 2017 @06:34PM (#14143638)
It's not just too complex (we're talking more complex than C++ and Ada) but also poorly designed overall, with so many features that they interact with each other in ways that are pretty much unpredictable.

Odersky himself gave up on scalac and he's writing a compiler and a new language from scratch.

Re:Why functional programming matters by pkolaczk on Wednesday April 19, 2017 @04:17AM (#14146257)
Scala more complex than C++? O'rly?

* C++ language specification: 1374 pages (and still includes plenty of "unspecified behavior" / "undefined behavior")

* Java language specification: 788 pages

* Scala language specification: 191 pages

> Odersky himself gave up on scalac and he's writing a compiler and a new language from scratch.

Odersky created a new language to be able to do research without sacrificing Scala stability, which is already mainstream and should not undergo any more major revolutions. So Dotty is for research / incubating language features, while Scala stays on the stable side of things, letting companies like Twitter or LinkedIn develop without fear that 2.13 will not compile their 2.12 code.

> also poorly designed overall

This is an opinion, not a fact.

> With so many features that they interact with each other in ways that are pretty much unpredictable.

Name three. I'm coding in it for several years, and didn't notice a single one issue. I heard this complaint about Scala being too hard a few times very long time ago (when Scala was at version 2.6, and its tooling was in fact terrible), but it was always from programmers, who had also major problems coding in Java, so I never treated this seriously.

Re:Why functional programming matters by haskellandchill on Tuesday April 18, 2017 @10:12AM (#14138941)
As someone who loves typed functional programming and has used both Scala and Java, I oddly prefer Java; it's much easier to reason about. I find Scala almost impossible to make sense of due to the language's complexity.
Re:Why functional programming matters by lostcolony on Tuesday April 18, 2017 @09:58AM (#14138830)
Finding Scala developers vs Java developers.

That's really the main issue per the original question. It's not that functional somehow fails on its merits to deliver, it's just that "at scale" means having enough developers who know it. The reality is that imperative/OO languages have the greatest mindshare, and thus it's far easier to find developers, and far less wind-up time, if you're using such a language.

Re:Why functional programming matters by moomin on Tuesday April 18, 2017 @10:37AM (#14139134)
Also, there's enough different about Scala that can't be expressed on a simple OO vs FP axis that it's hard to learn that much from Scala vs Java. (On this axis)
Re:Why functional programming matters by hvs on Tuesday April 18, 2017 @09:56AM (#14138812)
Compilation in slow. It's also a complex language that can be hard to wrap your head around. That makes it hard to spin up new developers on it.
Re:Why functional programming matters by sly010 on Tuesday April 18, 2017 @10:30AM (#14139080)
Scala is very powerful. Too powerful. There are too many ways to do the same thing and no idiomatic way. Some people also abuse Scala to create DSLs with horrific syntax that is very hard to comprehend. I love and use Scala, but I can totally see why it can be a hard language to use for collaboration.
Re:Why functional programming matters by problems on Tuesday April 18, 2017 @09:56AM (#14138818)
That's an excellent question - especially given that you can essentially use it as a "functionally enhanced java" as it's not a hard-FP language like Haskell. I'd love to know - maybe it's a question of staffing? More skilled Java programmers around than Scala programmers probably. Also might be easier to work with lower level DB libraries and such, but I don't see why a company that large couldn't develop and maintain their own abstractions.
Re:Why functional programming matters by jerf on Tuesday April 18, 2017 @10:36AM (#14139122)
"especially given that you can essentially use it as a "functionally enhanced java" as it's not a hard-FP language like Haskell"

I'm not sure if I can call this "the Haskell community consensus", but a lot of the Haskell community finds Scala too complex to be worthwhile. They find it introduces a lot of complexity above and beyond Haskell, but at the same time, fails to take proper advantage of it and the result is quite dirty, full of special cases, and consequently hard to reason about. So you get a lot of the costs, perhaps even more costs for compliance than a Haskell code base, but you get fewer benefits.

Re:Why functional programming matters by random314 on Tuesday April 18, 2017 @10:02AM (#14138864)
So far the only real instance of a big company abandoning Scala has been Yammer, so this is a mistaken impression. LinkedIn and Twitter are heavily invested in Scala.
Re:Why functional programming matters by marnett on Tuesday April 18, 2017 @04:43PM (#14142736)
The Quant firm Jane Street uses Ocaml and built Core [1], an alternative to the Ocaml standard lib. I wouldn't be surprised if their business domain benefits from FP.

Also demonware [2], which is owned by Acitivision/Blizzard and manages online game lobbies for all their titles (ie Call of Duty series across all platforms), uses Erlang. They switched from C++ to Erlang before Call of Duty Black Ops was released. They said if they hadn't decided to switch before the release the company would have never been able to handle the 5 months of user growth the game brought to their platform [3].

[1] https://github.com/janestreet/core [2] https://www.demonware.net/ [3] https://news.ycombinator.com/item?id=14120506

Re:Why functional programming matters by haskellandchill on Tuesday April 18, 2017 @10:11AM (#14138929)
Funny you mention Hack! It is written in OCaml ;)
Re:Why functional programming matters by tombert on Tuesday April 18, 2017 @10:43AM (#14139196)
Jet.com is almost exclusively F# at this point, at least for any of the backend systems.
Re:Why functional programming matters by jackmott on Tuesday April 18, 2017 @11:27AM (#14139618)
Plenty of people use functional languages in the wild, though sometimes, like Jane Street, they don't do it for the same reasons that are normally stated as being the reasons functional programming is better.

This is a good video, from Jane Street, on why they use OCaml:

https://www.youtube.com/watch?v=kZ1P8cHN3pY&t=109s

Re:Why functional programming matters by Insanity on Tuesday April 18, 2017 @09:54AM (#14138793)
Whatsapp is using Erlang on the backend afaik. I'd say Whatsapp was/is quite a successfull app.
Re:Why functional programming matters by 0xdeadbeefbabe on Tuesday April 18, 2017 @11:30AM (#14139657)
Re:Why functional programming matters by divs1210 on Tuesday April 18, 2017 @09:48AM (#14138752)
Helpshift (http://www.helpshift.com) is fairly large scale and is written primarily in Clojure.
Re:Why functional programming matters by neukoelln on Tuesday April 18, 2017 @09:58AM (#14138827)
Twitter have not abandoned Scala.
Re:Why functional programming matters by mattferderer on Tuesday April 18, 2017 @10:13AM (#14138952)
Facebook does a lot of OCaml & variations of it.
Re:Why functional programming matters by patrickmn on Tuesday April 18, 2017 @11:08AM (#14139437)
They also use Haskell (and the Haxl library) for their anti-spam engine.
Re:Why functional programming matters by joneholland on Tuesday April 18, 2017 @10:16AM (#14138971)
Expedia uses scala massively on the backend.
Re:Why functional programming matters by sandGorgon on Tuesday April 18, 2017 @09:33AM (#14138649)
ITA Software - lisp. Acquired by Google for 700 million.