JavaScript Code Smells
Note: This post is over 11 years old. The information may be outdated.
"A code smell is a surface indication that usually corresponds to a deeper problem in the system"
As we grow as developers we strive to write more maintainable code, but on our journey we often times don't know what that looks like yet.
Your JavaScript may pass standard JSHint rules, but that doesn't mean it's legit.
Most developers can smell brittle and fragile code a mile away, but it takes time and training to combat against these smells. Code smells scream to be refactored.
Video
The following video was recorded this year at FluentConf. This is the 30 minute version of the talk.
Types of Smells
The following are the types of smells that are covered throughout the presentation. The names are a bit odd, but there's a weird compulsion to alliterate at times :)
- Convoluted Code Smell
- Copy Paste Code Smell
- Switch Statement Smell
- The This Abyss Smell
- Crisp Concatenation Smell
- jQuery Inquiry
- Temperamental Timer Smell
- Repeat Reassign Smell
- Inappropriate Intimacy Smell
- Incessant Interaction Smell
- Anonymous Algorithm Smell
- Unconfirmed Code Smell
- Two-Way Data Binding Smell
Slides
You can find the slides from the presentation online at elijahmanor.com/talks/js-smells
Related Posts
Guess.js
Guess.js - Thư viện và công cụ cải thiện UX dựa trên Dữ liệu, thống kê và Machine Learning. Và cách cài đặt plugin Gatsby.
Resting và Spreading JavaScript Objects
Resting và spreading càng ngày được ưa chuộng vì sự tiện lợi của nó, sau đây là 7 tricks với JavaScript objects.
Javascript Weekly #9
Javascript Weekly #9: Date-DNS, chi tiết về các bản cập nhật mới của V8, React và Angular.  ## [date-fns: A Modern...
Yarn: A new package manager for JavaScript
Facebook has launched Yarn