How Clinne helps you in writing clean code.

Avinash Jaiswal
3 min readOct 25, 2020

--

When stepping into a corporate there are many subtle changes one gets introduced to. One of the most important one and something many mentors often stress upon is the importance of writing Clean Code. The Objective of writing Clean Code is to make your code understandable, to others, and to promote collaboration and teamwork. The guidelines often vary from language to language and can also be modified or tweaked from teams to teams. The objective remains the same.

Even though the idea has been around for some time and many books are available to be picked upon and read, one finds it hard to practice the methodology while coding. Most of the times, they need to tackle and win over so much more than poorly written code. Personal biases and the inability to “learn to unlearn” serves as huge roadblocks in one’s development. But everyone loves to play games, right!! Won't it be great if there is a game that is fun to play and at the same time helps us, subconsciously, in learning the nitty-gritty subtleties of clean code? Clinne is the help you seek!

Clinne is an open-source cli application that helps one learn clean code and play all the while doing so. One can install it on their operating systems and then play the game using the terminal. Clinne got its name from the abbreviations CLI and NNE. CLI stands for Command Line Interface and NNE for Non-Negotiable Etiquettes.

We call these NNE because one can’t negotiate their stand around these while writing code and must follow these to achieve the expectations of Clean Code.

The NNEs we are expected to follow while writing Clean Code can be summarized in eleven points. These are:-

1. Indentation and spacing between code constructs (classes/methods/specs) must be consistent
2. Use only spaces (no tabs) for indentation
3. Newlines at end of file
4. Follow accepted naming conventions for your language/framework
5. Follow accepted naming file and Directory structure for your language/framework
6. Use namespaces
7. No comments/Unused Code must ever be checked in
8. Runtime environment should be consistent with IDE environment - i.e there should be no difference in running a build or a spec from your IDE and from the command line
9. Use .gitignore
10. Ensure there is a README.md that includes: Problem Description, Dev Environment Setup, How to run test, Build Instructions, Run instructions.
11. Test Driven Development (this should show clear pattern in the commit log: red, green, commit; refactor commit;)

The idea to develop clinne originated in Gojek’s Bootcamp. Bootcamps are rigorous code drills where you have to rm -rf <your code folder> if you don't follow NNEs while showcasing to your coaches. One will find clinne says “Do The Honors” when you answer incorrectly. That is because it was common slang in the Bootcamp when they wanted to rm -rf your code. LOL!!

Below is a video walkthrough of the application.

Clinne Walkthrough

Clinne is open source on github and I would love if you visit. If you wanna suggest something, open an issue and describe ‘em!!

--

--