Where does the term code linting come from?

20 November 2020

Lint, Linting and Linter are words you may have heard where talking about static code analysis tools to flag and fix programming errors, bugs, find unused variables and enforce coding standards and styles, but where do these terms come from?

The history of linters

While working at Bell Labs in 1978, a computer scientist, Stephen C Johnson had been developing Yacc (Yet Another Compiler-Compiler) in C and was dealing with portability issues from Unix to 32-bit machine, when he decided to develop a program he called lint (Not us) to help with debugging. Over the years, many different versions of lint have been developed, and for many languages including C, C++, Ruby, Javascript and Python just to name a few. Lint like tools were added to optimising compilers to help generate faster code, with Johnson saying in an 1978 paper that it allowed programmers to “concentrate at one stage of the programming process solely on the algorithms, data structures, and correctness of the program, and then later retrofit, with the aid of lint, the desirable properties of universality and portability”

Linters today

As linters have evolved alongside compilers, many have included lint’s historical functionality and added an even wider variety of checks. These checks include syntax errors, deprecated function, formatting conventions, dangerous language features, use of undeclared variables etc Linters are specially useful in interpreted languages like Javascript, Python and Ruby, as these languages lack the compiling phase that display errors prior to execution, generally these tools perform static analysis of the source code, drawing attention to possible errors for the common easy to find to the more complex errors.

Origin of the term “Lint”

It is thought that the term “Lint” is thought to have come from the common term for the accumulation of textile fibres and other materials found on or around clothing. Which is then collected and removed or “Linted”.

George Buckley code analysis expert
George Buckley