Skip to content

Instantly share code, notes, and snippets.

@elijahmanor
Last active December 28, 2015 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elijahmanor/6048b4f72265ee33fcaf to your computer and use it in GitHub Desktop.
Save elijahmanor/6048b4f72265ee33fcaf to your computer and use it in GitHub Desktop.
Eliminate JavaScript Code Smells

Eliminate JavaScript Code Smells

Title

Eliminate JavaScript Code Smells

OR

Deodorize JavaScript Code Smells

Description (unpublished notes)

This talk is intended to go beyond basic linting (JSLint/ESLint/JSHint) techniques and dig further into JavaScript anti-pattern code smells. The gist of the session is to identify common code smells and to introduce patterns to assist when refactoring.

Based on feedback from the first time I gave this talk I created several custom ESLint rules to address many of the smells I identified that weren't already covered by another tool.

Abstract

Have you ever written JavaScript that worked and passed Lint, but you didn't feel good about it? Maybe you knew it wasn't optimal, but you didn't yet know a better way to write it. We are going to give that code a name... a "code smell".

Your JavaScript may pass standard Lint rules, but that doesn't mean it's Legit.

"A code smell is a surface indication that usually corresponds to a deeper problem in the system" --Martin Fowler

As you progress in your journey as a developer you will find yourself identifying stinky code, but it takes time and training to combat against these smells. It can also be helpful to have proper tooling in place to detect common smells. Code smells scream to be refactored. We will discuss some existing tools and new rules that will help identify numerous smells in your code.

In this session we will look at various code smells and discuss techniques on how we can eliminate and protect against their pungent odors. I will explain the smell, discuss how we can detect it, and identify several ways to deodorize the stench.

Bio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment