Recently in class we started to learn more about linting tools. In the class we used a linter to check all documents in a project to see which words are redundant or misspelled. After looking into some articles online I realised that linters could be used for many things. For example, if a company wants its developers to write code within a certain format so that other developers in the company can easily read it. It is not just for formatting it can be used for coding errors, bugs, security vulnerabilities and stylistic inconsistencies. In addition, linters can be used for many different types of programming languages that allows organizations or groups to set a standard for everyone coding in that project.
A linter is able to do all of this by dividing the code into units for variables, types, functions etc. Then to make these units into tokens that then compare these tokens to the tokens already made in the linter. Next it checks if these tokens are different to the premade ones and will flag them depending on the reason the linter is used for that project.
There are a lot of reasons why projects use linters. Here are a few examples: it decreases errors, it makes code more consistent, improves code quality, improves security, saves money by being time efficient, and setting coding expectations with the team. Let me explain further: no project or company wants their program to have errors that make it towards the end user. In addition, linters being able to save money is by checking the code to prevent issues from costing more time to fix and more money to fix.
Many companies want to save as much money as possible within the different steps of development: production, design, testing, development and maintenance. Each of these steps requires a lot of people to verify if the code is working or if the code is what the customer wants. In addition, having developers be able to not spend as much time finding errors and solving them. That is why linters can save companies a lot of money for the next project or maintain operations.
I do have a problem with linters personally, when I am focused on doing something. Then I have to use a linter, it makes me lose focus and creates friction to get back to focusing on the task at hand. This a minor problem because once I get used to using a linter then there will be less friction between focusing on the task at hand and solving errors caught by the linter.
From the blog CS@Worcester – Site Title by Ben Santos and used with permission of the author. All other rights reserved by the author.
