The Samuel L. Jackson test of code quality

It was once said that the true measure of good code is the metric of WTF/min. I propose a new measure of code quality — the Samuel L. Jackson test.

Open a source code file. Any source code file. Start reviewing the code. If any line goes beyond 80 characters, you mark 1 snake. If any line or lines repeat with slight changes, you get 1 snake for each repeated line (well, in some cases this is a valid optimization technique — unrolled loops, but in today’s languages it’s mostly a way of defining configuration with key/value pairs instead of a proper structure).

If a function is longer than a whole page, collect one snake. Each elseif: collect 1 snake, do not pass go, go directly to jail, do not collect $50. By this moment, you’ve collected a few snakes. Now be like Samuel, enough is enough, and open some fucking windows!

Like what you read? Give Tit Petric a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.