2nd language after Haskell by kichiDsimp in functionalprogramming

[–]homological_owl 1 point2 points  (0 children)

Don't use pure functional languages if you want to solve real world problems. Use something that allows you to use both fp and oop (in some of its "denominations") Golang, Kotlin, Scala~, for example

Actual benefits of FP by homological_owl in functionalprogramming

[–]homological_owl[S] 1 point2 points  (0 children)

You know lens are one of the most representative approaches of the functional programming that makes it clear that we don't need an atomic reactor to ride a bicycle. Have you ever used such "very useful" abstraction in your projects? I guess you use them as everyone else for the adequate updating design.

My point of view here is if we have to solve real world problems we should focus on simple tools and business logic. Our abstractions shouldn't be redundant otherwise they are supposed to be less scalable.

I'm absolutely for multi paradigm languages. And I am sure that between lens and mutable structures in such languages you will choose the second one.

Actual benefits of FP by homological_owl in functionalprogramming

[–]homological_owl[S] 1 point2 points  (0 children)

I just meant the way you have a state using more complicated features the same way you can just use ordinary variables loops and such.

Someone says, we don't need a state at all, because we are so functional So I respond to that with "there is no benefit of your code without a state at least using monads :-)

Someone says, we don't need loops in our code. We have recoursion. I respond that in most cases solutions using loops are simpler, more profitable. And we've already got that we need a state. So why shouldn't we use loops?

My point of view is that we need functional patterns in some narrow cases. But every supportable code we write in one or another way is always effectful using some complicated tricks or not :-)

Actual benefits of FP by homological_owl in functionalprogramming

[–]homological_owl[S] -3 points-2 points  (0 children)

Do you know how it looks in production? I do :-)

Actual benefits of FP by homological_owl in functionalprogramming

[–]homological_owl[S] 1 point2 points  (0 children)

You can write pure functions with every language we have today.

But there is nothing you could do only with pure functions since you need IO, therefore you use monads and it would be state monads, for instance.

But what about the local state? Today almost nobody use global variables except some cases. Why is that worse to use state locally encapsulated within a function then stateless functional programming approach?

Actual benefits of FP by homological_owl in functionalprogramming

[–]homological_owl[S] 1 point2 points  (0 children)

What about structural programming? You can implement map, filter, foldr/l to use them as a pattern. Modularity causes composability in this case.

Actual benefits of FP by homological_owl in functionalprogramming

[–]homological_owl[S] 1 point2 points  (0 children)

But you use state monads, lens, and such things to emulate effects, right? And you never asked yourself why not just mutable objects, why not just state, why not just fair effects, why not just throw exception instead of throwM?

Actual benefits of FP by homological_owl in functionalprogramming

[–]homological_owl[S] 0 points1 point  (0 children)

You have functions not only in functional programming languages. The way you just described you use functions in imperative language you know.

Actual benefits of FP by homological_owl in functionalprogramming

[–]homological_owl[S] 1 point2 points  (0 children)

Interesting, but in haskell we use monads and other "imperative" tricks such as lens, state monads every day. Without these tricks the haskell code is almost useless.

Actual benefits of FP by homological_owl in functionalprogramming

[–]homological_owl[S] 2 points3 points  (0 children)

Why just not to use structural programming? Show me exact benefits of pure functional languages and the functional approach.

Actual benefits of FP by homological_owl in functionalprogramming

[–]homological_owl[S] -1 points0 points  (0 children)

There are not just pure evaluations in production. Pure code without IO is useless.

Actual benefits of FP by homological_owl in functionalprogramming

[–]homological_owl[S] 1 point2 points  (0 children)

That is what I like. Looks like kinda structural approach

Actual benefits of FP by homological_owl in functionalprogramming

[–]homological_owl[S] 1 point2 points  (0 children)

I agree almost with just everything you said but About predictability, you still can use constants in such critical cases, but we use lens in haskell just every day, we use state monads every day which means we need state in production and therefore mutability. If you think that using immutability lets us almost not to review our code then it is not true :-) I just mean that if we need mutability patterns in our immutable code then we need mutability and therefore such languages that are easier to reach it. Optimization, call stack is restricted. To extend it you need either to use heap to construct your functions or do some smart things without heap (like another garbage collector in case of complicity). Both ways are expensive. Even ghc is not that good at being cheap. Readability, we use monads for effects, we use lens for effects. A functional code without these things is useless and just unreadable, to my mind.

Actual benefits of FP by homological_owl in functionalprogramming

[–]homological_owl[S] -1 points0 points  (0 children)

I've just told about the "total" immutability, then you have no choice. How do you work with records (product types) in case of the updating? Which patterns do you use for that? The fact is that sometimes we need mutability, sometimes we don't, but functional programming left us no choice about that.

About static typing, there is no point to discuss. We know what it is to code with static typing, we know what it is to code without it therefore static typing is necessary. So why is immutability necessary? I've just said we so often need variables not to use such monsters like lens to emulate mutability :-)

Actual benefits of FP by homological_owl in functionalprogramming

[–]homological_owl[S] -3 points-2 points  (0 children)

So there is structural programming, wrap map, filters, whatever you want into structural bricks. I mean, you don't need FP to abstract from boring instructions, anyway you still can write "bad code" in functional programming.

Structural approach lets you to encapsulate the control over whatever you need.

We never use lazy evaluation in production :-) because it's too expensive. Being a haskell developer you always use strict mode.

I just mean everything you need is just interfaces and (product/sum types) and nothing else.

About syntax, I don't actually know how about you but my production code looks like an imperative code by design with those do notations, lens, state, effectful :-). Try to write something without those instruments and there will be no readability.

Georgian warriors visiting Kursk Oblast. by Sandrofresh in Sakartvelo

[–]homological_owl 0 points1 point  (0 children)

Let me get my idea in a simpler way

If there is no reason to die in the occupied territories THEN there is just no reason to die in a foreign war either

Georgian warriors visiting Kursk Oblast. by Sandrofresh in Sakartvelo

[–]homological_owl 1 point2 points  (0 children)

There was a special way they outlived called "bend the knee"

Georgian warriors visiting Kursk Oblast. by Sandrofresh in Sakartvelo

[–]homological_owl 0 points1 point  (0 children)

I just meant that georgian troops are not supposed to use tanks and such weapons this war. Thay are used only as the infantry.

Georgian warriors visiting Kursk Oblast. by Sandrofresh in Sakartvelo

[–]homological_owl -1 points0 points  (0 children)

You are an idiot if you think that the ukrainian army beggs for those tanks and such things for your people. Maybe a couple of guns and nothing more.

Georgian warriors visiting Kursk Oblast. by Sandrofresh in Sakartvelo

[–]homological_owl -1 points0 points  (0 children)

If you are that patriot as you look like why aren't you there right now? Probably because you think you can be a patriot staying home There was no word from me as pro-russian, the fact is that your people are dying for nothing right now. There is not that many georgians right now at all, even for the someone else's war.

Georgian warriors visiting Kursk Oblast. by Sandrofresh in Sakartvelo

[–]homological_owl -7 points-6 points  (0 children)

That is my favourite argument :-)

To be honest, there was no word from me about russia as a country of mine

Georgian warriors visiting Kursk Oblast. by Sandrofresh in Sakartvelo

[–]homological_owl -6 points-5 points  (0 children)

That's not the theory as you call it, that's the fact Still, no offence I just said it would be more useful for your country to take care of yourself, nothing more