News for hackers. Stuff that matters.
Re:Why Don't People Use Formal Methods? by mattmoss on Tuesday January 22, 2019 @10:51AM (#18969109)
> That's a problem with specs, the most concise and complete way to write them is by writing your program.

I've never dealt with formal specs/design, certainly nothing like those described here. Your comment (however in/accurate) strikes me as interesting and leads me to wonder...

What if we took the code and processed it to generate a "spec"? (I quote "spec" here b/c I wouldn't consider it a spec, but don't know what else to call it.) Basically, a document that explains verbosely what the written code does... hopefully in a way that is reasonably, humanly digestable.

Then we might get a doc that says, "Function add(...) accepts two integers/nulls and returns the sum." And Joe-coder looks and realizes it shouldn't accept nulls, goes back to the code, fixes the issue.

Re:Why Don't People Use Formal Methods? by johnmaguire2013 on Tuesday January 22, 2019 @11:14AM (#18969316)
This is essentially what static code analysis attempts to do. Unfortunately, there are many ways of writing programs that today's static code analysis cannot understand.
Re:Why Don't People Use Formal Methods? by philipodonnell on Tuesday January 22, 2019 @11:03AM (#18969215)
If there was a rule that functions could only return named variables (vs expressions that evaluate to a value that is returned) it would get closer to "this function accepts paramName1 and paramName2 and returns sumOfParams".