Hacker News new | ask | show | jobs
by uticus 1051 days ago
The "sane logic" part can be helped and automated by a code analyzer, but I also like to manually read the code (I'm manually reading anyway, as much as possible, to enable learning opportunities and conversation as needed).

Unit testing will not help this aspect much. Indeed the spies you mention are the only way I know of to check this in a meaningful way - in a unit test. Fuzzing gets closer, as it has a better possibility of exposing corner cases that accompany the "insane" logic.

Maybe I'm old school but imo it's an art, partly driven by language capabilities and intentions. There are times when the logic, taken by itself, is totally fine but in the larger context is misleading. Of course this idea of sane logic bleeds over into the other areas mentioned in the article. So it's not a complaint against the article, more of something that is important to my personal experience. I mean if one writes a compendium one has to classify somehow, and this article do a good job of that.

2 comments

Forgot to mention, the idea of "sane logic" is often times more important for the human who maintains the code, than the consumer who gets whatever it is the code has produced. Maybe that clarifies my thoughts.
Thanks for the clarification! By the way, I am going to add a reference to fuzz testing after your mention.