5 ms·
What does strong typing have to do with procedural vs. declarative? IMO strong typing is beneficial regardless.
by layer8 2y ago
What does strong typing have to do with procedural vs. declarative? IMO strong typing is beneficial regardless.
- mithametacs 2y agoGrandparent was such a good post otherwise! I love strong types. I love for loops. I love stacks. GP! Try Rust. Imperative programming isn’t orthogonal to types. You can go hard in Rust. (I loved experimenting with it but I like GC) GP! Try data driven design. Imperative programming isn’t orthogonal to declarative. Real talk, show me any declarative game engine that’s worth looking at. The best ones are all imperative and data driven design is popular. Clearly imperative code has something going for it. and the advantages aren’t strictly speed of development, but imperative can be clearer. It just depends.
- stouset 2y agoI adore Rust. My point isn’t that you can’t have both, but that the two types of programmers have different default approaches to problem solving. One prefers to model the boundaries of domain as best they can (define what it should look like before implementing how it works), one prefers to do things procedurally (implement how it works and let “what it looks like” emerge as a natural result). Neither is strongly wrong or right, better or worse. They have different strengths in different problem areas, though I do think we’ve swung far too hard toward the procedural approach in the last decade.
- mithametacs 2y agoI agree with the distinction in approaches. In other words, it sounds like you're distinguishing agile and waterfall. I just find it odd to analogize: > agile : waterfall :: imperative : declarative
- stouset 2y agoEither you misread something or I communicated poorly.
- whilenot-dev 2y agoNot OP, but I'd answer... A strong type system is your knowledge about the world, or more precisely, your modeled knowledge about what this world is or contains - the focus is more on data structures and data types, and that's as declarative as it can get with programming languages(?). I'd also call it to be holistic. A procedural approach focussed more on how this world should be transformed - through the use of conditional branching and algorithms. The focus feels to be less on circumstances of this world, but more to be on temporary conditions of micro-states (if that makes any sense). I'd would call it to be reductionistic.
- deleted 2y ago[deleted]
- mmis1000 2y agoIt's the difference between "how?" and "what?". A procedural approach describe the step you do something. But not what is the problem you want to solve and why you want to do this to solve it. A declarative approach on the other end, describe the goal and intended solution first and try to make a proper procedure to achieve the goal. The two approach have their own cons and pros. But aren't explicitly exclusive. Sometimes the goal and solution aren't that clear. So you do it procedurally until you find a POC(Proof of concepts) that may actually solve the problem. And refine it in a declarative way.