News for hackers. Stuff that matters.
Re:Why Isn't Functional Programming the Norm? [video] by chii on Thursday October 17, 2019 @07:46AM (#21280977)
but now that you've written the cake baking data type, with a little small tweak, you've got a bread baking data type.
Re:Why Isn't Functional Programming the Norm? [video] by missosoup on Thursday October 17, 2019 @07:49AM (#21280999)
I'll find it more intuitive to do both as an imperative series of steps.

Some of my friends are in love with FP. I am not. I've done more FP than most, I can work with it, but my brain has never become in tune with it. I can bang out my intent as imperative code in real time, but with FP I have to stop and think to translate.

FP also means that I can't always easily tell the runtime complexity of what I'm writing and there's a complex black box between my code and the metal.

Maybe some of my friends' brains are superior and can think in FP, all the more power to them. but empirical evidence is that most people are not capable of that, so FP will probably forever remain in the shadow of imperative programming.

Re:Why Isn't Functional Programming the Norm? [video] by pas on Thursday October 17, 2019 @08:17AM (#21281188)
Do you think of types and transformations between types when you write imperative code?

I mean usually the problem in FP is that you simply can't type mutation (you'd have to use dependent types and so on), okay, so use immutability, great, but then every "step" is just some franken-type-partial-whatever. And TypeScript has great support for these (first of all it infers a lot, but you can use nice type combinators to safeguard that you get what you wanted).

I don't like pure FP exactly because of this, because many times you have to use some very complicated constellation of concepts to be able to represent a specific data flow / computation / transformation / data structure. Whereas in TS / Scala you just have a nice escape hatch.

Re:Why Isn't Functional Programming the Norm? [video] by jacobush on Thursday October 17, 2019 @07:50AM (#21281014)
Haha, that sounds like the C++ inheritance joke.
Re:Why Isn't Functional Programming the Norm? [video] by marvin on Thursday October 17, 2019 @08:33AM (#21281317)
True, but what if you never wanted bread?
Re:Why Isn't Functional Programming the Norm? [video] by Torwald on Thursday October 17, 2019 @07:54AM (#21281037)
I'd rather have a baking class that takes an argument for what I want to bake, either bread or cake, and spares me the details of how baking is done. I don't have to know that a preheated oven is one that is at 175 grades etc
Re:Why Isn't Functional Programming the Norm? [video] by EpicEng on Thursday October 17, 2019 @10:50AM (#21282646)
And when your oven has a problem with it's heating element you'll have no idea why your cake didn't turn out well. We're supposed to be engineers, right? Learning how things work is good.
Re:Why Isn't Functional Programming the Norm? [video] by Torwald on Saturday October 19, 2019 @12:49PM (#21299373)
My comment was supposed to be a joke about the vernacular in which OO tends to get presented.
Re:Why Isn't Functional Programming the Norm? [video] by TomMarius on Thursday October 17, 2019 @08:14AM (#21281162)
But then your cake might easily burn.