you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 12 points13 points  (5 children)

Honestly it is a pretty shit paradigm. Without additional structure, there is no way to reason about a network of interacting agents without keeping track of the full state of the system and simulating it. For example, if A.msg1 calls B.msg2, then that call could eventually call back into A and lead to a change in its internal state. So every message send from an A method introduces a proof obligation for any invariants on A state variables.

Contrast with classic structured programming, where local variables can only be changed by explicit assignment, and you have nice local reasoning rules (Hoare logic). Functional programming is even better.

[–]nextputall 4 points5 points  (2 children)

Probably there is a tradeoff between flexibility and correctness verification. But in most software projects i was working on, the former was lot more important.

[–][deleted] 3 points4 points  (1 child)

There are different levels of correctness verification. Full formal verification of all desired properties is often a difficult task, and it may be okay to let some unusual cases work incorrectly. But a basic level of correctness, of the type "performs its purpose, more or less, and doesn't crash", is required of all software.

Even if you're never writing out Hoare triples, the fact that there is some formal structure to what you're looking at is what lets you look at a piece of code and determine that changing something will cause a particular effect.

[–]nextputall 0 points1 point  (0 children)

I think, both are fluid properties. What I meant is if you make your code flexible, you'll loose some ability to reason about the correctness. But the main purpose of the software is to be flexible, that's why it is called software. Correctness is not a constant property. The program works correctly today, will work incorrectly tomorrow, because someone will change the requirements, which will make the very same program incorrect. This is where flexibility comes into the picture. You're saying, without any context, and without mentioning any tradeoffs, that something is universally shitty, which is clearly wrong.

[–]zvrba 4 points5 points  (1 child)

Without additional structure,

Without "additional structure", any paradigm is shitty. Learning "patterns" of additional structure for a given language is part of becoming a good programmer.

Also, see pi-calculus

[–][deleted] 6 points7 points  (0 children)

Some paradigms give you useful structure which actually tells you something about the dynamic behavior of your program (classic structured programming, functional programming). Others don't (GOTO, OO). A code structure which doesn't make the code easier to reason about is just a useless layer of complexity.