Live data from Hacker News

All programming philosophies are about state

worldofbs.com

71–80 of 254 posts

Re: All programming philosophies are about state

#71

Earlier quoted context omitted.

Former long time anarchist, current long time FP proponent, presently having a laugh with you on this.

Out of curiosity, why former?

“He who is not a républicain at twenty compels one to doubt the generosity of his heart; but he who, after thirty, persists, compels one to doubt the soundness of his mind.”

Re: All programming philosophies are about state

#72
post #9

Earlier quoted context omitted.

I think what you're missing is that functional programming is about referential transparency. There should be no need for an instruction pointer in your mental model.

Not really. Try to interact with DB in FP. Yes, there is a referential transparency ... when combining functions which call DB (e.g. using monads). As a result you get a composite function, which is the same every time you run that composition. Who cares really? When you execute that composite function though you will potentially get different results and your "referential transparency" goes out the window. Of course…

DB operations are not what is being described in the conversation about referential transparency.

We’re talking about something that starts with things like reduce vs. a for loop with mutable variables to accumulate values. Once the language forces you to think in terms of stateful operations to perform even basic tasks, the reflexive tendency is to use mutable state to perform any task. At that point, nobody really knows what a functional does because you have to understand the entire system to know what the output of a function will be.

Re: All programming philosophies are about state

#73
Imperative: modifying state is the point of a bit-flipping machine; get out of my way so I can have fun!

OOP: OK, I mostly had enough fun, can we try to tame the bit-flipping chaos with real-world analogies, without deflating all the fun?

Functional: Any Monad is by definition an Endofunctor, which also means it's an object in the category of Endofunctors, where the monadic μ(flatMap) and η(unit) operators satisfy the definition of a Monoid in that particular Monoidal Category. You got that?

Declarative: I'm gonna need a corner office with a view, and $200K/y.

Re: All programming philosophies are about state

#74
post #56

The article is grouping things together that don't belong in the same categories. OO, functional, imperative, declarative: these are ways of controlling dispatch . Monoliths and microservices are both ways to organize codebases and teams of programmers and control whether dispatch is intermediated by the network or not. Either way, both of these options are implemented by some kind of language in the previous categor…

I agree this is mixing apples and oranges. To the degree that server architecture has to preserve state in various situations, though, coming from running my own dedicated monoliths and federated systems to service-oriented architecture about a decade ago, I have to grudgingly admit that the service model really is just cleaner and easier to wrangle. I'm thinking right now of a major version DB upgrade I have to pull this week where I'm going to have a go at the new blue/green provisioning provided by RDS. The old way would have required major downtime, rewiring web services, lots of risk of data collision, not to mention time on the phone with a datacenter just to get up and running. Ultimately the old ways always felt duct taped in some regard, like trying to switch the scenery of a stage production in the middle of an act. I hate that I'm so reliant on Amazon now, but it's just wildly more efficient.

Re: All programming philosophies are about state

#77
post #70
post #66

This article makes an error: All programming philosophies are about state, but they're not _just_ about state.

Disagreeing with someone's thesis is not the same as them making an error. Like maybe you don't find their argument compelling, but that's not the same as them making a factual error.

Since everyone already clearly understand what he means, so let's avoid playing semantics and instead focus on being clear and straightforward. It seems that your questions are only leading to more confusion and not offering any valuable perspectives.

Re: All programming philosophies are about state

#78
well, a program is moving around bits in computer memory, now state is a fancy name for the these bits. Makes sense that the philosophy of p. has something to do with this state of affairs.

But the philosophy of p. is also dealing with ways of creating abstractions, because you can't view everything exclusively on a very low level of abstraction, without loosing your mind.

Re: All programming philosophies are about state

#79
post #55

As someone coming from a functional perspective I would humbly characterize my position as: > Functional - Modifying state is hard to get correct; so let's focus on the rest of the problem (the part we can get right!) Pushing state to the edges is actually just a consequence of this impulse. In the end it isn't a satisfying solution, because you end up with every bit of low-level, inconsequential state percolating up…

Almost certainly there’s no meaningful insight to my random thought, but your comment reminded me of a conversation I had with Joe Armstrong about 10 years ago, discussing control vs data plane for Riak.

Originally Riak shipped its data around as part of Erlang’s standard messaging mechanism, the process mailboxes. Over time that was recognized as a bottleneck and data started being handled differently (honestly it’s been such a long time I don’t remember the details, or how far down that road we went).

I have no conclusion to this ill-formed rumination, I’m afraid, just that your point about managing state independently reminded me of that conversation.

Post reply on HN