News for hackers. Stuff that matters.
Re:Please do not attempt to simplify this code by partycoder on Thursday December 27, 2018 @08:23PM (#18774166)
> that smallness-of-file or smallness-of-function is not a target to shoot for

I disagree. Unless you are methodical and know what you are doing (like NASA or the authors of Kubernetes), it is hard to create large functions and files by keeping levels of detail consistent and not repeating code.

How do you test a function that has 100 unique outcomes? How do you safely maintain it to ensure it won't break? How do you even know it's working?

Re:Please do not attempt to simplify this code by AstralStorm on Friday December 28, 2018 @09:14AM (#18776796)
Write automated proofs? Probably best but tooling is junk - it's rarely supported.

Constraint or property based tests as opposed to value tests? (That depends on how unique.) Usually the only thing that does unique things is a direct mapping, everything else is either an equation or has other preconditions, postconditions and internal or external properties. It also makes the logic more directly visible and refactoring easier presuming tests are reasonably written.

Ensure coverage with a tool to be sure.

Re:Please do not attempt to simplify this code by sdenton4 on Friday December 28, 2018 @12:10AM (#18775004)
Write 100 tests?