Linters, What are they and why should you use them

Admittedly I had very little knowledge of linters until very recently. I knew of their existence and a basic idea of what they did but assumed they were hard to use and offered minimal results, but now I have seen the light and I must share.

So to start, what is a linter? I see a linter as a coder's version of spell check, but with a bunch of extra features. Linters check your code for bugs, styling, security breaches, and more. There are lots of linters available but since I’m a ruby guy I would like to look at a few ruby linters and talk about what they do.

The linter Brakeman is a Static analysis (meaning it checks your code by reading through it without actually executing anything) Security tool. It checks for SQL Injection vulnerabilities as well as XSS, config options, and more. These things can be hard to catch in your code on your own (especially if you're relatively new to programming, or web programming and don't have a thorough understanding of these attacks and how they are carried out or handled.

The linter Rubocop is another ruby linter, this checks for ways to make your code faster, or efficiencies in styling. It also helps with styling issues that don't follow the ruby styling guide.

Using these linters together can make your projects more efficient, more readable, and more secure. There are many more linters out there and taking the time to explore for some good ones can save you time down the road as well as make your code better. They are often easy to run, with rubocop being as simple as installing the gem and running one short command in the directory of your project.

--

--

--

Student at Flatiron School

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

First encounter with celery: tasks

Ruby — Strings Under a Microscope

Cryptocurrency Development in Python Using Blockchain Lists (Part 1)

Image by WorldSpectrum from Pixabay

iziffy customer care number=.9883774520=.8167431604

Git Basics

TotemFi’s Gate.io Deposit Reward Competition

Let’s talk Big O Notation

Flutter : how does flutter work

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kevin Jung

Kevin Jung

Student at Flatiron School

More from Medium

When you need to fix a bug and you can’t

Refactoring: Choosing abstractions

How to bring the micro into the frontend

The Developer Portal MVP