3 ms·
>I guess my default answer is: because I have to solve some business problem to get paid, and I never have enough information or time to do it right That's a r
by coldtea 8y ago
>I guess my default answer is: because I have to solve some business problem to get paid, and I never have enough information or time to do it right
That's a red herring.
People working on a business program don't need to encode the "whole information to do it right" (e.g. for the eventual version of the program when every constraint is known).
Just the ones that have to hold at the time they right it, and they already know those -- from their current requirements.
>or phrased differently: If I took enough time to do it right, someone else would have already done it wrong and moved on.
That's also a red herring, unless you don't write tests either.
- TooBrokeToBeg 8y ago> unless you don't write tests either. You mean "oracles" (from the blog post). Just program correctly amirite? eyeroll If your example doesn't deal with user input, you're talking about a problem of modeling under known conditions, which is trivial and ivory tower arrogance.
- coldtea 8y ago>You mean "oracles" (from the blog post). Just program correctly amirite? eyeroll I don't see the reason for the eyeroll. You'd have a point if the "just program correctly" meant "just get it right". But it's not. It's "just use contracts and invariants explicitly defined in your program, Eiffel style to check its correctness". Which is even more powerful than writing tests. >f your example doesn't deal with user input, you're talking about a problem of modeling under known conditions, which is trivial and ivory tower arrogance. Not sure how tests are anything other than "modeling under known conditions". Are the assertions in your test in any way "unknown"? If you mean fuzzing, you can do that trivially with Eiffel style programs as well. And the "tests" you do that way are there in the code, available in the debugger, and so on.
- pdimitar 8y agoCan you give a practical example on how to encode invariants explicitly in a more popular language? As for contracts, basically 99% of the languages have some form of the Java interfaces, or Elixir behaviours/protocols, or LISP's several ways of doing it. But for invariants, I would appreciate an example if you are willing to provide one.