Earlier quoted context omitted.
That's utter rubbish. My team has been working with Clojure for close to a decade now. We regularly hire coop students from university, and none of them have ever had problems learning functional programming. It typically takes around a couple of weeks for a student to become productive and start writing useful code. The only people I've ever met who say that FP doesn't map to the way our brains work are people who'r…
I think you can do better than calling something you disagree with “rubbish” because your team didn’t have problems with it. Here’s an example of people finding functional programming unnatural, maybe you can leverage your experience to explain why he is wrong: Functional Programming Is Not Popular Because It Is Weird https://probablydance.com/2016/02/27/functional-programming-...
Why Isn't Functional Programming the Norm? [video]
331–340 of 417 posts
Re: Why Isn't Functional Programming the Norm? [video]
#332Earlier quoted context omitted.
They already said they were working in games. None of what you said applies to that field.
I have a suspicion this is only semi-true. For controlling what the CPU and RAM are doing? Yes. The graphics shader, on the other hand, is a pipeline architecture with extremely tight constraints on side-effects. The fact the shader languages are procedural seems mostly accident of history or association to me than optimal utility, and the most common error I see new shader developers make is thinking that C-style sy…
That was true 10 years ago. Now they're just tight constraints but not extremely so: there're append buffers, random access writeable resources, group shared memory, etc.
> The way the C-style semantics interface to the behavior of the shader seems very hacky
I agree about GLSL, but HLSL and CUDA are better in that regard, IMO.
Re: Why Isn't Functional Programming the Norm? [video]
#333I feel it's because functional programming is not a general application methodology. It excels at several idioms that we use as programmers but I feel it's something more specialized and niche then OO programming. I personally use OO as a base and iterate from there, using Functional idioms where is applicable. Some classes of programs can be described in its entirety in functional terms, but they're a small portion…
You know, at some point in history most scientists in Europe believed that the math can only be done using Roman numerals.
Re: Why Isn't Functional Programming the Norm? [video]
#334To this newbie, procedural is ===SO=== much easier to understand.
Julie Moronuki who never had any exposure to programming at all and has a degree in linguistics decided to learn Haskell as her first programming language, just as an experiment. Not only she did manage to learn Haskell and become an expert, she co-authored one of the best selling Haskell books. I remember her saying that after Haskell other (more traditional) languages looked extremely confusing and weird to her.
Re: Why Isn't Functional Programming the Norm? [video]
#335Because it's not that useful. There is an contest organized by the International Conference on Functional Programming: https://en.wikipedia.org/wiki/ICFP_Programming_Contest It was more or less designed to show the superiority of functional programming languages. Yet in that contest C++ has done better than OCaml or Haskell... The FP crowd seems to be more active doing advocacy than writing code. Yes, we know, there…
Just because you don't see it, doesn't mean it's not happening. - Have you ever heard about how Walmart handles Black Fridays? - Do you even know what's behind Apple's payment system? - You ever used Pandoc, Couchbase, Grammarly, CircleCI, Clubhouse.io, Pandora, Soundcloud, Spotify? - Have you ever asked a question - what is an app like WhatsApp that was sold for $19 Billion runs on? - or How Facebook fights spam, Ci…
Every large (or even small) company has people writing stuff in Perl, Bash, Haskell, Ruby, Rust, VBA, Scala, Lua or what not. I've been that guy, too.
More often than not it is a distraction more than anything, and it ultimately ends up being rewritten in C++, Java or Python. I think there are some niches where it helps; OCaml has had some success with static analysis and proof assistants, or even with code generation projects like FFTW.
Re: Why Isn't Functional Programming the Norm? [video]
#336The top comment on YouTube raises a valid point: > I've programmed both functional and non-functional (not necessarily OO) programming languages for ~2 decades now. This misses the point. Even if functional programming helps you reason about ADTs and data flow, monads, etc, it has the opposite effect for helping you reason about what the machine is doing. You have no control over execution, memory layout, garbage col…
Re: Why Isn't Functional Programming the Norm? [video]
#337Earlier quoted context omitted.
Personally, I get frustrated that there seems to be a belief that you can only use FP or OOP, when the reality is both models can be used in conjunction, and there may be reasons to choose one over the other dependent on what you are doing. Not to mention there are other models such as Protocol Oriented Programming. You see this in languages like Swift.
The issues is that you get benefits for sticking to one paradigm, because then everything is made of the same stuff. If everything is an object, then you can use all your tooling that works with objects, which is everything. If everything is pure, you get easy parallelism. If everything is an actor, you get easy distributability. If everything is a monad or function, you get easy compositionality. The list goes on. S…
Re: Why Isn't Functional Programming the Norm? [video]
#338Earlier quoted context omitted.
> FP will always occupy a niche because of where it sits in the abstraction hierarchy At some point in history, people stopped worrying about not understanding compilers, how they allocate registers and handle loops and do low-level optimizations. The compilers (and languages like C or C++) became good enough (or even better than humans in many cases) in optimizing code. The same happened with managed memory and data…
Some people stopped worrying about not understanding compilers. They're not working on drivers, realtime (esp where low lag & jitter are concerned such as motion control), or high performance software of all stripes, trying to squeeze the most out of the available hardware. It's all about choosing the right tool for the job, and there is no right tool for every job. A guy generating sales reports has very, very diffe…
But no, it's not some people, it's not most people, it's 99%+ of all developers that stopped worrying about compilers. There will always be a use case for it, but when we're talking about There will always be niches in any industry, but we shouldn't design our industry/profession about niche cases.
Re: Why Isn't Functional Programming the Norm? [video]
#339Functional programming is not new, it has been around for many decades. The reason it didn't catch on is because it doesn't map very well to how our brain works. Human brains are object oriented, so OOP is very easy to grasp. The real question is, why are people now taking a second look at functional programming. And the answer is Moore's law. Moore's law is coming to and end, and CPUs are not getting faster. Instead…
> Human brains are object oriented, so OOP is very easy to grasp. Can I cite you on this? Because I have only ever seen this explained in Programming 101, where Java is the language they teach. I wonder where this sentiment comes from. I imagine it came from marketing.
No, you can't. Because like the other commenter noted: "This is utter rubbish." It only looks easy to understand on the surface, but quickly becomes a mess. "spaghetti code" and "lasagna code" are the terms invented in OOP realm. Being said that - some advanced FP concepts can be pretty daunting to grasp as well.
Saying that human brains are OOP or FP oriented is equivalent to saying that human brains wired to recognize patterns in music but not color, or something like that.
Re: Why Isn't Functional Programming the Norm? [video]
#340as someone who made my first SPA, using Elm & met the presenter once in NY. functional programming is elegant and nice. but practicality is another different matter. for it, to be the norm, it has to have 10x advantages over the status quo. on the frontend, part JS already offers some features of functional programming, with some imperative parts. On the backend, none of the functional languages you would want to use…